From: Tim-Philipp Müller Date: Sat, 25 Feb 2012 15:08:55 +0000 (+0000) Subject: fdsink: implement SEEKING query X-Git-Tag: RELEASE-0.11.3~1^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=965c610028c17530e86d1430971e59c7f76c725a;p=platform%2Fupstream%2Fgstreamer.git fdsink: implement SEEKING query We may or may not support seeking. stdout to a terminal doesn't support seeking, for example, but ... ! fdsink > file.foo just might. --- diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index 6383d2a..80e1f30 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -222,6 +222,16 @@ gst_fd_sink_query (GstPad * pad, GstQuery * query) gst_query_set_uri (query, fdsink->uri); return TRUE; + case GST_QUERY_SEEKING: + gst_query_parse_seeking (query, &format, NULL, NULL, NULL); + if (format == GST_FORMAT_BYTES || format == GST_FORMAT_DEFAULT) { + gst_query_set_seeking (query, GST_FORMAT_BYTES, fdsink->seekable, 0, + -1); + } else { + gst_query_set_seeking (query, format, FALSE, 0, -1); + } + return TRUE; + default: return gst_pad_query_default (pad, query); } @@ -384,6 +394,9 @@ gst_fd_sink_start (GstBaseSink * basesink) fdsink->bytes_written = 0; fdsink->current_pos = 0; + fdsink->seekable = gst_fd_sink_do_seek (fdsink, 0); + GST_INFO_OBJECT (fdsink, "seeking supported: %d", fdsink->seekable); + return TRUE; /* ERRORS */ diff --git a/plugins/elements/gstfdsink.h b/plugins/elements/gstfdsink.h index 90913b4..59393d0 100644 --- a/plugins/elements/gstfdsink.h +++ b/plugins/elements/gstfdsink.h @@ -59,6 +59,8 @@ struct _GstFdSink { int fd; guint64 bytes_written; guint64 current_pos; + + gboolean seekable; }; struct _GstFdSinkClass {