mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
gst/avi/gstavidemux.c: Implement seek-query.
Original commit message from CVS: * gst/avi/gstavidemux.c: Implement seek-query.
This commit is contained in:
parent
14e218c083
commit
c1b2242e77
2 changed files with 31 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-09-03 Stefan Kost <ensonic@users.sf.net>
|
||||
|
||||
* gst/avi/gstavidemux.c:
|
||||
Implement seek-query.
|
||||
|
||||
2007-08-29 Wim Taymans <wim.taymans@gmail.com>
|
||||
|
||||
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_stream_configure_udp_sink),
|
||||
|
|
|
@ -453,6 +453,7 @@ gst_avi_demux_get_src_query_types (GstPad * pad)
|
|||
static const GstQueryType src_types[] = {
|
||||
GST_QUERY_POSITION,
|
||||
GST_QUERY_DURATION,
|
||||
GST_QUERY_SEEKING,
|
||||
0
|
||||
};
|
||||
|
||||
|
@ -537,6 +538,31 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstQuery * query)
|
|||
gst_query_set_duration (query, GST_FORMAT_TIME, stream->duration);
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_SEEKING:{
|
||||
GstFormat fmt;
|
||||
|
||||
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
||||
if (fmt == GST_FORMAT_TIME) {
|
||||
gboolean seekable = TRUE;
|
||||
|
||||
if (avi->streaming) {
|
||||
seekable = FALSE;
|
||||
} else {
|
||||
if (avi->index_entries == NULL) {
|
||||
seekable = FALSE;
|
||||
/* FIXME: when building index_entried, count keyframes
|
||||
if (!(avi->key_frame_ct > 1))
|
||||
seekable = FALSE;
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
gst_query_set_seeking (query, GST_FORMAT_TIME, seekable,
|
||||
0, stream->duration);
|
||||
res = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
res = gst_pad_query_default (pad, query);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue