gnomemm r2073 - in gstreamermm/trunk: . gstreamer/src



Author: jaalburqu
Date: Fri Feb 27 21:34:19 2009
New Revision: 2073
URL: http://svn.gnome.org/viewvc/gnomemm?rev=2073&view=rev

Log:
2009-02-27  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/Makefile_list_of_hg.am_fragment:
	* gstreamer/src/typefind.ccg:
	* gstreamer/src/typefind.hg: Wrapped Gst::TypeFind.

	* NEWS: Added entry for 0.10.1.

Added:
   gstreamermm/trunk/gstreamer/src/typefind.ccg
   gstreamermm/trunk/gstreamer/src/typefind.hg
Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/NEWS
   gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment

Modified: gstreamermm/trunk/NEWS
==============================================================================
--- gstreamermm/trunk/NEWS	(original)
+++ gstreamermm/trunk/NEWS	Fri Feb 27 21:34:19 2009
@@ -1,3 +1,7 @@
+0.10.1 (unstable):
+
+* Corrected version number in docs.
+
 0.10.0 (unstable):
 
 * Interface

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	Fri Feb 27 21:34:19 2009
@@ -10,7 +10,7 @@
 	iterator.hg message.hg pad.hg padtemplate.hg parse.hg pipeline.hg \
 	plugin.hg pluginfeature.hg preset.hg query.hg registry.hg segment.hg \
 	structure.hg systemclock.hg taglist.hg tagsetter.hg task.hg \
-	urihandler.hg value.hg xml.hg \
+	typefind.hg urihandler.hg value.hg xml.hg \
 	basesrc.hg basesink.hg basetransform.hg pushsrc.hg audioclock.hg \
 	audiofilter.hg audiosink.hg audiosrc.hg baseaudiosink.hg \
 	baseaudiosrc.hg cddabasesrc.hg videosink.hg \

Added: gstreamermm/trunk/gstreamer/src/typefind.ccg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamer/src/typefind.ccg	Fri Feb 27 21:34:19 2009
@@ -0,0 +1,133 @@
+/* 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gst/gstenumtypes.h>
+#include <gst/gsttypefind.h>
+#include <gstreamermm/caps.h>
+#include <gstreamermm/plugin.h>
+
+static void TypeFind_Find_gstreamermm_callback(GstTypeFind* find, void* data)
+{
+  Gst::TypeFind::SlotFind* the_slot = static_cast<Gst::TypeFind::SlotFind*>(data);
+
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  try
+  {
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+    (*the_slot)();
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+  }
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+}
+
+static void TypeFind_Find_gstreamermm_callback_destroy(void* data)
+{
+  delete static_cast<Gst::TypeFind::SlotFind*>(data);
+}
+
+
+namespace Gst
+{
+
+bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
+  const Glib::ustring& name, guint rank, const SlotFind& find_slot,
+  const Glib::StringArrayHandle& extensions,
+  const Glib::RefPtr<const Gst::Caps>& caps)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(plugin->gobj(), name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback,
+    const_cast<gchar**>(extensions.data()), caps->gobj(), slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
+  const Glib::ustring& name, guint rank, const SlotFind& find_slot,
+  const Glib::RefPtr<const Gst::Caps>& caps)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(plugin->gobj(), name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback, 0, caps->gobj(), slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
+  const Glib::ustring& name, guint rank, const SlotFind& find_slot,
+  const Glib::StringArrayHandle& extensions)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(plugin->gobj(), name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback,
+    const_cast<gchar**>(extensions.data()), 0, slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::RefPtr<Gst::Plugin>& plugin,
+  const Glib::ustring& name, guint rank, const SlotFind& find_slot)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(plugin->gobj(), name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback, 0, 0, slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
+  const SlotFind& find_slot, const Glib::StringArrayHandle& extensions,
+  const Glib::RefPtr<const Gst::Caps>& caps)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(0, name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback,
+    const_cast<gchar**>(extensions.data()), caps->gobj(), slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
+  const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(0, name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback, 0, caps->gobj(), slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
+  const SlotFind& find_slot, const Glib::StringArrayHandle& extensions)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(0, name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback,
+    const_cast<gchar**>(extensions.data()), 0, slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+bool TypeFind::register_slot(const Glib::ustring& name, guint rank,
+  const SlotFind& find_slot)
+{
+  SlotFind* slot_copy = new SlotFind(find_slot);
+  gst_type_find_register(0, name.c_str(), rank,
+    &TypeFind_Find_gstreamermm_callback, 0, 0, slot_copy,
+    &TypeFind_Find_gstreamermm_callback_destroy);
+}
+
+} //namespace Gst

Added: gstreamermm/trunk/gstreamer/src/typefind.hg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamer/src/typefind.hg	Fri Feb 27 21:34:19 2009
@@ -0,0 +1,175 @@
+/* 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 Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gst/gsttypefind.h>
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+
+_WRAP_ENUM(TypeFindProbability, GstTypeFindProbability)
+
+class Caps;
+class Plugin;
+
+/** Gst::TypeFind - Stream type detection.
+ * Gst::TypeFind methods allow you to detect the media type of an unknown
+ * stream.
+ *
+ * Last reviewed on 2005-11-09 (0.9.4).
+ */
+class TypeFind
+{
+  _CLASS_BOXEDTYPE_STATIC(TypeFind, GstTypeFind)
+
+public:
+  /** For example,
+   * void on_find();.
+   */
+  typedef sigc::slot<void> SlotFind;
+
+public:
+#m4 _CONVERSION(`guint8*', `Glib::ArrayHandle<guint8>', `$2(($3), Glib::OWNERSHIP_NONE)')
+  _WRAP_METHOD(Glib::ArrayHandle<guint8> peek(gint64 offset, guint size) const, gst_type_find_peek)
+
+  _WRAP_METHOD(void suggest(guint probability, const Glib::RefPtr<const Gst::Caps>& caps) const, gst_type_find_suggest)
+  _IGNORE(gst_type_find_suggest_simple)
+
+  _WRAP_METHOD(guint64 get_length() const, gst_type_find_get_length)
+
+  /** Registers a new typefind slot to be used for typefinding. After
+   * registering the slot will be available for typefinding. This method
+   * is typically called during an element's plugin initialization.
+   *
+   * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
+   * related to any  Gst::Plugin, use register_slot() without the Gst::Plugin
+   * argument).
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param extensions Extensions belonging to this type (for no extensions use
+   * register_slot() with no extensions parameter).
+   * @param caps The caps to be returned when typefinding succeeds (for no
+   * caps, use register_slot() with no caps argument).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr<const Gst::Caps>& caps);
+
+  /** Registers a new typefind slot to be used for typefinding. After
+   * registering the slot will be available for typefinding. This method
+   * is typically called during an element's plugin initialization.
+   *
+   * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
+   * related to any  Gst::Plugin, use register_slot() without the Gst::Plugin
+   * argument).
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param caps The caps to be returned when typefinding succeeds (for no
+   * caps, use register_slot() with no caps argument).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps);
+
+  /** Registers a new typefind slot to be used for typefinding. After
+   * registering the slot will be available for typefinding. This method
+   * is typically called during an element's plugin initialization.
+   *
+   * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
+   * related to any  Gst::Plugin, use register_slot() without the Gst::Plugin
+   * argument).
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param extensions Extensions belonging to this type (for no extensions use
+   * register_slot() with no extensions parameter).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
+
+  /** Registers a new typefind slot to be used for typefinding. After
+   * registering the slot will be available for typefinding. This method
+   * is typically called during an element's plugin initialization.
+   *
+   * @param plugin A Gst::Plugin (for a static typefind function, i.e. one not
+   * related to any  Gst::Plugin, use register_slot() without the Gst::Plugin
+   * argument).
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::RefPtr<Gst::Plugin>& plugin, const Glib::ustring& name, guint rank, const SlotFind& find_slot);
+
+  /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
+   * used for typefinding. After registering the slot will be available for
+   * typefinding.
+   *
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param extensions Extensions belonging to this type (for no extensions use
+   * register_slot() with no extensions parameter).
+   * @param caps The caps to be returned when typefinding succeeds (for no
+   * caps, use register_slot() with no caps argument).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions, const Glib::RefPtr<const Gst::Caps>& caps);
+
+  /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
+   * used for typefinding. After registering the slot will be available for
+   * typefinding.
+   *
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param caps The caps to be returned when typefinding succeeds (for no
+   * caps, use register_slot() with no caps argument).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::RefPtr<const Gst::Caps>& caps);
+
+  /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
+   * used for typefinding. After registering the slot will be available for
+   * typefinding.
+   *
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @param extensions Extensions belonging to this type (for no extensions use
+   * register_slot() with no extensions parameter).
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot, const Glib::StringArrayHandle& extensions);
+
+  /** Registers a new static (not requiring a Gst::Plugin) typefind slot to be
+   * used for typefinding. After registering the slot will be available for
+   * typefinding.
+   *
+   * @param name The name for registering.
+   * @param rank The rank (or importance) of this typefind function.
+   * @param find_slot The Gst::TypeFind::SlotFind to use.
+   * @return true on success, false otherwise.
+   */
+  static bool register_slot(const Glib::ustring& name, guint rank, const SlotFind& find_slot);
+
+};
+
+} // namespace Gst



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