[gstreamermm] AudioSrc, BaseSrc: Wrap boolean virtual functions.



commit effc6bb528dea6741d2e0c8c49f26e1a8ecb08c6
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Thu Sep 2 01:38:00 2010 -0400

    	AudioSrc, BaseSrc: Wrap boolean virtual functions.
    
    	* gstreamer/src/basesrc.hg: Uncomment boolean virtual functions that
    	were previously wrapped.  The ogg_player_gtkmm example, which uses a
    	plug-in derived from this class (Gst::FileSrc), runs fine with the
    	virtual functions uncommented.
    	* gstreamer/src/audiosrc.hg: Uncomment the virtual functions here
    	also, although it's not easy to test because no examples use the only
    	plug-in derived from this class, Gst::AlsaSrc.

 ChangeLog                 |   12 +++++
 gstreamer/src/audiosrc.hg |   27 +++-------
 gstreamer/src/basesrc.hg  |  122 ++++++++++++++++-----------------------------
 3 files changed, 64 insertions(+), 97 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a238e4e..619bcce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-02  José Alburquerque  <jaalburqu svn gnome org>
+
+	AudioSrc, BaseSrc: Wrap boolean virtual functions.
+
+	* gstreamer/src/basesrc.hg: Uncomment boolean virtual functions that
+	were previously wrapped.  The ogg_player_gtkmm example, which uses a
+	plug-in derived from this class (Gst::FileSrc), runs fine with the
+	virtual functions uncommented.
+	* gstreamer/src/audiosrc.hg: Uncomment the virtual functions here
+	also, although it's not easy to test because no examples use the only
+	plug-in derived from this class, Gst::AlsaSrc.
+
 2010-08-31  José Alburquerque  <jaalburqu svn gnome org>
 
 	AudioSink: Wrap boolean virtual functions.
diff --git a/gstreamer/src/audiosrc.hg b/gstreamer/src/audiosrc.hg
index 2edcfbd..2941603 100644
--- a/gstreamer/src/audiosrc.hg
+++ b/gstreamer/src/audiosrc.hg
@@ -52,30 +52,21 @@ class AudioSrc : public Gst::BaseAudioSrc
   _CLASS_GOBJECT(AudioSrc, GstAudioSrc, GST_AUDIO_SRC, Gst::BaseAudioSrc, GstBaseAudioSrc)
 
 public:
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** vfunc to open the device.
-   //*/
-  //_WRAP_VFUNC(bool open(), "open")
+  /** vfunc to open the device.
+   */
+  _WRAP_VFUNC(bool open(), "open")
 
   /** vfunc to configure device with spec.
    */
   virtual bool prepare_vfunc(Gst::RingBufferSpec& spec);
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** vfunc to undo the configuration.
-   //*/
-  //_WRAP_VFUNC(bool unprepare(), "unprepare")
+  /** vfunc to undo the configuration.
+   */
+  _WRAP_VFUNC(bool unprepare(), "unprepare")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** vfunc to close the device.
-   //*/
-  //_WRAP_VFUNC(bool close(), "close")
+  /** vfunc to close the device.
+   */
+  _WRAP_VFUNC(bool close(), "close")
 
   /** vfunc to read samples to the audio device.
    */
diff --git a/gstreamer/src/basesrc.hg b/gstreamer/src/basesrc.hg
index 76dffaf..94e10c5 100644
--- a/gstreamer/src/basesrc.hg
+++ b/gstreamer/src/basesrc.hg
@@ -174,41 +174,26 @@ public:
   _WRAP_VFUNC(Glib::RefPtr<Gst::Caps> get_caps() const, "get_caps")
 
 #m4 _CONVERSION(`GstCaps*', `const Glib::RefPtr<Gst::Caps>&', `Glib::wrap($3, true)')
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Notify subclass of changed output caps.
-   //*/
-  //_WRAP_VFUNC(bool set_caps(const Glib::RefPtr<Gst::Caps>& caps), "set_caps")
+  /** Notify subclass of changed output caps.
+   */
+  _WRAP_VFUNC(bool set_caps(const Glib::RefPtr<Gst::Caps>& caps), "set_caps")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Negotiated the caps with the peer.
-   //*/
-  //_WRAP_VFUNC(bool negotiate(), "negotiate")
+  /** Negotiated the caps with the peer.
+   */
+  _WRAP_VFUNC(bool negotiate(), "negotiate")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Generate and send a new_segment event (UNUSED).
-   //*/
-  //_WRAP_VFUNC(bool new_segment(), "newsegment")
+  /** Generate and send a new_segment event (UNUSED).
+   */
+  _WRAP_VFUNC(bool new_segment(), "newsegment")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Start processing. Subclasses should open resources and prepare to produce
-   //* data.
-   //*/
-  //_WRAP_VFUNC(bool start(), "start")
+  /** Start processing. Subclasses should open resources and prepare to produce
+   * data.
+   */
+  _WRAP_VFUNC(bool start(), "start")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Stop processing. Subclasses should use this to close resources.
-   //*/
-  //_WRAP_VFUNC(bool stop(), "stop")
+  /** Stop processing. Subclasses should use this to close resources.
+   */
+  _WRAP_VFUNC(bool stop(), "stop")
 
 #m4 _CONVERSION(`GstBuffer*', `const Glib::RefPtr<Gst::Buffer>&', `Gst::wrap($3, true)')
 #m4 _CONVERSION(`GstClockTime*', `ClockTime&', `*($3)')
@@ -219,35 +204,23 @@ public:
 
 #m4 _CONVERSION(`guint64&', `guint64*', `&($3)')
 #m4 _CONVERSION(`guint64*', `guint64&', `*($3)')
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Return the total size of the resource, in the configured format.
-   //*/
-  //_WRAP_VFUNC(bool get_size(guint64& size) const, "get_size")
+  /** Return the total size of the resource, in the configured format.
+   */
+  _WRAP_VFUNC(bool get_size(guint64& size) const, "get_size")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Check if the source can seek.
-   //*/
-  //_WRAP_VFUNC(bool is_seekable() const, "is_seekable")
+  /** Check if the source can seek.
+   */
+  _WRAP_VFUNC(bool is_seekable() const, "is_seekable")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Unlock any pending access to the resource. Subclasses should unblock any
-   //* blocked function ASAP.
-   //*/
-  //_WRAP_VFUNC(bool unlock(), "unlock")
+  /** Unlock any pending access to the resource. Subclasses should unblock any
+   * blocked function ASAP.
+   */
+  _WRAP_VFUNC(bool unlock(), "unlock")
 
 #m4 _CONVERSION(`GstEvent*', `const Glib::RefPtr<Gst::Event>&', `Gst::wrap($3, true)')
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Override this to implement custom event handling.
-   //*/
-  //_WRAP_VFUNC(bool event(const Glib::RefPtr<Gst::Event>& event), "event")
+  /** Override this to implement custom event handling.
+   */
+  _WRAP_VFUNC(bool event(const Glib::RefPtr<Gst::Event>& event), "event")
 
   virtual FlowReturn create_vfunc(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer);
 
@@ -256,36 +229,27 @@ public:
   virtual bool do_seek_vfunc(Gst::Segment& segment); 
 
 #m4 _CONVERSION(`GstQuery*', `const Glib::RefPtr<Gst::Query>&', `Gst::wrap($3, true)')
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Handle a requested query.
-   //*/
-  //_WRAP_VFUNC(bool query(const Glib::RefPtr<Gst::Query>& query) const, "query")
+  /** Handle a requested query.
+   */
+  _WRAP_VFUNC(bool query(const Glib::RefPtr<Gst::Query>& query) const, "query")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Check whether the source would support pull-based operation if it were to
-   //* be opened now. This vfunc is optional, but should be implemented if
-   //* possible to avoid unnecessary start/stop cycles. The default
-   //* implementation will open and close the resource to find out whether
-   //* get_range() is supported, and that is usually undesirable.
-   //*/
-  //_WRAP_VFUNC(bool check_get_range(), "check_get_range")
+  /** Check whether the source would support pull-based operation if it were to
+   * be opened now. This vfunc is optional, but should be implemented if
+   * possible to avoid unnecessary start/stop cycles. The default
+   * implementation will open and close the resource to find out whether
+   * get_range() is supported, and that is usually undesirable.
+   */
+  _WRAP_VFUNC(bool check_get_range(), "check_get_range")
 
   /** Called during negotiation if caps need fixating. Implement instead of
    * setting a fixate function on the source pad.
    */
   _WRAP_VFUNC(void fixate(const Glib::RefPtr<Gst::Caps>& caps), "fixate")
 
-  //TODO: Some boolean vfuncs cause strange incorrect functionality when their
-  //callbacks return false with the last "return RType()" line.  Make sure this
-  //one doesn't cause problems and implement later.
-  ///** Clear the previous unlock request. Subclasses should clear any state they
-   //* set during unlock_vfunc(), such as clearing command queues.
-   //*/
-  //_WRAP_VFUNC(bool unlock_stop(), "unlock_stop")
+  /** Clear the previous unlock request. Subclasses should clear any state they
+   * set during unlock_vfunc(), such as clearing command queues.
+   */
+  _WRAP_VFUNC(bool unlock_stop(), "unlock_stop")
 
   /** Prepare the Gst::Segment that will be passed to the do_seek_vfunc()
    * vmethod for executing a seek request. Sub-classes should override this if



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