From 6b78fa336ddb8da828c6d5a49a92fdcd9b7a91a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 29 Jul 2013 11:00:14 +0200 Subject: [PATCH] mxfdemux: Implement SEGMENT query --- gst/mxf/mxfdemux.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index cf5201a..119a7d6 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -3643,6 +3643,31 @@ gst_mxf_demux_src_query (GstPad * pad, GstObject * parent, GstQuery * query) break; } + case GST_QUERY_SEGMENT:{ + GstFormat format; + gint64 start, stop; + + format = demux->segment.format; + + start = + gst_segment_to_stream_time (&demux->segment, format, + demux->segment.start); + if ((stop = demux->segment.stop) == -1) + stop = demux->segment.duration; + else + stop = gst_segment_to_stream_time (&demux->segment, format, stop); + + if (demux->segment.rate < 0.0) { + gint64 tmp; + tmp = stop; + stop = start; + start = tmp; + } + + gst_query_set_segment (query, demux->segment.rate, format, start, stop); + ret = TRUE; + break; + } default: ret = gst_pad_query_default (pad, parent, query); break; @@ -3916,6 +3941,31 @@ gst_mxf_demux_query (GstElement * element, GstQuery * query) break; } + case GST_QUERY_SEGMENT:{ + GstFormat format; + gint64 start, stop; + + format = demux->segment.format; + + start = + gst_segment_to_stream_time (&demux->segment, format, + demux->segment.start); + if ((stop = demux->segment.stop) == -1) + stop = demux->segment.duration; + else + stop = gst_segment_to_stream_time (&demux->segment, format, stop); + + if (demux->segment.rate < 0.0) { + gint64 tmp; + tmp = stop; + stop = start; + start = tmp; + } + + gst_query_set_segment (query, demux->segment.rate, format, start, stop); + ret = TRUE; + break; + } default: /* else forward upstream */ ret = gst_pad_peer_query (demux->sinkpad, query); -- 2.7.4