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



Author: jaalburqu
Date: Tue Mar 11 03:04:47 2008
New Revision: 1401
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1401&view=rev

Log:
2008-03-10  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/bin.hg:
	* gstreamer/src/buffer.hg:
	* gstreamer/src/bus.hg: Added class docs header

	* gstreamer/src/clock.ccg:
	* gstreamer/src/clock.hg: Added class docs header; Wrapped ClockID
	methods get_time(), wait(), wait_async(), and unschedule(); Replaced
	new by create in new_single_shot_id() and new_periodic_id() method
	names (must still wrap these)

	* gstreamer/src/enums.hg: Added ClockFlags enum

	* gstreamer/src/element.ccg:
	* gstreamer/src/element.hg:
	* gstreamer/src/filter.ccg:
	* gstreamer/src/index.ccg:
	* gstreamer/src/interface.hg:
	* gstreamer/src/pad.ccg:
	* gstreamer/src/registry.ccg:
	* gstreamer/src/structure.ccg:
	* gstreamer/src/taglist.ccg: Replaced gpointer with void* in callbacks;
	Rewrote slot code to create copies as pointers and delete the copies
	in callbacks once done (for those slots that are called only once)

	* tools/m4/convert_gst.m4: Added ClockTimeDiff conversion

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/bin.hg
   gstreamermm/trunk/gstreamer/src/buffer.hg
   gstreamermm/trunk/gstreamer/src/bus.hg
   gstreamermm/trunk/gstreamer/src/clock.ccg
   gstreamermm/trunk/gstreamer/src/clock.hg
   gstreamermm/trunk/gstreamer/src/element.ccg
   gstreamermm/trunk/gstreamer/src/element.hg
   gstreamermm/trunk/gstreamer/src/enums.hg
   gstreamermm/trunk/gstreamer/src/filter.ccg
   gstreamermm/trunk/gstreamer/src/index.ccg
   gstreamermm/trunk/gstreamer/src/interface.hg
   gstreamermm/trunk/gstreamer/src/pad.ccg
   gstreamermm/trunk/gstreamer/src/registry.ccg
   gstreamermm/trunk/gstreamer/src/structure.ccg
   gstreamermm/trunk/gstreamer/src/taglist.ccg
   gstreamermm/trunk/tools/m4/convert_gst.m4

Modified: gstreamermm/trunk/gstreamer/src/bin.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/bin.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/bin.hg	Tue Mar 11 03:04:47 2008
@@ -32,6 +32,95 @@
 
 class Pad;
 
+//TODO: Correct statements about iterators in class docs below:
+
+/** Bin â Base class and element that can contain other elements.
+ * Bin is an element that can contain other Element, allowing them to be
+ * managed as a group. Pads from the child elements can be ghosted to the bin,
+ * see GstGhostPad. This makes the bin look like any other elements and enables
+ * creation of higher-level abstraction elements.
+ *
+ * A new Bin is created with create(). Use a Pipeline instead if you want to
+ * create a toplevel bin because a normal bin doesn't have a bus or handle
+ * clock distribution of its own.
+ *
+ * After the bin has been created you will typically add elements to it with
+ * add(). You can remove elements with remove().
+ *
+ * An element can be retrieved from a bin with get_element(), using the
+ * elements name. get_element_recurse_up() is mainly used for internal purposes
+ * and will query the parent bins when the element is not found in the current
+ * bin.
+ *
+ * An iterator of elements in a bin can be retrieved with iterate_elements().
+ * Various other iterators exist to retrieve the elements in a bin.
+ *
+ * The element-added signal is fired whenever a new element is added to the
+ * bin. Likewise the element-removed signal is fired whenever an element is
+ * removed from the bin.
+ *
+ * Notes:
+ *
+ * A Bin internally intercepts every Message posted by its children and
+ * implements the following default behaviour for each of them:
+ *
+ * MESSAGE_EOS - This message is only posted by sinks in the PLAYING state. If
+ * all sinks posted the EOS message, this bin will post and EOS message
+ * upwards.
+ *
+ * MESSAGE_SEGMENT_START - just collected and never forwarded upwards. The
+ * messages are used to decide when all elements have completed playback of
+ * their segment.
+ *
+ * MESSAGE_SEGMENT_DONE - Is posted by Bin when all elements that posted a
+ * SEGMENT_START have posted a SEGMENT_DONE.
+ *
+ * MESSAGE_DURATION - Is posted by an element that detected a change in the
+ * stream duration. The default bin behaviour is to clear any cached duration
+ * values so that the next duration query will perform a full duration
+ * recalculation. The duration change is posted to the application so that it
+ * can refetch the new duration with a duration query.
+ *
+ * MESSAGE_CLOCK_LOST - This message is posted by an element when it can no
+ * longer provide a clock. The default bin behaviour is to check if the lost
+ * clock was the one provided by the bin. If so and the bin is currently in the
+ * PLAYING state, the message is forwarded to the bin parent. This message is
+ * also generated when a clock provider is removed from the bin. If this
+ * message is received by the application, it should PAUSE the pipeline and set
+ * it back to PLAYING to force a new clock distribution.
+ *
+ * MESSAGE_CLOCK_PROVIDE - This message is generated when an element can
+ * provide a clock. This mostly happens when a new clock provider is added to
+ * the bin. The default behaviour of the bin is to mark the currently selected
+ * clock as dirty, which will perform a clock recalculation the next time the
+ * bin is asked to provide a clock. This message is never sent tot the
+ * application but is forwarded to the parent of the bin.
+ *
+ * OTHERS - posted upwards.
+
+ * A Bin implements the following default behaviour for answering to a Query:
+ *
+ * QUERY_DURATION - If the query has been asked before with the same format and
+ * the bin is a toplevel bin (ie. has no parent), use the cached previous
+ * value. If no previous value was cached, the query is sent to all sink
+ * elements in the bin and the MAXIMUM of all values is returned. If the bin is
+ * a toplevel bin the value is cached. If no sinks are available in the bin,
+ * the query fails.
+ *
+ * QUERY_POSITION - The query is sent to all sink elements in the bin and the
+ * MAXIMUM of all values is returned. If no sinks are available in the bin, the
+ * query fails.
+ *
+ * OTHERS - the query is forwarded to all sink elements, the result of the
+ * first sink that answers the query successfully is returned. If no sink is in
+ * the bin, the query fails.
+ *
+ * A Bin will by default forward any event sent to it to all sink elements. If
+ * all the sinks return TRUE, the bin will also return TRUE, else FALSE is
+ * returned. If no sinks are in the bin, the event handler will return TRUE.
+ *
+ * Last reviewed on 2006-04-28 (0.10.6)
+ */
 class Bin
 : public Element,
   public ChildProxy

Modified: gstreamermm/trunk/gstreamer/src/buffer.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/buffer.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/buffer.hg	Tue Mar 11 03:04:47 2008
@@ -31,6 +31,18 @@
 namespace Gst
 {
 
+/** GstBuffer â Data-passing buffer type, supporting sub-buffers.
+ * Buffers are the basic unit of data transfer in GStreamer. The Buffer type
+ * provides all the state necessary to define a region of memory as part of a
+ * stream. Sub-buffers are also supported, allowing a smaller region of a
+ * buffer to become its own buffer, with mechanisms in place to ensure that
+ * neither memory space goes away prematurely.
+ *
+ * Buffers are usually created with create(). After a buffer has been created
+ * one will typically allocate memory for it and set the size of the buffer
+ * data. The following example creates a buffer that can hold a given video
+ * frame with a given width, height and bits per plane.
+ */
 class Buffer : public MiniObject
 {
 protected:

Modified: gstreamermm/trunk/gstreamer/src/bus.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/bus.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/bus.hg	Tue Mar 11 03:04:47 2008
@@ -32,6 +32,48 @@
 
 class Message;
 
+//TODO: Correct C API reference in class docs below:
+
+/** GstBus â Asynchronous message bus subsystem.
+ * The Bus is an object responsible for delivering Messages in a first-in
+ * first-out way from the streaming threads to the application.
+ *
+ * Since the application typically only wants to deal with delivery of these
+ * messages from one thread, the Bus will marshall the messages between
+ * different threads. This is important since the actual streaming of media is
+ * done in another thread than the application.
+ *
+ * The Bus provides support for GSource based notifications. This makes it
+ * possible to handle the delivery in the glib mainloop.
+ *
+ * The GSource callback function gst_bus_async_signal_func() can be used to
+ * convert all bus messages into signal emissions.
+ *
+ * A message is posted on the bus with the post() method. With the peek() and
+ * pop() methods one can look at or retrieve a previously posted message.
+ *
+ * The bus can be polled with the poll() method. This methods blocks up to the
+ * specified timeout value until one of the specified messages types is posted
+ * on the bus. The application can then _pop() the messages from the bus to
+ * handle them. Alternatively the application can register an asynchronous bus
+ * function using add_watch(). This function will install a GSource in the
+ * default glib main loop and will deliver messages a short while after they
+ * have been posted. Note that the main loop should be running for the
+ * asynchronous callbacks.
+ *
+ * It is also possible to get messages from the bus without any thread
+ * marshalling with the gst_bus_set_sync_handler() method. This makes it
+ * possible to react to a message in the same thread that posted the message on
+ * the bus. This should only be used if the application is able to deal with
+ * messages from different threads.
+ *
+ * Every Pipeline has one bus.
+ *
+ * Note that a Pipeline will set its bus into flushing state when changing from
+ * READY to NULL state.
+ *
+ * Last reviewed on 2006-03-12 (0.10.5)
+ */
 class Bus : public Object
 {
   _CLASS_GOBJECT(Bus, GstBus, GST_BUS, Object, GstObject)

Modified: gstreamermm/trunk/gstreamer/src/clock.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/clock.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/clock.ccg	Tue Mar 11 03:04:47 2008
@@ -21,6 +21,34 @@
 
 #include <gst/gstclock.h>
 
+static gboolean ClockID_Clock_gstreamermm_callback(GstClock* clock, GstClockTime time, GstClockID id, void* data)
+{
+  Gst::ClockID::SlotClock* the_slot = static_cast<Gst::ClockID::SlotClock*>(data);
+
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  try
+  {
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+    bool result = (*the_slot)(Glib::wrap(clock, true), time, Glib::wrap((GstClockID*)(&id), true));
+
+    //Delete the once executing slot before returning result
+    delete the_slot;
+
+    return result;
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+  }
+
+  //Delete the once executing slot before returning result
+  delete the_slot;
+
+  return 0; // arbitrary value
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+}
+
 namespace Gst
 {
 
@@ -66,4 +94,10 @@
         (guint) (((GstClockTime)(time)) % GST_SECOND) : 999999999;
 }
 
+ClockReturn ClockID::wait_async(const SlotClock& slot)
+{
+  SlotClock* slot_copy = new SlotClock(slot);
+  return (ClockReturn) gst_clock_id_wait_async(gobj(), &ClockID_Clock_gstreamermm_callback, slot_copy);
+}
+
 } //namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/clock.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/clock.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/clock.hg	Tue Mar 11 03:04:47 2008
@@ -29,10 +29,37 @@
 namespace Gst
 {
 
+class Clock;
+
+/** A datatype to hold the handle to an outstanding sync or async clock
+ * callback.
+ */
 class ClockID
 {
   _CLASS_OPAQUE_REFCOUNTED(ClockID, GstClockID, NONE, gst_clock_id_ref, gst_clock_id_unref)
   _IGNORE(gst_clock_id_ref, gst_clock_id_unref)
+
+public:
+  /** For example,
+   * bool on_clock(const Glib::RefPtr<Clock>& clock, ClockTime time, const
+   * Glib::RefPtr<ClockID>& id);
+   */
+  typedef sigc::slot< bool, const Glib::RefPtr<Clock>&, ClockTime, const Glib::RefPtr<ClockID>& > SlotClock;
+
+  _WRAP_METHOD(ClockTime get_time(), gst_clock_id_get_time)
+  _WRAP_METHOD(ClockReturn wait(ClockTimeDiff& jitter), gst_clock_id_wait)
+
+  /** Register a slot on the given GstClockID id with the given slot. When
+   * passing a GstClockID with an invalid time to this function, the slot will
+   * be called immediatly with a time set to CLOCK_TIME_NONE. The slot will be
+   * called when the time of id has been reached.
+   *
+   * @param slot The slot to callback
+   * @return the result of the non blocking wait. MT safe. 
+   */
+  ClockReturn wait_async(const SlotClock& slot);
+
+  _WRAP_METHOD(void unschedule(), gst_clock_id_unschedule)
 };
 
 //Note that ClockTime is an enum.  That's why these are not member functions of a class
@@ -45,6 +72,79 @@
 guint get_nanoseconds(ClockTime time);
 guint get_fractional_seconds(ClockTime time);
 
+/** Clock â Abstract class for global clocks.
+ * GStreamer uses a global clock to synchronize the plugins in a pipeline.
+ * Different clock implementations are possible by implementing this abstract
+ * base class.
+ *
+ * The Clock returns a monotonically increasing time with the method
+ * get_time(). Its accuracy and base time depend on the specific clock
+ * implementation but time is always expressed in nanoseconds. Since the
+ * baseline of the clock is undefined, the clock time returned is not
+ * meaningful in itself, what matters are the deltas between two clock times.
+ * The time returned by a clock is called the absolute time.
+ *
+ * The pipeline uses the clock to calculate the stream time. Usually all
+ * renderers synchronize to the global clock using the buffer timestamps, the
+ * newsegment events and the element's base time, see Pipeline.
+ *
+ * A clock implementation can support periodic and single shot clock
+ * notifications both synchronous and asynchronous.
+ *
+ * One first needs to create a ClockID for the periodic or single shot
+ * notification using create_single_shot_id() or create_periodic_id().
+ *
+ * To perform a blocking wait for the specific time of the ClockID use the
+ * ClockID::wait() method. To receive a callback when the specific time is
+ * reached in the clock use ClockID::wait_async(). Both these calls can be
+ * interrupted with the ClockID::unschedule() call. If the blocking wait is
+ * unscheduled a return value of CLOCK_UNSCHEDULED is returned.
+ *
+ * Periodic callbacks scheduled async will be repeadedly called automatically
+ * until it is unscheduled. To schedule a sync periodic callback, wait() should
+ * be called repeadedly.
+ *
+ * The async callbacks can happen from any thread, either provided by the core or from a streaming thread. The application should be prepared for this.
+ *
+ * A ClockID that has been unscheduled cannot be used again for any wait
+ * operation, a new ClockID should be created.
+ *
+ * It is possible to perform a blocking wait on the same ClockID from multiple
+ * threads. However, registering the same ClockID for multiple async
+ * notifications is not possible, the slot will only be called for the thread
+ * registering the entry last.
+ *
+ * None of the wait operations unref the ClockID, the owner is responsible for
+ * unreffing the ids itself. This holds for both periodic and single shot
+ * notifications. The reason being that the owner of the ClockID has to keep a
+ * handle to the ClockID to unblock the wait on FLUSHING events or state
+ * changes and if the entry would be unreffed automatically, the handle might
+ * become invalid without any notification. (The RefPtr takes care of unreffing
+ * in this case)
+ *
+ * These clock operations do not operate on the stream time, so the callbacks
+ * will also occur when not in PLAYING state as if the clock just keeps on
+ * running. Some clocks however do not progress when the element that provided
+ * the clock is not PLAYING.
+ *
+ * When a clock has the CLOCK_FLAG_CAN_SET_MASTER flag set, it can be slaved to
+ * another Clock with the set_master() method. The clock will then
+ * automatically be synchronized to this master clock by repeadedly sampling
+ * the master clock and the slave clock and recalibrating the slave clock with
+ * set_calibration(). This feature is mostly useful for plugins that have an
+ * internal clock but must operate with another clock selected by the Pipeline.
+ * They can track the offset and rate difference of their internal clock
+ * relative to the master clock by using the get_calibration() method.
+ *
+ * The master/slave synchronisation can be tuned with the "timeout",
+ * "window-size" and "window-threshold" properties. The "timeout" property
+ * defines the interval to sample the master clock and run the calibration
+ * functions. "window-size" defines the number of samples to use when
+ * calibrating and "window-threshold" defines the minimum number of samples
+ * before the calibration is performed.
+ *
+ * Last reviewed on 2006-08-11 (0.10.10)
+ */
 class Clock : public Object
 {
   _CLASS_GOBJECT(Clock, GstClock, GST_CLOCK, Object, GstObject)
@@ -56,8 +156,8 @@
   _WRAP_METHOD(ClockTime set_resolution(ClockTime resolution), gst_clock_set_resolution)
   _WRAP_METHOD(ClockTime get_resolution() const, gst_clock_get_resolution)
   _WRAP_METHOD(ClockTime get_time() const, gst_clock_get_time)
-  //  _WRAP_METHOD(Glib::RefPtr<ClockID> new_single_shot_id(ClockTime time), gst_clock_new_single_shot_id)
-  //  _WRAP_METHOD(Glib::RefPtr<ClockID> new_periodic_id(ClockTime start_time, ClockTime intervals), gst_clock_new_periodic_id)
+  //TODO: _WRAP_METHOD(Glib::RefPtr<ClockID> create_single_shot_id(ClockTime time), gst_clock_new_single_shot_id)
+  //TODO: _WRAP_METHOD(Glib::RefPtr<ClockID> create_periodic_id(ClockTime start_time, ClockTime intervals), gst_clock_new_periodic_id)
   _WRAP_METHOD(ClockTime get_internal_time() const, gst_clock_get_internal_time)
   _WRAP_METHOD(ClockTime adjust_unlocked(ClockTime internal_time), gst_clock_adjust_unlocked)
   _WRAP_METHOD(ClockTime unadjust_unlocked(ClockTime external_time), gst_clock_unadjust_unlocked)

Modified: gstreamermm/trunk/gstreamer/src/element.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/element.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/element.ccg	Tue Mar 11 03:04:47 2008
@@ -36,7 +36,7 @@
 namespace Gst
 {
 
-void ElementInterfaced_WeakNotify_gstreamermm_callback(gpointer data,
+void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data,
 GObject* where_the_object_was)
 {
   delete (Gst::Element*) data;

Modified: gstreamermm/trunk/gstreamer/src/element.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/element.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/element.hg	Tue Mar 11 03:04:47 2008
@@ -194,7 +194,7 @@
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
-void ElementInterfaced_WeakNotify_gstreamermm_callback(gpointer data, GObject* where_the_object_was);
+void ElementInterfaced_WeakNotify_gstreamermm_callback(void* data, GObject* where_the_object_was);
 
 template <class T_Interface>
 ElementInterfaced<T_Interface>::ElementInterfaced(GstElement* castitem)

Modified: gstreamermm/trunk/gstreamer/src/enums.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/enums.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/enums.hg	Tue Mar 11 03:04:47 2008
@@ -19,6 +19,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <gst/gstclock.h>
 #include <gst/gstevent.h>
 #include <gst/gstelement.h>
 #include <gst/gsturi.h>
@@ -37,6 +38,19 @@
 _WRAP_ENUM(BufferFlag, GstBufferFlag)
 _WRAP_ENUM(BusSyncReply, GstBusSyncReply)
 _WRAP_ENUM(ClockEntryType, GstClockEntryType)
+
+enum ClockFlags {
+  CLOCK_FLAG_CAN_DO_SINGLE_SYNC = GST_CLOCK_FLAG_CAN_DO_SINGLE_SYNC,
+  CLOCK_FLAG_CAN_DO_SINGLE_ASYNC = GST_CLOCK_FLAG_CAN_DO_SINGLE_ASYNC,
+  CLOCK_FLAG_CAN_DO_PERIODIC_SYNC = GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC,
+  CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC = GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC,
+  CLOCK_FLAG_CAN_SET_RESOLUTION = GST_CLOCK_FLAG_CAN_SET_RESOLUTION,
+  CLOCK_FLAG_CAN_SET_MASTER = GST_CLOCK_FLAG_CAN_SET_MASTER,
+  /* padding */
+  CLOCK_FLAG_LAST = GST_CLOCK_FLAG_LAST 
+};
+
+_WRAP_ENUM(ClockFlags, GstClockFlags)
 _WRAP_ENUM(ClockReturn, GstClockReturn)
 
 enum EventType {

Modified: gstreamermm/trunk/gstreamer/src/filter.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/filter.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/filter.ccg	Tue Mar 11 03:04:47 2008
@@ -21,7 +21,7 @@
 
  #include <gst/gstfilter.h>
 
-static gboolean Filter_Filter_gstreamermm_callback(gpointer obj, void* data)
+static gboolean Filter_Filter_gstreamermm_callback(void* obj, void* data)
 {
   Gst::Filter::SlotFilter* the_slot = static_cast<Gst::Filter::SlotFilter*>(data);
 
@@ -29,7 +29,12 @@
   try
   {
   #endif //GLIBMM_EXCEPTIONS_ENABLED
-    return (*the_slot)(Glib::wrap((GObject*)(obj), true));
+    bool result = (*the_slot)(Glib::wrap((GObject*)(obj), true));
+
+    //Delete the once executing slot before returning result
+    delete the_slot;
+
+    return result;
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   }
   catch(...)
@@ -37,6 +42,9 @@
     Glib::exception_handlers_invoke();
   }
 
+  //Delete the once executing slot before returning result
+  delete the_slot;
+
   return 0; // arbitrary value
   #endif //GLIBMM_EXCEPTIONS_ENABLED
 }
@@ -47,10 +55,10 @@
 Glib::ListHandle< Glib::RefPtr<Glib::Object> >
 Filter::run(const Glib::ListHandle<Glib::RefPtr<Glib::Object> >& list, const SlotFilter& slot, bool first)
 {
-  SlotFilter slot_copy(slot);
+  SlotFilter* slot_copy = new SlotFilter(slot);
   // TODO: we don't know the ownership of the items, I filed bug #518627 for GStreamer. Siavash
   // TODO: For now, we'll use OWNERSHIP_SHALLOW (delete the list but not the items) until things clear up. Jose
-  return Glib::ListHandle< Glib::RefPtr<Glib::Object> >(gst_filter_run(list.data(), &Filter_Filter_gstreamermm_callback, first, &slot_copy), Glib::OWNERSHIP_SHALLOW);
+  return Glib::ListHandle< Glib::RefPtr<Glib::Object> >(gst_filter_run(list.data(), &Filter_Filter_gstreamermm_callback, first, slot_copy), Glib::OWNERSHIP_SHALLOW);
 }
 
 } //namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/index.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/index.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/index.ccg	Tue Mar 11 03:04:47 2008
@@ -24,7 +24,7 @@
 namespace Gst
 {
 
-static gboolean Index_Filter_gstreamermm_callback(GstIndex* index, GstIndexEntry* entry, gpointer data)
+static gboolean Index_Filter_gstreamermm_callback(GstIndex* index, GstIndexEntry* entry, void* data)
 {
   Index::SlotFilter * the_slot = static_cast<Index::SlotFilter*>(data);
 
@@ -34,14 +34,14 @@
   return result;
 }
 
-static void Index_Filter_gstreamermm_callback_destroy(gpointer data)
+static void Index_Filter_gstreamermm_callback_destroy(void* data)
 {
   Index::SlotFilter* the_slot = static_cast<Index::SlotFilter*>(data);
   if(the_slot)
     delete the_slot;
 }
 
-static gboolean Index_Resolver_gstreamermm_callback(GstIndex *index, GstObject *writer, gchar **writer_string, gpointer data)
+static gboolean Index_Resolver_gstreamermm_callback(GstIndex *index, GstObject *writer, gchar **writer_string, void* data)
 {
   Index::SlotResolver * the_slot = static_cast<Index::SlotResolver*>(data);
 

Modified: gstreamermm/trunk/gstreamer/src/interface.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/interface.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/interface.hg	Tue Mar 11 03:04:47 2008
@@ -48,7 +48,7 @@
 template <class T_CastTo> inline
 Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > Interface::cast(const Glib::RefPtr<Element>& element)
 {
-  gpointer result = gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
+  void* result = gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
   Gst::ElementInterfaced<T_CastTo>* element_interfaced = new ElementInterfaced<T_CastTo>((GstElement*) result);
   return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(element_interfaced);
 }

Modified: gstreamermm/trunk/gstreamer/src/pad.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pad.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/pad.ccg	Tue Mar 11 03:04:47 2008
@@ -121,7 +121,7 @@
   return FlowReturn(gst_pad_chain(gobj(), buffer->gobj()));
 }
 
-static void Pad_Block_gstreamermm_callback(GstPad* pad, gboolean blocked, gpointer data)
+static void Pad_Block_gstreamermm_callback(GstPad* pad, gboolean blocked, void* data)
 {
   Pad::SlotBlock * the_slot = static_cast<Pad::SlotBlock*>(data);
 

Modified: gstreamermm/trunk/gstreamer/src/registry.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/registry.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/registry.ccg	Tue Mar 11 03:04:47 2008
@@ -31,7 +31,12 @@
   try
   {
   #endif //GLIBMM_EXCEPTIONS_ENABLED
-    return (*the_slot)(Glib::wrap(plugin, true));
+    bool result = (*the_slot)(Glib::wrap(plugin, true));
+
+    //Delete the once executing slot before returning result
+    delete the_slot;
+
+    return result;
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   }
   catch(...)
@@ -39,6 +44,9 @@
     Glib::exception_handlers_invoke();
   }
 
+  //Delete the once executing slot before returning result
+  delete the_slot;
+
   return 0; // arbitrary value
   #endif //GLIBMM_EXCEPTIONS_ENABLED
 }
@@ -51,7 +59,12 @@
   try
   {
   #endif //GLIBMM_EXCEPTIONS_ENABLED
-    return (*the_slot)(Glib::wrap(feature, true));
+    bool result = (*the_slot)(Glib::wrap(feature, true));
+
+    //Delete the once executing slot before returning result
+    delete the_slot;
+
+    return result;
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   }
   catch(...)
@@ -59,25 +72,29 @@
     Glib::exception_handlers_invoke();
   }
 
+  //Delete the once executing slot before returning result
+  delete the_slot;
+
   return 0; // arbitrary value
   #endif //GLIBMM_EXCEPTIONS_ENABLED
 }
+
 namespace Gst
 {
 
 Glib::ListHandle< Glib::RefPtr<Plugin> >
 Registry::get_plugin_list(const Plugin::SlotFilter& filter, bool first)
 {
-  Plugin::SlotFilter slot_copy(filter);
-  GList* list = gst_registry_plugin_filter(gobj(), &Registry_Plugin_Filter_gstreamermm_callback, first, &slot_copy);
+  Plugin::SlotFilter* slot_copy = new Plugin::SlotFilter(filter);
+  GList* list = gst_registry_plugin_filter(gobj(), &Registry_Plugin_Filter_gstreamermm_callback, first, slot_copy);
   return Glib::ListHandle< Glib::RefPtr<Plugin> >(list, Glib::OWNERSHIP_DEEP);
 }
 
 Glib::ListHandle< Glib::RefPtr<PluginFeature> >
 Registry::get_feature_list(const PluginFeature::SlotFilter& filter, bool first)
 {
-  PluginFeature::SlotFilter slot_copy(filter);
-  GList* list = gst_registry_feature_filter(gobj(), &Registry_PluginFeature_Filter_gstreamermm_callback, first, &slot_copy);
+  PluginFeature::SlotFilter* slot_copy = new PluginFeature::SlotFilter(filter);
+  GList* list = gst_registry_feature_filter(gobj(), &Registry_PluginFeature_Filter_gstreamermm_callback, first, slot_copy);
   return Glib::ListHandle< Glib::RefPtr<PluginFeature> >(list, Glib::OWNERSHIP_DEEP);
 }
 

Modified: gstreamermm/trunk/gstreamer/src/structure.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/structure.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/structure.ccg	Tue Mar 11 03:04:47 2008
@@ -23,25 +23,29 @@
 #include <gst/gststructure.h>
 
 static gboolean
-Structure_Foreach_gstreamermm_callback(GQuark field_id, const GValue *value, gpointer data)
+Structure_Foreach_gstreamermm_callback(GQuark field_id, const GValue *value, void* data)
 {
   Glib::ValueBase val_base;
   val_base.init(value);
 
-  Gst::Structure::SlotForeach& slot = *static_cast<Gst::Structure::SlotForeach*>(data);
+  Gst::Structure::SlotForeach* slot = static_cast<Gst::Structure::SlotForeach*>(data);
 
-  return slot(Glib::QueryQuark(field_id), val_base);
+  bool result = (*slot)(Glib::QueryQuark(field_id), val_base);
+  delete slot;
+  return result;
 }
 
 static gboolean
-Structure_Map_gstreamermm_callback(GQuark field_id, GValue *value, gpointer data)
+Structure_Map_gstreamermm_callback(GQuark field_id, GValue *value, void* data)
 {
   Glib::ValueBase val_base;
   val_base.init(value);
 
-  Gst::Structure::SlotMap& slot = *static_cast<Gst::Structure::SlotMap*>(data);
+  Gst::Structure::SlotMap* slot = static_cast<Gst::Structure::SlotMap*>(data);
 
-  return slot(Glib::QueryQuark(field_id), val_base);
+  bool result = (*slot)(Glib::QueryQuark(field_id), val_base);
+  delete slot;
+  return result;
 }
 
 namespace Gst
@@ -182,15 +186,15 @@
 bool
 Structure::foreach(const SlotForeach& slot)
 {
-  SlotForeach slot_copy(slot);
-  return gst_structure_foreach(gobj(), &Structure_Foreach_gstreamermm_callback, &slot_copy);
+  SlotForeach* slot_copy = new SlotForeach(slot);
+  return gst_structure_foreach(gobj(), &Structure_Foreach_gstreamermm_callback, slot_copy);
 }
 
 bool
 Structure::map_in_place(const SlotMap& slot)
 {
-  SlotMap slot_copy(slot);
-  return gst_structure_map_in_place(gobj(), &Structure_Map_gstreamermm_callback, &slot_copy);
+  SlotMap* slot_copy = new SlotMap(slot);
+  return gst_structure_map_in_place(gobj(), &Structure_Map_gstreamermm_callback, slot_copy);
 }
 
 Structure

Modified: gstreamermm/trunk/gstreamer/src/taglist.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/taglist.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/taglist.ccg	Tue Mar 11 03:04:47 2008
@@ -23,10 +23,12 @@
 
 /*
 static gboolean
-TagList_Foreach_gstreamermm_callback(const GstTagList* list, const gchar *tag, gpointer data)
+TagList_Foreach_gstreamermm_callback(const GstTagList* list, const gchar *tag, void* data)
 {
-  Gst::TagList::SlotForeach& slot = *static_cast<Gst::TagList::SlotForeach*>(data);
-  return slot(Glib::wrap(list), Glib::ustring(value));
+  Gst::TagList::SlotForeach* slot = static_cast<Gst::TagList::SlotForeach*>(data);
+  bool result = (*slot)(Glib::wrap(list), Glib::ustring(value));
+  delete slot;
+  return result;
 }
 */
 
@@ -37,8 +39,8 @@
 void
 TagList::foreach(const SlotForeach& slot)
 {
-  SlotForeach slot_copy(slot);
-  gst_taglist_foreach(gobj(), &TagList_Foreach_gstreamermm_callback, &slot_copy);
+  SlotForeach* slot_copy = new SlotForeach(slot);
+  gst_taglist_foreach(gobj(), &TagList_Foreach_gstreamermm_callback, slot_copy);
 }
 */
 

Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4	Tue Mar 11 03:04:47 2008
@@ -112,6 +112,7 @@
 #Basic Gstreamermm Conversions
 _CONVERSION(`guint64',`ClockTime',`(ClockTime ($3))')
 _CONVERSION(`ClockTimeDiff',`GstClockTimeDiff',`GstClockTimeDiff ($3)')
+_CONVERSION(`ClockTimeDiff&',`GstClockTimeDiff*',`(GstClockTimeDiff*)(&($3))')
 _CONVERSION(`Format&',`GstFormat*',`(($2) &($3))')
 _CONVERSION(`const GstQueryType*',`const QueryType*',`(QueryType*)($3)')
 _CONVERSION(`const URIType',`const GstURIType',`(GstURIType($3))')



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