mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
mxfdemux: Implement SEEKING query
This commit is contained in:
parent
95e50d3598
commit
86af4924cc
1 changed files with 55 additions and 0 deletions
|
@ -3453,6 +3453,7 @@ gst_mxf_demux_src_query_type (GstPad * pad)
|
||||||
static const GstQueryType types[] = {
|
static const GstQueryType types[] = {
|
||||||
GST_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
GST_QUERY_DURATION,
|
GST_QUERY_DURATION,
|
||||||
|
GST_QUERY_SEEKING,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3545,6 +3546,33 @@ gst_mxf_demux_src_query (GstPad * pad, GstQuery * query)
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
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:
|
default:
|
||||||
/* else forward upstream */
|
/* else forward upstream */
|
||||||
ret = gst_pad_peer_query (demux->sinkpad, query);
|
ret = gst_pad_peer_query (demux->sinkpad, query);
|
||||||
|
@ -3806,6 +3834,33 @@ gst_mxf_demux_query (GstElement * element, GstQuery * query)
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
break;
|
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:
|
default:
|
||||||
/* else forward upstream */
|
/* else forward upstream */
|
||||||
ret = gst_pad_peer_query (demux->sinkpad, query);
|
ret = gst_pad_peer_query (demux->sinkpad, query);
|
||||||
|
|
Loading…
Reference in a new issue