[gstreamermm] Fix warnings



commit c5006faf05bc4b46767d30f42bcb6157836b7540
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sat Sep 17 22:49:34 2016 +0200

    Fix warnings

 gstreamer/gstreamermm/check.cc   |    2 +-
 gstreamer/src/audiosink.ccg      |    6 +++---
 gstreamer/src/audiosink.hg       |    6 +++---
 gstreamer/src/basesink.ccg       |    9 ++++++---
 gstreamer/src/basesrc.ccg        |    8 +++++---
 gstreamer/src/basetransform.ccg  |   10 ++++++----
 gstreamer/src/context.hg         |    2 +-
 gstreamer/src/pad.hg             |    1 -
 gstreamer/src/typefindfactory.hg |    2 +-
 gstreamer/src/value.ccg          |    6 +++---
 gstreamer/src/videoinfo.hg       |    2 +-
 tools/m4/convert_gst.m4          |    2 +-
 12 files changed, 31 insertions(+), 25 deletions(-)
---
diff --git a/gstreamer/gstreamermm/check.cc b/gstreamer/gstreamermm/check.cc
index d620435..a0d323d 100644
--- a/gstreamer/gstreamermm/check.cc
+++ b/gstreamer/gstreamermm/check.cc
@@ -54,7 +54,7 @@ RefPtr<Element> Check::_Check::setup_element (const ustring& factory)
 
     element = ElementFactory::create_element (factory, factory);
 
-    ThrowIf (element, "Could not create a '" + factory + "' element");
+    ThrowIf (!!element, "Could not create a '" + factory + "' element");
     CheckRefCount (element->gobj(), factory, 1);
 
     return element;
diff --git a/gstreamer/src/audiosink.ccg b/gstreamer/src/audiosink.ccg
index 403926d..6f90837 100644
--- a/gstreamer/src/audiosink.ccg
+++ b/gstreamer/src/audiosink.ccg
@@ -22,7 +22,7 @@ _PINCLUDE(gstreamermm/private/audiobasesink_p.h)
 namespace Gst
 {
 
-gboolean AudioSink_Class::prepare_vfunc_callback(GstAudioSink* self, GstAudioRingBufferSpec* spec)
+gboolean AudioSink_Class::prepare_audiosink_vfunc_callback(GstAudioSink* self, GstAudioRingBufferSpec* spec)
 {
   Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -42,7 +42,7 @@ gboolean AudioSink_Class::prepare_vfunc_callback(GstAudioSink* self, GstAudioRin
         Gst::AudioRingBufferSpec cpp_spec(*spec);
 
         // Call the virtual member method, which derived classes might override.
-        return static_cast<int>(obj->prepare_vfunc(cpp_spec));
+        return static_cast<int>(obj->prepare_audiosink_vfunc(cpp_spec));
       }
       catch(...)
       {
@@ -63,7 +63,7 @@ gboolean AudioSink_Class::prepare_vfunc_callback(GstAudioSink* self, GstAudioRin
   typedef gboolean RType;
   return RType();
 }
-bool Gst::AudioSink::prepare_vfunc(Gst::AudioRingBufferSpec& spec)
+bool Gst::AudioSink::prepare_audiosink_vfunc(Gst::AudioRingBufferSpec& spec)
 {
   BaseClassType *const base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class 
(The original underlying C class).
diff --git a/gstreamer/src/audiosink.hg b/gstreamer/src/audiosink.hg
index ec8932e..642aef8 100644
--- a/gstreamer/src/audiosink.hg
+++ b/gstreamer/src/audiosink.hg
@@ -58,7 +58,7 @@ public:
 
   /** vfunc to prepare the device to operate with the specified parameters.
    */
-  virtual bool prepare_vfunc(Gst::AudioRingBufferSpec& spec);
+  virtual bool prepare_audiosink_vfunc(Gst::AudioRingBufferSpec& spec);
 
   /** vfunc to undo operations done in prepare.
    */
@@ -85,9 +85,9 @@ public:
 protected:
 #m4begin
   _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
-  klass->prepare = &prepare_vfunc_callback;
+  klass->prepare = &prepare_audiosink_vfunc_callback;
   _SECTION(SECTION_PH_VFUNCS)
-  static gboolean prepare_vfunc_callback(GstAudioSink* self, GstAudioRingBufferSpec* spec);
+  static gboolean prepare_audiosink_vfunc_callback(GstAudioSink* self, GstAudioRingBufferSpec* spec);
   _POP()
 #m4end
 };
diff --git a/gstreamer/src/basesink.ccg b/gstreamer/src/basesink.ccg
index cb7284b..a3c36ec 100644
--- a/gstreamer/src/basesink.ccg
+++ b/gstreamer/src/basesink.ccg
@@ -19,8 +19,10 @@
 
 _PINCLUDE(gstreamermm/private/element_p.h)
 
+#define IGNORE_RESULT(x) { auto release_value = x; (void)release_value; }
+
 namespace Gst {
-  
+
 gboolean BaseSink_Class::query_vfunc_callback(GstBaseSink* self, GstQuery* query)
 {
   const auto obj_base = static_cast<Glib::ObjectBase*>(
@@ -39,9 +41,10 @@ gboolean BaseSink_Class::query_vfunc_callback(GstBaseSink* self, GstQuery* query
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
       {
         // Call the virtual member method, which derived classes might override.
-       auto qurery_wrapper = Glib::wrap(query, false);
+        auto qurery_wrapper = Glib::wrap(query, false);
         int retval = static_cast<int>(obj->base_sink_query_vfunc(qurery_wrapper));
-       qurery_wrapper.release();
+        IGNORE_RESULT(qurery_wrapper.release());
+        return retval;
       }
       catch(...)
       {
diff --git a/gstreamer/src/basesrc.ccg b/gstreamer/src/basesrc.ccg
index 06b198e..8e63c8a 100644
--- a/gstreamer/src/basesrc.ccg
+++ b/gstreamer/src/basesrc.ccg
@@ -22,6 +22,8 @@
 
 _PINCLUDE(gstreamermm/private/element_p.h)
 
+#define IGNORE_RESULT(x) { auto release_value = x; (void)release_value; }
+
 namespace Gst
 {
 
@@ -215,10 +217,10 @@ gboolean BaseSrc_Class::query_vfunc_callback(GstBaseSrc* self, GstQuery* query)
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
       {
         // Call the virtual member method, which derived classes might override.
-       auto query_cpp = Glib::wrap(query, false);
+        auto query_cpp = Glib::wrap(query, false);
         int ret = static_cast<int>(obj->base_src_query_vfunc(query_cpp));
-       query_cpp.release();
-       return ret;
+        IGNORE_RESULT(query_cpp.release());
+        return ret;
       }
       catch(...)
       {
diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg
index 570e4a4..14fc387 100644
--- a/gstreamer/src/basetransform.ccg
+++ b/gstreamer/src/basetransform.ccg
@@ -23,6 +23,8 @@
 
 _PINCLUDE(gstreamermm/private/element_p.h)
 
+#define IGNORE_RESULT(x) { auto release_value = x; (void)release_value; }
+
 namespace Gst
 {
 
@@ -245,7 +247,7 @@ gboolean BaseTransform_Class::query_vfunc_callback(GstBaseTransform* self, GstPa
         // Call the virtual member method, which derived classes might override.
         auto query_cpp = Glib::wrap(query, false);
         int ret = 
static_cast<int>(obj->base_transform_query_vfunc(static_cast<Gst::PadDirection>(direction), query_cpp));
-        query_cpp.release();
+        IGNORE_RESULT(query_cpp.release());
         return ret;
       }
       catch(...)
@@ -324,8 +326,8 @@ gboolean BaseTransform_Class::propose_allocation_vfunc_callback(GstBaseTransform
         auto query_cpp = Glib::wrap(query, false);
         auto decide_query_cpp = Glib::wrap(decide_query, false);
         auto ret = static_cast<int>(obj->propose_allocation_vfunc(decide_query_cpp, query_cpp));
-        query_cpp.release();
-        decide_query_cpp.release();
+        IGNORE_RESULT(query_cpp.release());
+        IGNORE_RESULT(decide_query_cpp.release());
         return ret;
       }
       catch(...)
@@ -383,7 +385,7 @@ gboolean BaseTransform_Class::decide_allocation_vfunc_callback(GstBaseTransform*
         // Call the virtual member method, which derived classes might override.
           auto query_cpp = Glib::wrap(query, false);
           auto ret = static_cast<int>(obj->decide_allocation_vfunc(query_cpp));
-          query_cpp.release();
+          IGNORE_RESULT(query_cpp.release());
           return ret;
       }
       catch(...)
diff --git a/gstreamer/src/context.hg b/gstreamer/src/context.hg
index 10e090c..226f119 100644
--- a/gstreamer/src/context.hg
+++ b/gstreamer/src/context.hg
@@ -63,7 +63,7 @@ class Context : public MiniObject
   _IGNORE(gst_context_ref, gst_context_unref)
 
 public:
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Context> create(const Glib::ustring& context_type, bool persistent), 
gst_context_new);
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Context> create(const Glib::ustring& context_type, bool persistent), 
gst_context_new)
 
   _WRAP_METHOD(Glib::RefPtr<Gst::Context> copy() const, gst_context_copy)
 
diff --git a/gstreamer/src/pad.hg b/gstreamer/src/pad.hg
index a4b814a..d1c17e5 100644
--- a/gstreamer/src/pad.hg
+++ b/gstreamer/src/pad.hg
@@ -37,7 +37,6 @@ class Event;
 class PadTemplate;
 class Query;
 class PadProbeInfo;
-enum EventType;
 
 //Gst::Iterator<> forward declaration.
 template <class CppType>
diff --git a/gstreamer/src/typefindfactory.hg b/gstreamer/src/typefindfactory.hg
index e3d44d4..5e0d28b 100644
--- a/gstreamer/src/typefindfactory.hg
+++ b/gstreamer/src/typefindfactory.hg
@@ -51,7 +51,7 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Gst::Caps> get_caps(), gst_type_find_factory_get_caps)
   _WRAP_METHOD(Glib::RefPtr<const Gst::Caps> get_caps() const, gst_type_find_factory_get_caps, constversion)
   _WRAP_METHOD(void call_slot(Gst::TypeFind& find), gst_type_find_factory_call_function)
-  _WRAP_METHOD(bool has_function() const, gst_type_find_factory_has_function);
+  _WRAP_METHOD(bool has_function() const, gst_type_find_factory_has_function)
 };
 
 } // namespace Gst
diff --git a/gstreamer/src/value.ccg b/gstreamer/src/value.ccg
index b3fda07..bfbf36a 100644
--- a/gstreamer/src/value.ccg
+++ b/gstreamer/src/value.ccg
@@ -108,7 +108,7 @@ Fraction& Fraction::operator=(const Fraction& src)
 template <>
 void Range<int>::init_range(const GValue& value)
 {
-  if(GST_VALUE_HOLDS_INT_RANGE(&value))
+  if(G_VALUE_HOLDS(&value, GST_TYPE_INT_RANGE))
   {
     min = gst_value_get_int_range_min(&value);
     max = gst_value_get_int_range_max(&value);
@@ -118,7 +118,7 @@ void Range<int>::init_range(const GValue& value)
 template <>
 void Range<double>::init_range(const GValue& value)
 {
-  if(GST_VALUE_HOLDS_DOUBLE_RANGE(&value))
+  if(G_VALUE_HOLDS(&value, GST_TYPE_DOUBLE_RANGE))
   {
     min = gst_value_get_double_range_min(&value);
     max = gst_value_get_double_range_max(&value);
@@ -128,7 +128,7 @@ void Range<double>::init_range(const GValue& value)
 template <>
 void Range<Gst::Fraction>::init_range(const GValue& value)
 {
-  if(GST_VALUE_HOLDS_FRACTION_RANGE(&value))
+  if(G_VALUE_HOLDS(&value, GST_TYPE_FRACTION_RANGE))
   {
     const GValue* min = gst_value_get_fraction_range_min(&value);
     const GValue* max = gst_value_get_fraction_range_max(&value);
diff --git a/gstreamer/src/videoinfo.hg b/gstreamer/src/videoinfo.hg
index 5519f3a..e23a333 100644
--- a/gstreamer/src/videoinfo.hg
+++ b/gstreamer/src/videoinfo.hg
@@ -70,7 +70,7 @@ public:
   _WRAP_METHOD(bool convert(Gst::Format src_format, gint64 src_value, Gst::Format dest_format, gint64& 
dest_value), gst_video_info_convert)
   _WRAP_METHOD(bool is_equal(const Gst::VideoInfo& other) const, gst_video_info_is_equal)
 
-  _MEMBER_GET(finfo, finfo, const VideoFormatInfo&, const GstVideoFormatInfo*)
+  _MEMBER_GET(finfo, finfo, const VideoFormatInfo, const GstVideoFormatInfo*)
   
   _MEMBER_GET(interlace_mode, interlace_mode, Gst::VideoInterlaceMode, GstVideoInterlaceMode)
   _MEMBER_SET(interlace_mode, interlace_mode, Gst::VideoInterlaceMode, GstVideoInterlaceMode)
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index fa296ed..350d3b6 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -349,7 +349,7 @@ _CONVERSION(`Gst::VideoInfo', `GstVideoInfo', `*($3.gobj())')
 _CONVERSION(`GstVideoInfo', `Gst::VideoInfo', `Gst::VideoInfo(Gst::VideoInfo(const_cast<GstVideoInfo*>(&$3), 
false))')
 
 dnl VideoFormatInfo
-_CONVERSION(`const GstVideoFormatInfo*', `const VideoFormatInfo&', `VideoFormatInfo($3)')
+_CONVERSION(`const GstVideoFormatInfo*', `const VideoFormatInfo', `VideoFormatInfo($3)')
 
 dnl VideoFrame
 _CONVERSION(`const Gst::VideoFrame&', `GstVideoFrame*', `$3.gobj()')


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