filesink: implement SEEKING query
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 25 Feb 2012 15:07:43 +0000 (15:07 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 25 Feb 2012 15:07:43 +0000 (15:07 +0000)
We may or may not do seeking, depends on the
output file/device really, it doesn't have to
be a file after all.

plugins/elements/gstfilesink.c

index 9356c0f..543dbfe 100644 (file)
@@ -495,6 +495,16 @@ gst_file_sink_query (GstBaseSink * bsink, GstQuery * query)
       res = TRUE;
       break;
 
+    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, self->seekable, 0, -1);
+      } else {
+        gst_query_set_seeking (query, format, FALSE, 0, -1);
+      }
+      res = TRUE;
+      break;
+
     default:
       res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
       break;