diff options
author | Dave Robillard <dave@drobilla.net> | 2009-07-22 14:36:14 -0400 |
---|---|---|
committer | Dave Robillard <dave@drobilla.net> | 2009-07-22 14:36:14 -0400 |
commit | adadf06b0a9e26005ba9363aa0049dc0b740c94d (patch) | |
tree | b61e688d7ed775acff14763d0453102f80cc6c09 /gst/mxf/mxfdemux.c | |
parent | 23ef5d4ac3487345c1c91db57c76554363e6c0f5 (diff) | |
parent | 5d9d4a7b518c42bda88c7f6c87ce7c3c01233562 (diff) | |
download | gst-plugins-bad-adadf06b0a9e26005ba9363aa0049dc0b740c94d.tar.gz gst-plugins-bad-adadf06b0a9e26005ba9363aa0049dc0b740c94d.tar.bz2 gst-plugins-bad-adadf06b0a9e26005ba9363aa0049dc0b740c94d.zip |
Merge branch 'fdo' into lv2
Diffstat (limited to 'gst/mxf/mxfdemux.c')
-rw-r--r-- | gst/mxf/mxfdemux.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c index 5abd37ff..e646be8c 100644 --- a/gst/mxf/mxfdemux.c +++ b/gst/mxf/mxfdemux.c @@ -3453,6 +3453,7 @@ gst_mxf_demux_src_query_type (GstPad * pad) static const GstQueryType types[] = { GST_QUERY_POSITION, GST_QUERY_DURATION, + GST_QUERY_SEEKING, 0 }; @@ -3545,6 +3546,33 @@ gst_mxf_demux_src_query (GstPad * pad, GstQuery * query) ret = TRUE; break; } + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + ret = TRUE; + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + if (fmt != GST_FORMAT_TIME) { + gst_query_set_seeking (query, fmt, FALSE, -1, -1); + goto done; + } + + if (demux->random_access) { + gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1); + } else { + GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES); + gboolean seekable; + + seekable = gst_pad_peer_query (demux->sinkpad, peerquery); + if (seekable) + gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL); + if (seekable) + gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1); + else + gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1); + } + + break; + } default: /* else forward upstream */ ret = gst_pad_peer_query (demux->sinkpad, query); @@ -3806,6 +3834,33 @@ gst_mxf_demux_query (GstElement * element, GstQuery * query) ret = TRUE; break; } + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + ret = TRUE; + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + if (fmt != GST_FORMAT_TIME) { + gst_query_set_seeking (query, fmt, FALSE, -1, -1); + goto done; + } + + if (demux->random_access) { + gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1); + } else { + GstQuery *peerquery = gst_query_new_seeking (GST_FORMAT_BYTES); + gboolean seekable; + + seekable = gst_pad_peer_query (demux->sinkpad, peerquery); + if (seekable) + gst_query_parse_seeking (peerquery, NULL, &seekable, NULL, NULL); + if (seekable) + gst_query_set_seeking (query, GST_FORMAT_TIME, TRUE, 0, -1); + else + gst_query_set_seeking (query, GST_FORMAT_TIME, FALSE, -1, -1); + } + + break; + } default: /* else forward upstream */ ret = gst_pad_peer_query (demux->sinkpad, query); |