mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
ext/ffmpeg/gstffmpegdemux.c: Implement SEEKING query, so players such as totem can query seekability. Fix a comment t...
Original commit message from CVS: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_query_list), (gst_ffmpegdemux_src_query), (gst_ffmpegdemux_get_stream), (gst_ffmpegdemux_open): Implement SEEKING query, so players such as totem can query seekability. Fix a comment typo or two.
This commit is contained in:
parent
da3342ef41
commit
b7e4ff666a
2 changed files with 27 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-05-25 Tim-Philipp Müller <tim.muller at collabora co uk>
|
||||||
|
|
||||||
|
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_src_query_list),
|
||||||
|
(gst_ffmpegdemux_src_query), (gst_ffmpegdemux_get_stream),
|
||||||
|
(gst_ffmpegdemux_open):
|
||||||
|
Implement SEEKING query, so players such as totem can query
|
||||||
|
seekability. Fix a comment typo or two.
|
||||||
|
|
||||||
2008-05-25 Jan Schmidt <jan.schmidt@sun.com>
|
2008-05-25 Jan Schmidt <jan.schmidt@sun.com>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -613,6 +613,7 @@ gst_ffmpegdemux_src_query_list (GstPad * pad)
|
||||||
static const GstQueryType src_types[] = {
|
static const GstQueryType src_types[] = {
|
||||||
GST_QUERY_DURATION,
|
GST_QUERY_DURATION,
|
||||||
GST_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
|
GST_QUERY_SEEKING,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -736,6 +737,22 @@ gst_ffmpegdemux_src_query (GstPad * pad, GstQuery * query)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case GST_QUERY_SEEKING: {
|
||||||
|
GstFormat format;
|
||||||
|
gboolean seekable;
|
||||||
|
gint64 dur = -1;
|
||||||
|
|
||||||
|
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
|
||||||
|
seekable = demux->seekable;
|
||||||
|
if (!gst_pad_query_duration (pad, &format, &dur)) {
|
||||||
|
/* unlikely that we don't know duration but can seek */
|
||||||
|
seekable = FALSE;
|
||||||
|
dur = -1;
|
||||||
|
}
|
||||||
|
gst_query_set_seeking (query, format, seekable, 0, dur);
|
||||||
|
res = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
/* FIXME : ADD GST_QUERY_CONVERT */
|
/* FIXME : ADD GST_QUERY_CONVERT */
|
||||||
res = gst_pad_query_default (pad, query);
|
res = gst_pad_query_default (pad, query);
|
||||||
|
@ -894,7 +911,7 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
|
||||||
stream->pad = pad;
|
stream->pad = pad;
|
||||||
gst_pad_set_element_private (pad, stream);
|
gst_pad_set_element_private (pad, stream);
|
||||||
|
|
||||||
/* transform some usefull info to GstClockTime and remember */
|
/* transform some useful info to GstClockTime and remember */
|
||||||
{
|
{
|
||||||
GstClockTime tmp;
|
GstClockTime tmp;
|
||||||
|
|
||||||
|
@ -1063,7 +1080,7 @@ gst_ffmpegdemux_open (GstFFMpegDemux * demux)
|
||||||
gst_message_new_tag (GST_OBJECT (demux), tags));
|
gst_message_new_tag (GST_OBJECT (demux), tags));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* transform some usefull info to GstClockTime and remember */
|
/* transform some useful info to GstClockTime and remember */
|
||||||
demux->start_time = gst_util_uint64_scale_int (demux->context->start_time,
|
demux->start_time = gst_util_uint64_scale_int (demux->context->start_time,
|
||||||
GST_SECOND, AV_TIME_BASE);
|
GST_SECOND, AV_TIME_BASE);
|
||||||
GST_DEBUG_OBJECT (demux, "start time: %" GST_TIME_FORMAT,
|
GST_DEBUG_OBJECT (demux, "start time: %" GST_TIME_FORMAT,
|
||||||
|
|
Loading…
Reference in a new issue