[gstreamermm: 142/167] minor fixes, noted by Mr Cumming



commit 68202f82722012209cb45c5c63225f5500c4b5b8
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Tue Aug 6 15:00:06 2013 +0200

    minor fixes, noted by Mr Cumming

 gstreamer/src/audioformat.ccg |    4 +++
 gstreamer/src/audioformat.hg  |    2 +-
 gstreamer/src/audioinfo.ccg   |   27 +++++++++++++++++++
 gstreamer/src/audioinfo.hg    |    2 +-
 gstreamer/src/message.ccg     |   57 ++++++++++++++++++++---------------------
 gstreamer/src/message.hg      |   22 ++++++---------
 gstreamer/src/query.hg        |   32 +++++++++++-----------
 tests/test-caps.cc            |    2 +-
 8 files changed, 87 insertions(+), 61 deletions(-)
---
diff --git a/gstreamer/src/audioformat.ccg b/gstreamer/src/audioformat.ccg
index 467294e..b2e8ec0 100644
--- a/gstreamer/src/audioformat.ccg
+++ b/gstreamer/src/audioformat.ccg
@@ -22,4 +22,8 @@
 namespace Gst
 {
 
+AudioFormatInfo::~AudioFormatInfo()
+{
+}
+
 }
diff --git a/gstreamer/src/audioformat.hg b/gstreamer/src/audioformat.hg
index b46c6fc..bd4d872 100644
--- a/gstreamer/src/audioformat.hg
+++ b/gstreamer/src/audioformat.hg
@@ -37,7 +37,7 @@ public:
     /**
      * Defualt constructor.
      */
-  virtual ~AudioFormatInfo() {}
+  virtual ~AudioFormatInfo();
 
   /// Gets the underlying gobject.
   GstAudioFormatInfo* gobj() { return m_info; };
diff --git a/gstreamer/src/audioinfo.ccg b/gstreamer/src/audioinfo.ccg
index e69de29..753fe29 100644
--- a/gstreamer/src/audioinfo.ccg
+++ b/gstreamer/src/audioinfo.ccg
@@ -0,0 +1,27 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008-2009 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+namespace Gst
+{
+
+AudioInfo::~AudioInfo()
+{
+}
+
+}
diff --git a/gstreamer/src/audioinfo.hg b/gstreamer/src/audioinfo.hg
index 6ed7d27..0220fd6 100644
--- a/gstreamer/src/audioinfo.hg
+++ b/gstreamer/src/audioinfo.hg
@@ -38,7 +38,7 @@ public:
     AudioInfo(const GstAudioInfo& info){}
 
 
-  virtual ~AudioInfo(){}
+  virtual ~AudioInfo();
 
   /// Gets the underlying gobject.
   GstAudioInfo* gobj() { return m_info; };
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index 51af9c0..2011d94 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -52,7 +52,7 @@ Glib::RefPtr<Gst::MessageEos>
   MessageEos::create(const Glib::RefPtr<Gst::Object>& src)
 {
   GstMessage* message = gst_message_new_eos(Glib::unwrap(src));
-  return Glib::wrap_msg_derived<Gst::MessageEos>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageEos>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageError>
@@ -61,7 +61,7 @@ Glib::RefPtr<Gst::MessageError>
 {
   GstMessage* message = gst_message_new_error(Glib::unwrap(src), error.gobj(),
     reinterpret_cast<const gchar*>(debug.c_str()));
-  return Glib::wrap_msg_derived<Gst::MessageError>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageError>(message, true);
 }
 
 void MessageError::parse(Glib::Error& error, std::string& debug) const
@@ -109,7 +109,7 @@ Glib::RefPtr<Gst::MessageWarning>
 {
   GstMessage* message = gst_message_new_warning(Glib::unwrap(src),
     error.gobj(), reinterpret_cast<const gchar*>(debug.c_str()));
-  return Glib::wrap_msg_derived<Gst::MessageWarning>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageWarning>(message, true);
 }
 
 void MessageWarning::parse(Glib::Error& error, std::string& debug) const
@@ -158,7 +158,7 @@ Glib::RefPtr<Gst::MessageInfo>
 {
   GstMessage* message = gst_message_new_info(Glib::unwrap(src), error.gobj(),
     reinterpret_cast<const gchar*>(debug.c_str()));
-  return Glib::wrap_msg_derived<Gst::MessageInfo>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageInfo>(message, true);
 }
 
 
@@ -204,10 +204,9 @@ std::string MessageInfo::parse_debug() const
 Glib::RefPtr<Gst::MessageTag>
   MessageTag::create(const Glib::RefPtr<Gst::Object>& src, const Gst::TagList& taglist)
 {
-  //We create a copy because gst_message_new_tag() takes ownership:
   GstTagList* c_taglist = gst_tag_list_copy(taglist.gobj());
   GstMessage* message = gst_message_new_tag(Glib::unwrap(src), c_taglist);
-  return Glib::wrap_msg_derived<Gst::MessageTag>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageTag>(message, true);
 }
 
 void MessageTag::parse(Gst::TagList& tag_list)
@@ -232,7 +231,7 @@ Glib::RefPtr<Gst::MessageBuffering>
   MessageBuffering::create(const Glib::RefPtr<Gst::Object>& src, int percent)
 {
   GstMessage* message = gst_message_new_buffering(Glib::unwrap(src), percent);
-  return Glib::wrap_msg_derived<Gst::MessageBuffering>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageBuffering>(message, true);
 }
 
 int MessageBuffering::parse() const
@@ -300,7 +299,7 @@ Glib::RefPtr<Gst::MessageStateChanged>
   GstMessage* message = gst_message_new_state_changed(Glib::unwrap(src),
     static_cast<GstState>(oldstate), static_cast<GstState>(newstate),
     static_cast<GstState>(pending));
-  return Glib::wrap_msg_derived<Gst::MessageStateChanged>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStateChanged>(message, true);
 }
 
 void MessageStateChanged::parse(State& oldstate, State& newstate,
@@ -342,7 +341,7 @@ Glib::RefPtr<Gst::MessageStateDirty>
   MessageStateDirty::create(const Glib::RefPtr<Gst::Object>& src)
 {
   GstMessage* message = gst_message_new_state_dirty(Glib::unwrap(src));
-  return Glib::wrap_msg_derived<Gst::MessageStateDirty>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStateDirty>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageStepDone>
@@ -353,7 +352,7 @@ Glib::RefPtr<Gst::MessageStepDone>
   GstMessage* message = gst_message_new_step_done(Glib::unwrap(src),
     static_cast<GstFormat>(format), amount, rate, flush, intermediate,
     duration, eos);
-  return Glib::wrap_msg_derived<Gst::MessageStepDone>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStepDone>(message, true);
 }
 
 void MessageStepDone::parse(Gst::Format& format, guint64& amount, double& rate,
@@ -434,7 +433,7 @@ Glib::RefPtr<Gst::MessageClockProvide>
 {
   GstMessage* message = gst_message_new_clock_provide(Glib::unwrap(src),
     Glib::unwrap(clock), ready);
-  return Glib::wrap_msg_derived<Gst::MessageClockProvide>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageClockProvide>(message, true);
 }
 
 void MessageClockProvide::parse(Glib::RefPtr<Gst::Clock>& clock, bool& ready) const
@@ -473,7 +472,7 @@ Glib::RefPtr<Gst::MessageClockLost>
 {
   GstMessage* message = gst_message_new_clock_lost(Glib::unwrap(src),
     Glib::unwrap(clock));
-  return Glib::wrap_msg_derived<Gst::MessageClockLost>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageClockLost>(message, true);
 }
 
 Glib::RefPtr<Gst::Clock> MessageClockLost::parse()
@@ -494,7 +493,7 @@ Glib::RefPtr<Gst::MessageNewClock>
 {
   GstMessage* message = gst_message_new_new_clock(Glib::unwrap(src),
     Glib::unwrap(clock));
-  return Glib::wrap_msg_derived<Gst::MessageNewClock>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageNewClock>(message, true);
 }
 
 Glib::RefPtr<Gst::Clock> MessageNewClock::parse()
@@ -516,14 +515,14 @@ Glib::RefPtr<Gst::MessageApplication>
   GstStructure* copy_struct = gst_structure_copy(structure.gobj());
   GstMessage* message = gst_message_new_application(Glib::unwrap(src),
     copy_struct);
-  return Glib::wrap_msg_derived<Gst::MessageApplication>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageApplication>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageApplication>
   MessageApplication::create(const Glib::RefPtr<Gst::Object>& src)
 {
   GstMessage* message = gst_message_new_application(Glib::unwrap(src), 0);
-  return Glib::wrap_msg_derived<Gst::MessageApplication>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageApplication>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageElement>
@@ -533,14 +532,14 @@ Glib::RefPtr<Gst::MessageElement>
   GstStructure* copy_struct = gst_structure_copy(structure.gobj());
   GstMessage* message = gst_message_new_element(Glib::unwrap(src),
     copy_struct);
-  return Glib::wrap_msg_derived<Gst::MessageElement>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageElement>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageElement>
   MessageElement::create(const Glib::RefPtr<Gst::Object>& src)
 {
   GstMessage* message = gst_message_new_element(Glib::unwrap(src), 0);
-  return Glib::wrap_msg_derived<Gst::MessageElement>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageElement>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageCustom>
@@ -550,7 +549,7 @@ Glib::RefPtr<Gst::MessageCustom>
   GstStructure* copy_struct = gst_structure_copy(structure.gobj());
   GstMessage* message = gst_message_new_custom(GstMessageType(type),
     Glib::unwrap(src), copy_struct);
-  return Glib::wrap_msg_derived<Gst::MessageCustom>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageCustom>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageCustom>
@@ -558,7 +557,7 @@ Glib::RefPtr<Gst::MessageCustom>
 {
   GstMessage* message = gst_message_new_custom(GstMessageType(type),
     Glib::unwrap(src), 0);
-  return Glib::wrap_msg_derived<Gst::MessageCustom>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageCustom>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageSegmentStart>
@@ -567,7 +566,7 @@ Glib::RefPtr<Gst::MessageSegmentStart>
 {
   GstMessage* message = gst_message_new_segment_start(Glib::unwrap(src),
     static_cast<GstFormat>(format), position);
-  return Glib::wrap_msg_derived<Gst::MessageSegmentStart>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageSegmentStart>(message, true);
 }
 
 void MessageSegmentStart::parse(Format& format, gint64& position) const
@@ -598,7 +597,7 @@ Glib::RefPtr<Gst::MessageSegmentDone>
 {
   GstMessage* message = gst_message_new_segment_done(Glib::unwrap(src),
     static_cast<GstFormat>(format), position);
-  return Glib::wrap_msg_derived<Gst::MessageSegmentDone>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageSegmentDone>(message, true);
 }
 
 void MessageSegmentDone::parse(Format& format, gint64& position) const
@@ -629,7 +628,7 @@ Glib::RefPtr<Gst::MessageDuration>
 {
   GstMessage* message = gst_message_new_duration(Glib::unwrap(src),
     static_cast<GstFormat>(format), duration);
-  return Glib::wrap_msg_derived<Gst::MessageDuration>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageDuration>(message, true);
 }
 
 void MessageDuration::parse(Format& format, gint64& duration) const
@@ -657,7 +656,7 @@ Glib::RefPtr<Gst::MessageLatency>
   MessageLatency::create(const Glib::RefPtr<Gst::Object>& src)
 {
   GstMessage* message = gst_message_new_latency(Glib::unwrap(src));
-  return Glib::wrap_msg_derived<Gst::MessageLatency>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageLatency>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageAsyncStart>
@@ -665,14 +664,14 @@ Glib::RefPtr<Gst::MessageAsyncStart>
   bool new_base_time)
 {
   GstMessage* message = gst_message_new_async_start(Glib::unwrap(src));
-  return Glib::wrap_msg_derived<Gst::MessageAsyncStart>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageAsyncStart>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageAsyncDone>
   MessageAsyncDone::create(const Glib::RefPtr<Gst::Object>& src, ClockTime running_time)
 {
   GstMessage* message = gst_message_new_async_done(Glib::unwrap(src), running_time);
-  return Glib::wrap_msg_derived<Gst::MessageAsyncDone>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageAsyncDone>(message, true);
 }
 
 Glib::RefPtr<Gst::MessageStepStart>
@@ -682,7 +681,7 @@ Glib::RefPtr<Gst::MessageStepStart>
 {
   GstMessage* message = gst_message_new_step_start(Glib::unwrap(src),
     active, static_cast<GstFormat>(format), amount, rate, flush, intermediate);
-  return Glib::wrap_msg_derived<Gst::MessageStepStart>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStepStart>(message, true);
 }
 
 void MessageStepStart::parse(bool& active, Gst::Format& format,
@@ -756,7 +755,7 @@ Glib::RefPtr<Gst::MessageStructureChange>
 {
   GstMessage* message = gst_message_new_structure_change(Glib::unwrap(src),
     static_cast<GstStructureChangeType>(type), Glib::unwrap(owner), busy);
-  return Glib::wrap_msg_derived<Gst::MessageStructureChange>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStructureChange>(message, true);
 }
 
 void MessageStructureChange::parse(Gst::StructureChangeType& type,
@@ -800,7 +799,7 @@ Glib::RefPtr<Gst::MessageRequestState>
 {
   GstMessage* message = gst_message_new_request_state(Glib::unwrap(src),
     static_cast<GstState>(state));
-  return Glib::wrap_msg_derived<Gst::MessageRequestState>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageRequestState>(message, true);
 }
 
 Gst::State MessageRequestState::parse() const
@@ -817,7 +816,7 @@ Glib::RefPtr<Gst::MessageStreamStatus>
 {
   GstMessage* message = gst_message_new_stream_status(Glib::unwrap(src),
     static_cast<GstStreamStatusType>(type), Glib::unwrap(owner));
-  return Glib::wrap_msg_derived<Gst::MessageStreamStatus>(message, true);
+  return Gst::wrap_msg_derived<Gst::MessageStreamStatus>(message, true);
 }
 
 void MessageStreamStatus::set_object(const Glib::RefPtr<Gst::Object>& object)
diff --git a/gstreamer/src/message.hg b/gstreamer/src/message.hg
index 5157737..30445bf 100644
--- a/gstreamer/src/message.hg
+++ b/gstreamer/src/message.hg
@@ -25,22 +25,18 @@
 
 _DEFS(gstreamermm,gst)
 
-namespace Glib
+namespace Gst
 {
-    template<typename T>
-    Glib::RefPtr<T> wrap_msg_derived(GstMessage* object, bool take_copy)
-    {
-      if(take_copy && object)
-        gst_message_ref(object);
-
-      // See the comment at the top of this file, if you want to know why the cast works.
-      return Glib::RefPtr<T>(reinterpret_cast<T*>(object));
-    }
 
-}
+  template<typename T>
+  Glib::RefPtr<T> wrap_msg_derived(GstMessage* object, bool take_copy)
+  {
+    if(take_copy && object)
+      gst_message_ref(object);
 
-namespace Gst
-{
+    // See the comment at the top of this file, if you want to know why the cast works.
+    return Glib::RefPtr<T>(reinterpret_cast<T*>(object));
+  }
 
 _WRAP_ENUM(MessageType, GstMessageType)
 _WRAP_ENUM(StructureChangeType, GstStructureChangeType)
diff --git a/gstreamer/src/query.hg b/gstreamer/src/query.hg
index 319b0b7..efb2323 100644
--- a/gstreamer/src/query.hg
+++ b/gstreamer/src/query.hg
@@ -110,37 +110,37 @@ public:
 #m4 _CONVERSION(`const GstStructure*',`Gst::Structure',`Glib::wrap(const_cast<GstStructure*>($3), true)')
    _WRAP_METHOD(Gst::Structure get_structure() const, gst_query_get_structure)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_buffering(Gst::Format format), gst_query_new_buffering)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_buffering(Gst::Format format), gst_query_new_buffering)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_allocation(Glib::RefPtr<Gst::Caps> caps, bool need_pool), 
gst_query_new_allocation)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_allocation(Glib::RefPtr<Gst::Caps> caps, bool 
need_pool), gst_query_new_allocation)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_uri(), gst_query_new_uri)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_uri(), gst_query_new_uri)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_scheduling(), gst_query_new_scheduling)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_scheduling(), gst_query_new_scheduling)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_drain(), gst_query_new_drain)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_drain(), gst_query_new_drain)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_context(), gst_query_new_context)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_context(), gst_query_new_context)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_custom(Gst::QueryType type, Glib::RefPtr<Gst::Structure> 
structure), gst_query_new_custom)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_custom(Gst::QueryType type, 
Glib::RefPtr<Gst::Structure> structure), gst_query_new_custom)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_convert(Gst::Format format, gint64 value, Gst::Format 
dest_format), gst_query_new_convert)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_convert(Gst::Format format, gint64 value, Gst::Format 
dest_format), gst_query_new_convert)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_position(Gst::Format format), gst_query_new_position)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_position(Gst::Format format), gst_query_new_position)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_duration(Gst::Format format), gst_query_new_duration)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_duration(Gst::Format format), gst_query_new_duration)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_latency(), gst_query_new_latency)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_latency(), gst_query_new_latency)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_seeking(Gst::Format format), gst_query_new_seeking)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_seeking(Gst::Format format), gst_query_new_seeking)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_formats(), gst_query_new_formats)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_formats(), gst_query_new_formats)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_segment(Gst::Format format), gst_query_new_segment)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_segment(Gst::Format format), gst_query_new_segment)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_caps(Glib::RefPtr<Gst::Caps> filter), gst_query_new_caps)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_caps(Glib::RefPtr<Gst::Caps> filter), 
gst_query_new_caps)
 
-  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> new_accept_caps(Glib::RefPtr<Gst::Caps> filter), 
gst_query_new_accept_caps)
+  _WRAP_METHOD(static Glib::RefPtr<Gst::Query> create_accept_caps(Glib::RefPtr<Gst::Caps> filter), 
gst_query_new_accept_caps)
 
   /** Get the Gst::QueryType of the query.
    */
diff --git a/tests/test-caps.cc b/tests/test-caps.cc
index 505f4f1..9197a6d 100644
--- a/tests/test-caps.cc
+++ b/tests/test-caps.cc
@@ -104,7 +104,7 @@ TEST_F(CapsTest, SetCapsToElement)
 {
     Glib::RefPtr<Element> element = ElementFactory::create_element("multifilesrc", "source");
 
-    gchar* str_caps = "image/jpeg, framerate=(fraction)2/1";
+    const char* str_caps = "image/jpeg, framerate=(fraction)2/1";
 
     element->set_property("caps", Caps::create_from_string(str_caps));
     element->get_property("caps", caps);


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