gst/avi/gstavidemux.c: Implement seek-query.

Original commit message from CVS:
* gst/avi/gstavidemux.c:
Implement seek-query.
This commit is contained in:
Stefan Kost 2007-09-03 07:44:34 +00:00
parent 14e218c083
commit c1b2242e77
2 changed files with 31 additions and 0 deletions

View file

@ -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),

View file

@ -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;