slomo gstreamer: gstreamer/ gstreamer/docs/gst/ gstreamer/gst/ gstreamer/plugins/elements/

[email protected] Sat, 20 Dec 2008 09:33:59 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gstreamer
Changes by:     slomo
Date:           Sat Dec 20 2008  17:33:59 UTC

Log message:
* docs/gst/gstreamer-sections.txt:
* gst/gstquark.c:
* gst/gstquark.h:
* gst/gstquery.c: (gst_query_new_uri), (gst_query_set_uri),
(gst_query_parse_uri):
* gst/gstquery.h:
API: Add URI query type. This is useful to query the URI
of a sink/source element and can be used by demuxers that
need to get data from other files.
This query should go upstream by default.
Fixes bug #562949.
* plugins/elements/gstfdsink.c: (gst_fd_sink_query):
* plugins/elements/gstfdsrc.c: (gst_fd_src_class_init),
(gst_fd_src_query):
* plugins/elements/gstfilesink.c: (gst_file_sink_query):
* plugins/elements/gstfilesrc.c: (gst_file_src_class_init),
(gst_file_src_query):
Implement URI query.

Modified files:
    .               : ChangeLog
    docs/gst        : gstreamer-sections.txt
    gst             : gstquark.c gstquark.h gstquery.c gstquery.h
    plugins/elements: gstfdsink.c gstfdsrc.c gstfilesink.c
                      gstfilesrc.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.4204&r2=1.4205
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/docs/gst/gstreamer-sections.txt.diff?r1=1.358&r2=1.359
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquark.c.diff?r1=1.6&r2=1.7
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquark.h.diff?r1=1.5&r2=1.6
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquery.c.diff?r1=1.48&r2=1.49
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstquery.h.diff?r1=1.41&r2=1.42
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfdsink.c.diff?r1=1.53&r2=1.54
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfdsrc.c.diff?r1=1.86&r2=1.87
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfilesink.c.diff?r1=1.98&r2=1.99
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/plugins/elements/gstfilesrc.c.diff?r1=1.168&r2=1.169

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v
retrieving revision 1.4204
retrieving revision 1.4205
diff -u -d -r1.4204 -r1.4205
--- ChangeLog	19 Dec 2008 15:11:03 -0000	1.4204
+++ ChangeLog	20 Dec 2008 17:33:41 -0000	1.4205
@@ -1,3 +1,24 @@
+2008-12-20  Sebastian Dröge  <[email protected]>
+
+	* docs/gst/gstreamer-sections.txt:
+	* gst/gstquark.c:
+	* gst/gstquark.h:
+	* gst/gstquery.c: (gst_query_new_uri), (gst_query_set_uri),
+	(gst_query_parse_uri):
+	* gst/gstquery.h:
+	API: Add URI query type. This is useful to query the URI
+	of a sink/source element and can be used by demuxers that
+	need to get data from other files.
+	This query should go upstream by default.
+	Fixes bug #562949.
+	* plugins/elements/gstfdsink.c: (gst_fd_sink_query):
+	* plugins/elements/gstfdsrc.c: (gst_fd_src_class_init),
+	(gst_fd_src_query):
+	* plugins/elements/gstfilesink.c: (gst_file_sink_query):
+	* plugins/elements/gstfilesrc.c: (gst_file_src_class_init),
+	(gst_file_src_query):
+	Implement URI query.
 2008-12-19  Alessandro Decina <[email protected]>
 
 	* gst/gstghostpad.c:
Index: gstreamer-sections.txt
RCS file: /cvs/gstreamer/gstreamer/docs/gst/gstreamer-sections.txt,v
retrieving revision 1.358
retrieving revision 1.359
diff -u -d -r1.358 -r1.359
--- gstreamer-sections.txt	16 Dec 2008 15:51:51 -0000	1.358
+++ gstreamer-sections.txt	20 Dec 2008 17:33:42 -0000	1.359
@@ -1802,6 +1802,9 @@
 gst_query_set_buffering_range
 gst_query_parse_buffering_range
+gst_query_new_uri
+gst_query_parse_uri
+gst_query_set_uri
 <SUBSECTION Standard>
 GstQueryClass
 GST_QUERY
Index: gstquark.c
RCS file: /cvs/gstreamer/gstreamer/gst/gstquark.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gstquark.c	14 Oct 2008 17:10:43 -0000	1.6
+++ gstquark.c	20 Dec 2008 17:33:43 -0000	1.7
@@ -37,7 +37,7 @@
   "max-latency", "busy", "type", "owner", "update", "applied-rate",
   "start", "stop", "minsize", "maxsize", "async", "proportion",
   "diff", "timestamp", "flags", "cur-type", "cur", "stop-type",
-  "latency"
+  "latency", "uri"
 };
 GQuark _priv_gst_quark_table[GST_QUARK_MAX];
Index: gstquark.h
RCS file: /cvs/gstreamer/gstreamer/gst/gstquark.h,v
retrieving revision 1.5
diff -u -d -r1.5 -r1.6
--- gstquark.h	13 Oct 2008 17:19:25 -0000	1.5
+++ gstquark.h	20 Dec 2008 17:33:43 -0000	1.6
@@ -77,8 +77,9 @@
   GST_QUARK_CUR = 48,
   GST_QUARK_STOP_TYPE = 49,
   GST_QUARK_LATENCY = 50,
+  GST_QUARK_URI = 51,
-  GST_QUARK_MAX = 51
+  GST_QUARK_MAX = 52
 } GstQuarkId;
 extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];
Index: gstquery.c
RCS file: /cvs/gstreamer/gstreamer/gst/gstquery.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- gstquery.c	20 Nov 2008 10:35:50 -0000	1.48
+++ gstquery.c	20 Dec 2008 17:33:43 -0000	1.49
@@ -65,6 +65,7 @@
 #include "gstvalue.h"
 #include "gstenumtypes.h"
 #include "gstquark.h"
+#include "gsturi.h"
 GST_DEBUG_CATEGORY_STATIC (gst_query_debug);
 #define GST_CAT_DEFAULT gst_query_debug
@@ -93,6 +94,7 @@
   {GST_QUERY_FORMATS, "formats", "Supported formats for conversion", 0},
   {GST_QUERY_BUFFERING, "buffering", "Buffering status", 0},
   {GST_QUERY_CUSTOM, "custom", "Custom query", 0},
+  {GST_QUERY_URI, "uri", "URI of the source or sink", 0},
   {0, NULL, NULL, 0}
@@ -1308,3 +1310,73 @@
         g_value_get_int64 (gst_structure_id_get_value (structure,
             GST_QUARK (ESTIMATED_TOTAL)));
 }
+/**
+ * gst_query_new_uri:
+ *
+ * Constructs a new query URI query object. Use gst_query_unref()
+ * when done with it. An URI query is used to query the current URI
+ * that is used by the source or sink.
+ * Returns: A #GstQuery
+ * Since: 0.10.22
+ */
+GstQuery *
+gst_query_new_uri (void)
+{
+  GstQuery *query;
+  GstStructure *structure;
+  structure = gst_structure_empty_new ("GstQueryURI");
+  gst_structure_id_set (structure, GST_QUARK (URI), G_TYPE_STRING, NULL, NULL);
+  query = gst_query_new (GST_QUERY_URI, structure);
+  return query;
+}
+ * gst_query_set_uri:
+ * @query: a #GstQuery with query type GST_QUERY_URI
+ * @uri: the URI to set
+ * Answer a URI query by setting the requested URI.
+void
+gst_query_set_uri (GstQuery * query, const gchar * uri)
+  g_return_if_fail (GST_QUERY_TYPE (query) == GST_QUERY_URI);
+  g_return_if_fail (gst_uri_is_valid (uri));
+  structure = gst_query_get_structure (query);
+  gst_structure_id_set (structure, GST_QUARK (URI), G_TYPE_STRING, uri, NULL);
+ * gst_query_parse_uri:
+ * @query: a #GstQuery
+ * @uri: the storage for the current URI (may be NULL)
+ * Parse an URI query, writing the URI into @uri as a newly
+ * allocated string, if the respective parameters are non-NULL.
+ * Free the string with g_free() after usage.
+gst_query_parse_uri (GstQuery * query, gchar ** uri)
+  if (uri)
+    *uri = g_value_dup_string (gst_structure_id_get_value (structure,
+            GST_QUARK (URI)));
Index: gstquery.h
RCS file: /cvs/gstreamer/gstreamer/gst/gstquery.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gstquery.h	20 Nov 2008 10:35:50 -0000	1.41
+++ gstquery.h	20 Dec 2008 17:33:43 -0000	1.42
@@ -50,6 +50,7 @@
  * 0.10.20.
  * @GST_QUERY_CUSTOM: a custom application or element defined query. Since
  * 0.10.22.
+ * @GST_QUERY_URI: query the URI of the source or sink. Since 0.10.22.
  *
  * Standard predefined Query types
  */
@@ -67,7 +68,8 @@
   GST_QUERY_CONVERT,
   GST_QUERY_FORMATS,
   GST_QUERY_BUFFERING,
-  GST_QUERY_CUSTOM
+  GST_QUERY_CUSTOM,
+  GST_QUERY_URI
 } GstQueryType;
 /**
@@ -285,6 +287,10 @@
 void            gst_query_parse_buffering_range   (GstQuery *query, GstFormat *format,
                                                    gint64 *start, gint64 *stop,
 						   gint64 *estimated_total);
+/* URI query */
+GstQuery *      gst_query_new_uri                 (void);
+void            gst_query_parse_uri               (GstQuery *query, gchar **uri);
+void            gst_query_set_uri                 (GstQuery *query, const gchar *uri);
 G_END_DECLS
Index: gstfdsink.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfdsink.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- gstfdsink.c	20 Jun 2008 10:14:52 -0000	1.53
+++ gstfdsink.c	20 Dec 2008 17:33:43 -0000	1.54
@@ -202,6 +202,10 @@
       gst_query_set_formats (query, 2, GST_FORMAT_DEFAULT, GST_FORMAT_BYTES);
       return TRUE;
+    case GST_QUERY_URI:
+      gst_query_set_uri (query, fdsink->uri);
+      return TRUE;
     default:
       return gst_pad_query_default (pad, query);
   }
@@ -495,6 +499,7 @@
 {
   return GST_URI_SINK;
 static gchar **
 gst_fd_sink_uri_get_protocols (void)
@@ -502,6 +507,7 @@
   return protocols;
 static const gchar *
 gst_fd_sink_uri_get_uri (GstURIHandler * handler)
Index: gstfdsrc.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfdsrc.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- gstfdsrc.c	23 Oct 2008 12:52:58 -0000	1.86
+++ gstfdsrc.c	20 Dec 2008 17:33:43 -0000	1.87
@@ -130,6 +130,7 @@
 static gboolean gst_fd_src_is_seekable (GstBaseSrc * bsrc);
 static gboolean gst_fd_src_get_size (GstBaseSrc * src, guint64 * size);
 static gboolean gst_fd_src_do_seek (GstBaseSrc * src, GstSegment * segment);
+static gboolean gst_fd_src_query (GstBaseSrc * src, GstQuery * query);
 static GstFlowReturn gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf);
@@ -188,6 +189,7 @@
   gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fd_src_is_seekable);
   gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_fd_src_get_size);
   gstbasesrc_class->do_seek = GST_DEBUG_FUNCPTR (gst_fd_src_do_seek);
+  gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_fd_src_query);
   gstpush_src_class->create = GST_DEBUG_FUNCPTR (gst_fd_src_create);
@@ -493,6 +495,28 @@
 static gboolean
+gst_fd_src_query (GstBaseSrc * basesrc, GstQuery * query)
+  gboolean ret = FALSE;
+  GstFdSrc *src = GST_FD_SRC (basesrc);
+  switch (GST_QUERY_TYPE (query)) {
+      gst_query_set_uri (query, src->uri);
+      ret = TRUE;
+      break;
+    default:
+      ret = FALSE;
+  }
+  if (!ret)
+    ret = GST_BASE_SRC_CLASS (parent_class)->query (basesrc, query);
+  return ret;
+static gboolean
 gst_fd_src_is_seekable (GstBaseSrc * bsrc)
   GstFdSrc *src = GST_FD_SRC (bsrc);
Index: gstfilesink.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfilesink.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- gstfilesink.c	10 Nov 2008 13:56:51 -0000	1.98
+++ gstfilesink.c	20 Dec 2008 17:33:44 -0000	1.99
@@ -247,6 +247,7 @@
     return FALSE;
 static void
 gst_file_sink_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)
@@ -409,6 +410,10 @@
+      gst_query_set_uri (query, self->uri);
@@ -613,6 +618,7 @@
 gst_file_sink_uri_get_protocols (void)
@@ -620,6 +626,7 @@
 gst_file_sink_uri_get_uri (GstURIHandler * handler)
Index: gstfilesrc.c
RCS file: /cvs/gstreamer/gstreamer/plugins/elements/gstfilesrc.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- gstfilesrc.c	24 Nov 2008 11:56:44 -0000	1.168
+++ gstfilesrc.c	20 Dec 2008 17:33:44 -0000	1.169
@@ -193,6 +193,7 @@
 static gboolean gst_file_src_get_size (GstBaseSrc * src, guint64 * size);
 static GstFlowReturn gst_file_src_create (GstBaseSrc * src, guint64 offset,
     guint length, GstBuffer ** buffer);
+static gboolean gst_file_src_query (GstBaseSrc * src, GstQuery * query);
 static void gst_file_src_uri_handler_init (gpointer g_iface,
     gpointer iface_data);
@@ -293,6 +294,7 @@
   gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_file_src_is_seekable);
   gstbasesrc_class->get_size = GST_DEBUG_FUNCPTR (gst_file_src_get_size);
   gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_file_src_create);
+  gstbasesrc_class->query = GST_DEBUG_FUNCPTR (gst_file_src_query);
   if (sizeof (off_t) < 8) {
     GST_LOG ("No large file support, sizeof (off_t) = %" G_GSIZE_FORMAT "!",
@@ -903,6 +905,28 @@
+gst_file_src_query (GstBaseSrc * basesrc, GstQuery * query)
+  GstFileSrc *src = GST_FILE_SRC (basesrc);
 gst_file_src_is_seekable (GstBaseSrc * basesrc)
   GstFileSrc *src = GST_FILE_SRC (basesrc);

------------------------------------------------------------------------------

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose