mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
gst/qtdemux/qtdemux.c: We don't support seeking in streaming mode, so don't even try.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_get_src_query_types), (gst_qtdemux_handle_src_query), (gst_qtdemux_handle_src_event): We don't support seeking in streaming mode, so don't even try. Implement seeking query so apps can query seekability properly (see #365414). Fix duration query.
This commit is contained in:
parent
ad5dfb5739
commit
40d3caa168
1 changed files with 34 additions and 8 deletions
|
@ -551,6 +551,7 @@ gst_qtdemux_get_src_query_types (GstPad * pad)
|
||||||
static const GstQueryType src_types[] = {
|
static const GstQueryType src_types[] = {
|
||||||
GST_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
GST_QUERY_DURATION,
|
GST_QUERY_DURATION,
|
||||||
|
GST_QUERY_SEEKING,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -587,17 +588,37 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQuery * query)
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GST_QUERY_DURATION:
|
case GST_QUERY_DURATION:{
|
||||||
{
|
GstFormat fmt;
|
||||||
gint64 duration;
|
|
||||||
|
|
||||||
res = gst_qtdemux_get_duration (qtdemux, &duration);
|
gst_query_parse_duration (query, &fmt, NULL);
|
||||||
|
if (fmt == GST_FORMAT_TIME) {
|
||||||
|
gint64 duration = -1;
|
||||||
|
|
||||||
|
gst_qtdemux_get_duration (qtdemux, &duration);
|
||||||
|
if (duration > 0) {
|
||||||
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
gst_query_set_duration (query, GST_FORMAT_TIME, duration);
|
||||||
|
res = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
case GST_QUERY_SEEKING:{
|
||||||
|
GstFormat fmt;
|
||||||
|
|
||||||
|
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
||||||
|
if (fmt == GST_FORMAT_TIME) {
|
||||||
|
gint64 duration = -1;
|
||||||
|
|
||||||
|
gst_qtdemux_get_duration (qtdemux, &duration);
|
||||||
|
gst_query_set_seeking (query, GST_FORMAT_TIME, qtdemux->pullbased,
|
||||||
|
0, duration);
|
||||||
|
res = TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
res = FALSE;
|
res = gst_pad_query_default (pad, query);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -971,7 +992,12 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstEvent * event)
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
|
if (qtdemux->pullbased) {
|
||||||
res = gst_qtdemux_do_seek (qtdemux, pad, event);
|
res = gst_qtdemux_do_seek (qtdemux, pad, event);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (qtdemux, "cannot seek in streaming mode");
|
||||||
|
res = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue