Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/gst-plugins-good.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2015-11-18 03:14:01 +0300
committerOlivier CrĂȘte <olivier.crete@collabora.com>2020-09-18 17:54:23 +0300
commitc79a5209460aed70dc72a86e5b1e85b5d12b5b54 (patch)
tree0a23830c09fce6184d0098bd93171b402928cd15 /gst
parentc90af726ab305f12d8803046fb56786f34a3ddea (diff)
splitmuxsrc: Implement segment query
Fixes #239 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/713>
Diffstat (limited to 'gst')
-rw-r--r--gst/multifile/gstsplitmuxsrc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gst/multifile/gstsplitmuxsrc.c b/gst/multifile/gstsplitmuxsrc.c
index 25c5d775f..69be9ff53 100644
--- a/gst/multifile/gstsplitmuxsrc.c
+++ b/gst/multifile/gstsplitmuxsrc.c
@@ -1509,6 +1509,32 @@ splitmux_src_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
break;
}
+ case GST_QUERY_SEGMENT:{
+ GstFormat format;
+ gint64 start, stop;
+
+ SPLITMUX_SRC_LOCK (splitmux);
+ format = splitmux->play_segment.format;
+
+ start =
+ gst_segment_to_stream_time (&splitmux->play_segment, format,
+ splitmux->play_segment.start);
+ if (splitmux->play_segment.stop == GST_CLOCK_TIME_NONE) {
+ if (splitmux->play_segment.duration == GST_CLOCK_TIME_NONE)
+ stop = GST_CLOCK_TIME_NONE;
+ else
+ stop = start + splitmux->play_segment.duration;
+ } else {
+ stop = gst_segment_to_stream_time (&splitmux->play_segment, format,
+ splitmux->play_segment.stop);
+ }
+
+ gst_query_set_segment (query, splitmux->play_segment.rate, format, start,
+ stop);
+ ret = TRUE;
+
+ SPLITMUX_SRC_UNLOCK (splitmux);
+ }
default:
break;
}