[gstreamermm] Wrapped Gst::VideoOrientation interface vfuncs.
- From: José Alburquerque <jaalburqu src gnome org>
- To: svn-commits-list gnome org
- Subject: [gstreamermm] Wrapped Gst::VideoOrientation interface vfuncs.
- Date: Thu, 30 Apr 2009 16:24:34 -0400 (EDT)
commit 127f1c8d74a2e147440e3cda922cd68f2fab8085
Author: José Alburquerque <jaalburqu svn gnome org>
Date: Thu Apr 30 16:20:22 2009 -0400
Wrapped Gst::VideoOrientation interface vfuncs.
---
ChangeLog | 17 ++++
gstreamer/src/basesink.ccg | 16 ++++
gstreamer/src/basesink.hg | 4 +-
gstreamer/src/basesrc.ccg | 13 +++
gstreamer/src/basesrc.hg | 4 +-
gstreamer/src/gst_vfuncs.defs | 66 ++++++++++++++
gstreamer/src/segment.ccg | 18 ++++
gstreamer/src/segment.hg | 3 +-
gstreamer/src/videoorientation.ccg | 164 ++++++++++++++++++++++++++++++++++++
gstreamer/src/videoorientation.hg | 29 ++++++-
tools/m4/convert_gst.m4 | 3 +-
11 files changed, 329 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 15f9706..58a12d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2009-04-30 José Alburquerque <jaalburqu svn gnome org>
+ Wrapped Gst::VideoOrientation interface vfuncs.
+
+ * gstreamer/src/videoorientation.ccg:
+ * gstreamer/src/videoorientation.hg:
+ * gstreamer/src/gst_vfuncs.defs: Wrapped vfuncs. Handwrote methods
+ with bool& parameters.
+ * tools/m4/convert_gst.m4: Removed erroneous bool& to gboolean*
+ conversion.
+ * gstreamer/src/basesink.ccg:
+ * gstreamer/src/basesink.hg:
+ * gstreamer/src/basesrc.ccg:
+ * gstreamer/src/basesrc.hg:
+ * gstreamer/src/segment.ccg:
+ * gstreamer/src/segment.hg: Handwrote methods with boo& parameters.
+
+2009-04-30 José Alburquerque <jaalburqu svn gnome org>
+
Wrapped Gst::Tuner interface vfuncs.
* gstreamer/src/tuner.ccg:
diff --git a/gstreamer/src/basesink.ccg b/gstreamer/src/basesink.ccg
index 89df5b5..9f7f6ac 100644
--- a/gstreamer/src/basesink.ccg
+++ b/gstreamer/src/basesink.ccg
@@ -24,6 +24,22 @@ _PINCLUDE(gstreamermm/private/element_p.h)
namespace Gst
{
+bool BaseSink::query_latency(bool& live, bool& upstream_live, ClockTime& min_latency, ClockTime& max_latency) const
+{
+ gboolean gst_live = 0;
+ gboolean gst_upstream_live = 0;
+
+ const bool result =
+ gst_base_sink_query_latency(const_cast<GstBaseSink*>(gobj()),
+ &gst_live, &gst_upstream_live, (GstClockTime*)(&(min_latency)),
+ (GstClockTime*)(&(max_latency)));
+
+ live = gst_live;
+ upstream_live = gst_upstream_live;
+
+ return result;
+}
+
ClockReturn BaseSink::wait_clock(ClockTime time)
{
return (ClockReturn)(gst_base_sink_wait_clock(const_cast<GstBaseSink*>(gobj()), (GstClockTime)(time), 0));
diff --git a/gstreamer/src/basesink.hg b/gstreamer/src/basesink.hg
index 97a709c..444db16 100644
--- a/gstreamer/src/basesink.hg
+++ b/gstreamer/src/basesink.hg
@@ -135,7 +135,9 @@ class BaseSink
_CLASS_GOBJECT(BaseSink, GstBaseSink, GST_BASE_SINK, Element, GstElement)
public:
- _WRAP_METHOD(bool query_latency(bool& live, bool& upstream_live, ClockTime& min_latency, ClockTime& max_latency) const, gst_base_sink_query_latency)
+ _WRAP_METHOD_DOCS_ONLY(gst_base_sink_query_latency)
+ bool query_latency(bool& live, bool& upstream_live, ClockTime& min_latency,
+ ClockTime& max_latency) const;
_WRAP_METHOD(ClockTime get_latency() const, gst_base_sink_get_latency)
_WRAP_METHOD(FlowReturn wait_preroll(), gst_base_sink_wait_preroll)
_WRAP_METHOD(ClockReturn wait_clock(ClockTime time, ClockTimeDiff& jitter), gst_base_sink_wait_clock)
diff --git a/gstreamer/src/basesrc.ccg b/gstreamer/src/basesrc.ccg
index 0e9ecb9..2a54636 100644
--- a/gstreamer/src/basesrc.ccg
+++ b/gstreamer/src/basesrc.ccg
@@ -25,6 +25,19 @@ _PINCLUDE(gstreamermm/private/element_p.h)
namespace Gst
{
+bool BaseSrc::query_latency(bool& live, ClockTime& min_latency,
+ ClockTime& max_latency) const
+{
+ gboolean gst_live = 0;
+
+ const bool result =
+ gst_base_src_query_latency(const_cast<GstBaseSrc*>(gobj()),
+ &gst_live, (GstClockTime*)(&(min_latency)),
+ (GstClockTime*)(&(max_latency)));
+ live = gst_live;
+ return result;
+}
+
#ifdef GLIBMM_VFUNCS_ENABLED
gboolean BaseSrc_Class::do_seek_vfunc_callback(GstBaseSrc* self, GstSegment* segment)
{
diff --git a/gstreamer/src/basesrc.hg b/gstreamer/src/basesrc.hg
index b45ed19..389a117 100644
--- a/gstreamer/src/basesrc.hg
+++ b/gstreamer/src/basesrc.hg
@@ -148,7 +148,9 @@ public:
_WRAP_METHOD(bool is_live() const, gst_base_src_is_live)
_WRAP_METHOD(void set_live(bool live), gst_base_src_set_live)
_WRAP_METHOD(void set_format(Format format), gst_base_src_set_format)
- _WRAP_METHOD(bool query_latency(bool& live, ClockTime& min_latency, ClockTime& max_latency) const, gst_base_src_query_latency)
+ _WRAP_METHOD_DOCS_ONLY(gst_base_src_query_latency)
+ bool query_latency(bool& live, ClockTime& min_latency,
+ ClockTime& max_latency) const;
_WRAP_METHOD(bool get_do_timestamp() const, gst_base_src_get_do_timestamp)
_WRAP_METHOD(void set_do_timestamp(bool timestamp), gst_base_src_set_do_timestamp)
diff --git a/gstreamer/src/gst_vfuncs.defs b/gstreamer/src/gst_vfuncs.defs
index a6bd1a5..7b568b0 100644
--- a/gstreamer/src/gst_vfuncs.defs
+++ b/gstreamer/src/gst_vfuncs.defs
@@ -838,6 +838,72 @@
)
)
+; GstVideoOrientation
+
+(define-vfunc get_hflip
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gboolean*" "flip")
+ )
+)
+
+(define-vfunc get_vflip
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gboolean*" "flip")
+ )
+)
+
+(define-vfunc get_hcenter
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gint*" "center")
+ )
+)
+
+(define-vfunc get_vcenter
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gint*" "center")
+ )
+)
+
+(define-vfunc set_hflip
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gboolean" "flip")
+ )
+)
+
+(define-vfunc set_vflip
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gboolean" "flip")
+ )
+)
+
+(define-vfunc set_hcenter
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gint" "center")
+ )
+)
+
+(define-vfunc set_vcenter
+ (of-object "GstVideoOrientation")
+ (return-type "gboolean")
+ (parameters
+ '("gint" "center")
+ )
+)
+
; GstXOverlay
(define-vfunc set_xwindow_id
diff --git a/gstreamer/src/segment.ccg b/gstreamer/src/segment.ccg
index f064489..6bac2cb 100644
--- a/gstreamer/src/segment.ccg
+++ b/gstreamer/src/segment.ccg
@@ -18,3 +18,21 @@
*/
#include <gst/gstsegment.h>
+
+namespace Gst
+{
+
+void Segment::set_seek(double rate, Format format, SeekFlags flags,
+ SeekType start_type, gint64 start, SeekType stop_type, gint64 stop,
+ bool& update)
+{
+ gboolean gst_update = 0;
+
+ gst_segment_set_seek(gobj(), rate, ((GstFormat)(format)),
+ ((GstSeekFlags)(flags)), ((GstSeekType)(start_type)), start,
+ ((GstSeekType)(stop_type)), stop, &gst_update);
+
+ update = gst_update;
+}
+
+} // namespace Gst
diff --git a/gstreamer/src/segment.hg b/gstreamer/src/segment.hg
index 04da55f..6d0228e 100644
--- a/gstreamer/src/segment.hg
+++ b/gstreamer/src/segment.hg
@@ -94,7 +94,8 @@ public:
_WRAP_METHOD(void set_last_stop(Format format, gint64 position), gst_segment_set_last_stop)
_WRAP_METHOD(void set_newsegment(bool update, double rate, Format format, gint64 start, gint64 stop, gint64 time), gst_segment_set_newsegment)
_WRAP_METHOD(void set_newsegment(bool update, double rate, double applied_rate, Format format, gint64 start, gint64 stop, gint64 time), gst_segment_set_newsegment_full)
- _WRAP_METHOD(void set_seek(double rate, Format format, SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop, bool& update), gst_segment_set_seek)
+ _WRAP_METHOD_DOCS_ONLY(gst_segment_set_seek)
+ void set_seek(double rate, Format format, SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop, bool& update);
_WRAP_METHOD(gint64 convert_to_running_time(Format format, gint64 position) const, gst_segment_to_running_time)
_WRAP_METHOD(gint64 convert_to_stream_time(Format format, gint64 position) const, gst_segment_to_stream_time)
};
diff --git a/gstreamer/src/videoorientation.ccg b/gstreamer/src/videoorientation.ccg
index d2dfe15..a2953ff 100644
--- a/gstreamer/src/videoorientation.ccg
+++ b/gstreamer/src/videoorientation.ccg
@@ -16,3 +16,167 @@
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+namespace Gst
+{
+
+bool VideoOrientation::get_hflip(bool& flip) const
+{
+ gboolean gst_flip = 0;
+
+ const bool result =
+ gst_video_orientation_get_hflip(const_cast<GstVideoOrientation*>(gobj()),
+ &gst_flip);
+ flip = gst_flip;
+ return result;
+}
+
+bool VideoOrientation::get_vflip(bool& flip) const
+{
+ gboolean gst_flip = 0;
+ const bool result =
+ gst_video_orientation_get_vflip(const_cast<GstVideoOrientation*>(gobj()),
+ &gst_flip);
+ flip = gst_flip;
+ return result;
+}
+
+#ifdef GLIBMM_VFUNCS_ENABLED
+gboolean VideoOrientation_Class::get_hflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
+{
+ 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.
+ bool cpp_flip = false;
+ const gboolean result =
+ static_cast<int>(obj->get_hflip_vfunc(cpp_flip));
+ *flip = cpp_flip;
+ return result;
+ #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->get_hflip)
+ return (*base->get_hflip)(self, flip);
+
+
+ typedef gboolean RType;
+ return RType();
+}
+bool Gst::VideoOrientation::get_hflip_vfunc(bool& flip) 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->get_hflip)
+ {
+ gboolean gst_flip = 0;
+
+ const bool result =
+ (*base->get_hflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
+ flip = gst_flip;
+ return result;
+ }
+
+ typedef bool RType;
+ return RType();
+}
+gboolean VideoOrientation_Class::get_vflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip)
+{
+ 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.
+ bool cpp_flip = false;
+ const gboolean result =
+ static_cast<int>(obj->get_vflip_vfunc(cpp_flip));
+ *flip = cpp_flip;
+ return result;
+ #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->get_vflip)
+ return (*base->get_vflip)(self, flip);
+
+
+ typedef gboolean RType;
+ return RType();
+}
+bool Gst::VideoOrientation::get_vflip_vfunc(bool& flip) 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->get_vflip)
+ {
+ gboolean gst_flip = 0;
+
+ const bool result =
+ (*base->get_vflip)(const_cast<GstVideoOrientation*>(gobj()),&gst_flip);
+ flip = gst_flip;
+ return result;
+ }
+
+ typedef bool RType;
+ return RType();
+}
+#endif //GLIBMM_VFUNCS_ENABLED
+} // namespace Gst
diff --git a/gstreamer/src/videoorientation.hg b/gstreamer/src/videoorientation.hg
index 909687c..e6c69ea 100644
--- a/gstreamer/src/videoorientation.hg
+++ b/gstreamer/src/videoorientation.hg
@@ -37,15 +37,38 @@ class VideoOrientation : public Glib::Interface
public:
_WRAP_METHOD(bool get_hcenter(int& center) const, gst_video_orientation_get_hcenter)
- _WRAP_METHOD(bool get_hflip(bool& flip) const, gst_video_orientation_get_hflip)
+ _WRAP_METHOD_DOCS_ONLY(gst_video_orientation_get_hflip)
+ bool get_hflip(bool& flip) const;
_WRAP_METHOD(bool get_vcenter(int& center) const, gst_video_orientation_get_vcenter)
- _WRAP_METHOD(bool get_vflip(bool& flip) const, gst_video_orientation_get_vflip)
+ _WRAP_METHOD_DOCS_ONLY(gst_video_orientation_get_vflip)
+ bool get_vflip(bool& flip) const;
_WRAP_METHOD(bool set_hcenter(int center), gst_video_orientation_set_hcenter)
_WRAP_METHOD(bool set_hflip(bool flip), gst_video_orientation_set_hflip)
_WRAP_METHOD(bool set_vcenter(int center), gst_video_orientation_set_vcenter)
_WRAP_METHOD(bool set_vflip(bool flip), gst_video_orientation_set_vflip)
- //TODO: Wrap vfuncs.
+ #ifdef GLIBMM_VFUNCS_ENABLED
+ virtual bool get_hflip_vfunc(bool& flip) const;
+ virtual bool get_vflip_vfunc(bool& flip) const;
+#endif //GLIBMM_VFUNCS_ENABLED
+
+ _WRAP_VFUNC(bool get_hcenter(int& center) const, "get_hcenter")
+ _WRAP_VFUNC(bool get_vcenter(int& center) const, "get_vcenter")
+ _WRAP_VFUNC(bool set_hflip(bool flip), "set_hflip")
+ _WRAP_VFUNC(bool set_vflip(bool flip), "set_vflip")
+ _WRAP_VFUNC(bool set_hcenter(int center), "set_hcenter")
+ _WRAP_VFUNC(bool set_vcenter(int center), "set_vcenter")
+
+protected:
+#m4begin
+ _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
+ klass->get_hflip = &get_hflip_vfunc_callback;
+ klass->get_vflip = &get_vflip_vfunc_callback;
+ _SECTION(SECTION_PH_VFUNCS)
+ static gboolean get_hflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip);
+ static gboolean get_vflip_vfunc_callback(GstVideoOrientation* self, gboolean* flip);
+ _POP()
+#m4end
};
} // namespace Gst
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index a1273e8..d1c24f9 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -172,9 +172,8 @@ _CONVERSION(`const Glib::RefPtr<Gst::URIHandler>&',`GstURIHandler*',`($3)->gobj(
#Basic General Conversions
_CONVERSION(`gint64&',`gint64*',`&($3)')
-_CONVERSION(`bool&',`gboolean*',`(($2)&($3))')
_CONVERSION(`const guint&',`guint',`$3')
-_CONVERSION(`const guint32&',`guint32',`$3')
+_CONVERSION(`const guint32&',`guint32',`($3)')
#Basic Gstreamermm Conversions
_CONVERSION(`ClockTime&',`GstClockTime*',`(GstClockTime*)(&($3))')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]