[gstreamermm] Wrapped Gst::Tuner interface vfuncs.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gstreamermm] Wrapped Gst::Tuner interface vfuncs.
- Date: Thu, 30 Apr 2009 00:33:24 -0400 (EDT)
commit 7faec61d7937620130bb68aeeaff7b82ccf2c74f
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Thu Apr 30 00:29:30 2009 -0400
Wrapped Gst::Tuner interface vfuncs.
---
ChangeLog | 15 +++++
gstreamer/src/audiosrc.ccg | 2 +-
gstreamer/src/cddabasesrc.ccg | 2 +-
gstreamer/src/filter.ccg | 2 +-
gstreamer/src/gst_vfuncs.defs | 63 ++++++++++++++++++++
gstreamer/src/segment.ccg | 2 +-
gstreamer/src/tuner.ccg | 128 ++++++++++++++++++++++++++++++++++++++++-
gstreamer/src/tuner.hg | 28 +++++++++
tools/m4/convert_gst.m4 | 2 +
9 files changed, 237 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 331aad8..15f9706 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-04-30 José Alburquerque <jaalburqu svn gnome org>
+
+ Wrapped Gst::Tuner interface vfuncs.
+
+ * gstreamer/src/tuner.ccg:
+ * gstreamer/src/tuner.hg:
+ * tools/m4/convert_gst.m4:
+ * gstreamer/src/gst_vfuncs.defs: Wrapped Gst::Tuner interface vfuncs.
+
+ * gstreamer/src/audiosrc.ccg:
+ * gstreamer/src/cddabasesrc.ccg:
+ * gstreamer/src/filter.ccg:
+ * gstreamer/src/segment.ccg: Removed leading spaces before #include
+ directives.
+
2009-04-29 José Alburquerque <jaalburqu svn gnome org>
Re-ordered preset.hg vfunc declarations.
diff --git a/gstreamer/src/audiosrc.ccg b/gstreamer/src/audiosrc.ccg
index ffbad59..cada882 100644
--- a/gstreamer/src/audiosrc.ccg
+++ b/gstreamer/src/audiosrc.ccg
@@ -17,5 +17,5 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
- #include <gst/audio/gstaudiosrc.h>
+#include <gst/audio/gstaudiosrc.h>
_PINCLUDE(gstreamermm/private/baseaudiosrc_p.h)
diff --git a/gstreamer/src/cddabasesrc.ccg b/gstreamer/src/cddabasesrc.ccg
index b3f1cfb..0d296e2 100644
--- a/gstreamer/src/cddabasesrc.ccg
+++ b/gstreamer/src/cddabasesrc.ccg
@@ -17,5 +17,5 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
- #include <gst/cdda/gstcddabasesrc.h>
+#include <gst/cdda/gstcddabasesrc.h>
_PINCLUDE(gstreamermm/private/pushsrc_p.h)
diff --git a/gstreamer/src/filter.ccg b/gstreamer/src/filter.ccg
index cb41abd..afdb951 100644
--- a/gstreamer/src/filter.ccg
+++ b/gstreamer/src/filter.ccg
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
- #include <gst/gstfilter.h>
+#include <gst/gstfilter.h>
static gboolean Filter_Filter_gstreamermm_callback(void* obj, void* data)
{
diff --git a/gstreamer/src/gst_vfuncs.defs b/gstreamer/src/gst_vfuncs.defs
index e580e86..a6bd1a5 100644
--- a/gstreamer/src/gst_vfuncs.defs
+++ b/gstreamer/src/gst_vfuncs.defs
@@ -775,6 +775,69 @@
)
)
+; GstTuner
+
+(define-vfunc list_channels
+ (of-object "GstTuner")
+ (return-type "const-GList*")
+)
+
+(define-vfunc set_channel
+ (of-object "GstTuner")
+ (return-type "void")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-vfunc get_channel
+ (of-object "GstTuner")
+ (return-type "GstTunerChannel*")
+)
+
+(define-vfunc list_norms
+ (of-object "GstTuner")
+ (return-type "const-GList*")
+)
+
+(define-vfunc set_norm
+ (of-object "GstTuner")
+ (return-type "void")
+ (parameters
+ '("GstTunerNorm*" "norm")
+ )
+)
+
+(define-vfunc get_norm
+ (of-object "GstTuner")
+ (return-type "GstTunerNorm*")
+)
+
+(define-vfunc set_frequency
+ (of-object "GstTuner")
+ (return-type "void")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ '("gulong" "frequency")
+ )
+)
+
+(define-vfunc get_frequency
+ (of-object "GstTuner")
+ (return-type "gulong")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
+(define-vfunc signal_strength
+ (of-object "GstTuner")
+ (return-type "gint")
+ (parameters
+ '("GstTunerChannel*" "channel")
+ )
+)
+
; GstXOverlay
(define-vfunc set_xwindow_id
diff --git a/gstreamer/src/segment.ccg b/gstreamer/src/segment.ccg
index 4e45ac0..f064489 100644
--- a/gstreamer/src/segment.ccg
+++ b/gstreamer/src/segment.ccg
@@ -17,4 +17,4 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
- #include <gst/gstsegment.h>
+#include <gst/gstsegment.h>
diff --git a/gstreamer/src/tuner.ccg b/gstreamer/src/tuner.ccg
index fd54b02..29bf7a3 100644
--- a/gstreamer/src/tuner.ccg
+++ b/gstreamer/src/tuner.ccg
@@ -17,6 +17,128 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
- #include <gst/interfaces/tuner.h>
- #include <gstreamermm/tunerchannel.h>
- #include <gstreamermm/tunernorm.h>
+#include <gst/interfaces/tuner.h>
+#include <gstreamermm/tunerchannel.h>
+#include <gstreamermm/tunernorm.h>
+
+namespace Gst
+{
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+const GList* Tuner_Class::list_channels_vfunc_callback(GstTuner* self)
+{
+ Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+ Glib::ObjectBase::_get_current_wrapper((GObject*)self));
+
+ // Non-gtkmmproc-generated custom classes implicitly call the default
+ // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
+ // generated classes can use this optimisation, which avoids the unnecessary
+ // parameter conversions if there is no possibility of the virtual function
+ // being overridden:
+ if(obj_base && obj_base->is_derived_())
+ {
+ CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+ if(obj) // This can be NULL during destruction.
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try // Trap C++ exceptions which would normally be lost because this is a C callback.
+ {
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ // Call the virtual member method, which derived classes might override.
+ return (obj->list_channels_vfunc()).data();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
+ }
+
+ BaseClassType *const base = static_cast<BaseClassType*>(
+ g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
+) );
+
+ // Call the original underlying C function:
+ if(base && base->list_channels)
+ return (*base->list_channels)(self);
+
+
+ typedef const GList* RType;
+ return RType();
+}
+Glib::ListHandle< Glib::RefPtr<Gst::TunerChannel> > Gst::Tuner::list_channels_vfunc() const
+{
+ BaseClassType *const base = static_cast<BaseClassType*>(
+ g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
+) );
+
+ if(base && base->list_channels)
+ return Glib::ListHandle< Glib::RefPtr<Gst::TunerChannel> >(const_cast<GList*>((*base->list_channels)(const_cast<GstTuner*>(gobj()))), Glib::OWNERSHIP_NONE);
+
+ typedef Glib::ListHandle< Glib::RefPtr<Gst::TunerChannel> > RType;
+ return RType(0, Glib::OWNERSHIP_NONE);
+}
+const GList* Tuner_Class::list_norms_vfunc_callback(GstTuner* self)
+{
+ Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+ Glib::ObjectBase::_get_current_wrapper((GObject*)self));
+
+ // Non-gtkmmproc-generated custom classes implicitly call the default
+ // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc-
+ // generated classes can use this optimisation, which avoids the unnecessary
+ // parameter conversions if there is no possibility of the virtual function
+ // being overridden:
+ if(obj_base && obj_base->is_derived_())
+ {
+ CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+ if(obj) // This can be NULL during destruction.
+ {
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ try // Trap C++ exceptions which would normally be lost because this is a C callback.
+ {
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ // Call the virtual member method, which derived classes might override.
+ return (obj->list_norms_vfunc()).data();
+ #ifdef GLIBMM_EXCEPTIONS_ENABLED
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+ #endif //GLIBMM_EXCEPTIONS_ENABLED
+ }
+ }
+
+ BaseClassType *const base = static_cast<BaseClassType*>(
+ g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
+) );
+
+ // Call the original underlying C function:
+ if(base && base->list_norms)
+ return (*base->list_norms)(self);
+
+
+ typedef const GList* RType;
+ return RType();
+}
+Glib::ListHandle< Glib::RefPtr<Gst::TunerNorm> > Gst::Tuner::list_norms_vfunc() const
+{
+ BaseClassType *const base = static_cast<BaseClassType*>(
+ g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
+g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
+) );
+
+ if(base && base->list_norms)
+ return Glib::ListHandle< Glib::RefPtr<Gst::TunerNorm> >(const_cast<GList*>((*base->list_norms)(const_cast<GstTuner*>(gobj()))), Glib::OWNERSHIP_NONE);
+
+ typedef Glib::ListHandle< Glib::RefPtr<Gst::TunerNorm> > RType;
+ return RType(0, Glib::OWNERSHIP_NONE);
+}
+#endif //GLIBMM_VFUNCS_ENABLED
+
+} // namespace Gst
diff --git a/gstreamer/src/tuner.hg b/gstreamer/src/tuner.hg
index 221413b..3619a94 100644
--- a/gstreamer/src/tuner.hg
+++ b/gstreamer/src/tuner.hg
@@ -91,6 +91,34 @@ public:
* @param signal The new signal.
*/
_WRAP_SIGNAL(void signal_changed(const Glib::RefPtr<Gst::TunerChannel>& channel, int signal), "signal-changed")
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+ virtual Glib::ListHandle< Glib::RefPtr<Gst::TunerChannel> > list_channels_vfunc() const;
+#endif //GLIBMM_VFUNCS_ENABLED
+
+ _WRAP_VFUNC(void set_channel(const Glib::RefPtr<Gst::TunerChannel>& channel), "set_channel")
+ _WRAP_VFUNC(Glib::RefPtr<Gst::TunerChannel> get_channel() const, "get_channel")
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+ virtual Glib::ListHandle< Glib::RefPtr<Gst::TunerNorm> > list_norms_vfunc() const;
+#endif //GLIBMM_VFUNCS_ENABLED
+
+ _WRAP_VFUNC(void set_norm(const Glib::RefPtr<Gst::TunerNorm>& norm), "set_norm")
+ _WRAP_VFUNC(Glib::RefPtr<Gst::TunerNorm> get_norm() const, "get_norm")
+ _WRAP_VFUNC(void set_frequency(const Glib::RefPtr<Gst::TunerChannel>& channel, gulong frequency), "set_frequency")
+ _WRAP_VFUNC(gulong get_frequency(const Glib::RefPtr<Gst::TunerChannel>& channel) const, "get_frequency")
+ _WRAP_VFUNC(int signal_strength(const Glib::RefPtr<Gst::TunerChannel>& channel) const, "signal_strength")
+
+protected:
+#m4begin
+ _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
+ klass->list_channels = &list_channels_vfunc_callback;
+ klass->list_norms = &list_norms_vfunc_callback;
+ _SECTION(SECTION_PH_VFUNCS)
+ static const GList* list_channels_vfunc_callback(GstTuner* self);
+ static const GList* list_norms_vfunc_callback(GstTuner* self);
+ _POP()
+#m4end
};
} // namespace Gst
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index d766535..a1273e8 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -156,12 +156,14 @@ _CONVERSION(`GstTunerChannel*',`Glib::RefPtr<Gst::TunerChannel>', `Glib::wrap($3
_CONVERSION(`GstTunerChannel*',`Glib::RefPtr<const Gst::TunerChannel>', `Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<Gst::TunerChannel>&',`GstTunerChannel*', `($3)->gobj()')
_CONVERSION(`const Glib::RefPtr<const Gst::TunerChannel>&',`GstTunerChannel*', `const_cast<GstTunerChannel*>(($3)->gobj())')
+_CONVERSION(`Glib::RefPtr<Gst::TunerChannel>', `GstTunerChannel*', `($3)->gobj()')
#TunerNorm
_CONVERSION(`GstTunerNorm*',`Glib::RefPtr<Gst::TunerNorm>', `Glib::wrap($3)')
_CONVERSION(`GstTunerNorm*',`Glib::RefPtr<const Gst::TunerNorm>', `Glib::wrap($3)')
_CONVERSION(`const Glib::RefPtr<Gst::TunerNorm>&',`GstTunerNorm*', `($3)->gobj()')
_CONVERSION(`const Glib::RefPtr<const Gst::TunerNorm>&',`GstTunerNorm*', `const_cast<GstTunerNorm*>(($3)->gobj())')
+_CONVERSION(`Glib::RefPtr<Gst::TunerNorm>', `GstTunerNorm*', `($3)->gobj()')
#URIHandler
_CONVERSION(`const Glib::RefPtr<Gst::URIHandler>&',`GstURIHandler*',`($3)->gobj()')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]