gnomemm r1356 - in gstreamermm/trunk: . gstreamer gstreamer/src tools/m4



Author: jaalburqu
Date: Wed Feb 20 04:24:38 2008
New Revision: 1356
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1356&view=rev

Log:
2008-02-19  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/gstreamermm.h:
	* gstreamer/src/Makefile_list_of_hg.am_fragment:
	* gstreamer/src/enums.hg:
	* gstreamer/src/gst_signals.defs:
	* gstreamer/src/urihandler.ccg:
	* gstreamer/src/urihandler.hg:
	* tools/m4/convert_gst.m4: Added urihandler and related
	enums+conersions; Manually included the "new-uri" signal def in defs
	file.  Must fix "const gchar*" parameter problem before wrapping
	signal in *.hg file.

Added:
   gstreamermm/trunk/gstreamer/src/urihandler.ccg
   gstreamermm/trunk/gstreamer/src/urihandler.hg
Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/gstreamermm.h
   gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamer/src/enums.hg
   gstreamermm/trunk/gstreamer/src/gst_signals.defs
   gstreamermm/trunk/tools/m4/convert_gst.m4

Modified: gstreamermm/trunk/gstreamer/gstreamermm.h
==============================================================================
--- gstreamermm/trunk/gstreamer/gstreamermm.h	(original)
+++ gstreamermm/trunk/gstreamer/gstreamermm.h	Wed Feb 20 04:24:38 2008
@@ -29,6 +29,7 @@
 #include <gstreamermm/structure.h>
 #include <gstreamermm/systemclock.h>
 #include <gstreamermm/task.h>
+#include <gstreamermm/urihandler.h>
 #include <gstreamermm/value.h>
 #include <gstreamermm/xml.h>
 

Modified: gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	(original)
+++ gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	Wed Feb 20 04:24:38 2008
@@ -8,7 +8,8 @@
 	element.hg elementfactory.hg enums.hg error.hg event.hg filter.hg \
 	format.hg index.hg indexfactory.hg iterator.hg message.hg pad.hg \
 	padtemplate.hg parse.hg pipeline.hg plugin.hg pluginfeature.hg \
-	query.hg structure.hg systemclock.hg task.hg value.hg xml.hg
+	query.hg structure.hg systemclock.hg task.hg urihandler.hg value.hg \
+	xml.hg
 
 files_general_deprecated_hg =
 

Modified: gstreamermm/trunk/gstreamer/src/enums.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/enums.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/enums.hg	Wed Feb 20 04:24:38 2008
@@ -21,6 +21,7 @@
 
 #include <gst/gstevent.h>
 #include <gst/gstelement.h>
+#include <gst/gsturi.h>
 
 _DEFS(gstreamermm,gst)
 
@@ -79,6 +80,13 @@
 _WRAP_ENUM(State, GstState)
 _WRAP_ENUM(TaskState, GstTaskState)
 
+enum URIType
+{
+  URI_UNKNOWN = GST_URI_UNKNOWN,
+  URI_SINK = GST_URI_SINK,
+  URI_SRC = GST_URI_SRC 
+};
+
 enum StateChange
 {
   STATE_CHANGE_NULL_TO_READY = GST_STATE_CHANGE_NULL_TO_READY,

Modified: gstreamermm/trunk/gstreamer/src/gst_signals.defs
==============================================================================
--- gstreamermm/trunk/gstreamer/src/gst_signals.defs	(original)
+++ gstreamermm/trunk/gstreamer/src/gst_signals.defs	Wed Feb 20 04:24:38 2008
@@ -583,6 +583,15 @@
 
 ;; From GstURIHandler
 
+(define-signal new-uri
+  (of-object "GstURIHandler")
+  (return-type "void")
+  (when "last")
+;;  (parameters
+;;    '("const gchar*" "p0")
+;;  )
+)
+
 ;; From GstXML
 
 (define-signal object-loaded

Added: gstreamermm/trunk/gstreamer/src/urihandler.ccg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamer/src/urihandler.ccg	Wed Feb 20 04:24:38 2008
@@ -0,0 +1,22 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gstreamermm/element.h>

Added: gstreamermm/trunk/gstreamer/src/urihandler.hg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamer/src/urihandler.hg	Wed Feb 20 04:24:38 2008
@@ -0,0 +1,68 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/interface.h>
+#include <gstreamermm/enums.h>
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+
+class Element;
+
+/** UriHandler â Interface to ease URI handling in plugins.
+ * The URIHandler is an interface that is implemented by Source and Sink
+ * Element to simplify then handling of URI.
+ *
+ * An application can use the following functions to quickly get an element
+ * that handles the given URI for reading or writing (make_element_from_uri()).
+ *
+ * Source and Sink plugins should implement this interface when possible.
+ *
+ * Last reviewed on 2005-11-09 (0.9.4)
+ */
+class URIHandler : public Glib::Interface
+{
+  _CLASS_INTERFACE(URIHandler, GstURIHandler, GST_URI_HANDLER, GstURIHandlerInterface)
+
+public:
+  _WRAP_METHOD(static bool protocol_is_valid(const Glib::ustring& protocol), gst_uri_protocol_is_valid)
+  _WRAP_METHOD(static bool protocol_is_supported(const URIType type, const Glib::ustring& protocol), gst_uri_protocol_is_supported)
+  _WRAP_METHOD(static bool uri_is_valid(const Glib::ustring& uri), gst_uri_is_valid)
+  _WRAP_METHOD(static bool uri_has_protocol(const Glib::ustring& uri, const Glib::ustring& protocol), gst_uri_has_protocol)
+  _WRAP_METHOD(static Glib::ustring get_protocol(const Glib::ustring& uri), gst_uri_get_protocol)
+  _WRAP_METHOD(static Glib::ustring get_location(const Glib::ustring& uri), gst_uri_get_location)
+  _WRAP_METHOD(static Glib::ustring construct_uri(const Glib::ustring& protocol, const Glib::ustring& location), gst_uri_construct)
+  _WRAP_METHOD(static Glib::RefPtr<Element> make_element_from_uri(const URIType type, const Glib::ustring& uri, const Glib::ustring& name), gst_element_make_from_uri)
+
+  _WRAP_METHOD(guint get_uri_type(), gst_uri_handler_get_uri_type)
+  _WRAP_METHOD(Glib::StringArrayHandle get_protocols(), gst_uri_handler_get_protocols)
+  _WRAP_METHOD(Glib::ustring get_uri(), gst_uri_handler_get_uri)
+  _WRAP_METHOD(bool set_uri(const Glib::ustring& uri), gst_uri_handler_set_uri)
+  _WRAP_METHOD(void new_uri(const Glib::ustring& uri), gst_uri_handler_new_uri)
+
+  //TODO: Fix signal definition in def file before enabling on_new_uri() signal
+  //TODO: _WRAP_SIGNAL(void on_new_uri(const Glib::ustring& uri), "new-uri")
+};
+
+} // namespace Gst
+

Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4	Wed Feb 20 04:24:38 2008
@@ -89,13 +89,19 @@
 _CONVERSION(`Structure&',`GstStructure*',`((GstStructure*)(&($3)))')
 _CONVERSION(`GstStructure*',`Structure*',`((Structure*) ($3))')
 
+#URIHandler
+_CONVERSION(`GstURIHandler*',`const Glib::RefPtr<URIHandler>&',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<URIHandler>&',`GstURIHandler*',`Glib::unwrap($3)')
+
 #General Conversions
 _CONVERSION(`guint64',`ClockTime',`(ClockTime ($3))')
+_CONVERSION(`const URIType',`const GstURIType',`(GstURIType($3))')
 _CONVERSION(`Format&',`GstFormat*',`(($2) &($3))')
 _CONVERSION(`gint64&',`gint64*',`&($3)')
 _CONVERSION(`const guint&',`guint',`$3')
 _CONVERSION(`const guint32&',`guint32',`$3')
 _CONVERSION(`const std::string&',`const guchar*',`(const guchar*) ($3.c_str())')
+_CONVERSION(`gchar*',`const Glib::ustring&',__GCHARP_TO_USTRING)
 _CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
 _CONVERSION(`const xmlNodePtr&',`xmlNodePtr',`$3')
 _CONVERSION(`GQuark',`Glib::QueryQuark',`Glib::QueryQuark($3)')
@@ -127,3 +133,4 @@
 _CONV_ENUM(Gst,StateChange)
 _CONV_ENUM(Gst,StateChangeReturn)
 _CONV_ENUM(Gst,TaskState)
+_CONV_ENUM(Gst,URIType)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]