[gstreamermm] Gst::Message: fixed MessageApplication's methods



commit 50e020be0d57e2e01ad136b3c036e152c675dcd7
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Tue Feb 24 20:31:23 2015 +0100

    Gst::Message: fixed MessageApplication's methods
    
        * gstreamer/src/message.{ccg|hg}: structure cannot be null pointer in
          a message application, so one-argument factory method is not
          necessary. Two-parameters method should acquire const-reference,
          because object is not modified anyway.
        * tests/regression/test-regression-seekonstartup.cc: fixed testcase
          according to a new interface.
        * tools/m4/convert_gst.m4: additional conversion for structure added.

 gstreamer/src/message.ccg                         |    9 +--------
 gstreamer/src/message.hg                          |   12 +-----------
 tests/regression/test-regression-seekonstartup.cc |    2 +-
 tools/m4/convert_gst.m4                           |    2 ++
 4 files changed, 5 insertions(+), 20 deletions(-)
---
diff --git a/gstreamer/src/message.ccg b/gstreamer/src/message.ccg
index aea1599..630cfcb 100644
--- a/gstreamer/src/message.ccg
+++ b/gstreamer/src/message.ccg
@@ -510,7 +510,7 @@ Glib::RefPtr<const Gst::Clock> MessageNewClock::parse() const
 
 Glib::RefPtr<Gst::MessageApplication>
   MessageApplication::create(const Glib::RefPtr<Gst::Object>& src,
-  Gst::Structure& structure)
+  const Gst::Structure& structure)
 {
   GstStructure* copy_struct = gst_structure_copy(structure.gobj());
   GstMessage* message = gst_message_new_application(Glib::unwrap(src),
@@ -518,13 +518,6 @@ Glib::RefPtr<Gst::MessageApplication>
   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 Gst::wrap_msg_derived<Gst::MessageApplication>(message, true);
-}
-
 Glib::RefPtr<Gst::MessageElement>
   MessageElement::create(const Glib::RefPtr<Gst::Object>& src,
   Gst::Structure& structure)
diff --git a/gstreamer/src/message.hg b/gstreamer/src/message.hg
index d862e9e..fe5b17c 100644
--- a/gstreamer/src/message.hg
+++ b/gstreamer/src/message.hg
@@ -719,17 +719,7 @@ public:
    * @return The new application message. MT safe.
    */
   static Glib::RefPtr<Gst::MessageApplication>
-    create(const Glib::RefPtr<Gst::Object>& src, Gst::Structure& structure);
-
-  /** Create a new application-typed message (no Gst::Structure is needed).
-   * GStreamer will never create these messages; they are a gift from us to
-   * you. Enjoy.
-   *
-   * @param src The object originating the message.
-   * @return The new application message. MT safe.
-   */
-  static Glib::RefPtr<Gst::MessageApplication>
-    create(const Glib::RefPtr<Gst::Object>& src);
+    create(const Glib::RefPtr<Gst::Object>& src, const Gst::Structure& structure);
 };
 
 /** An element specific message.
diff --git a/tests/regression/test-regression-seekonstartup.cc 
b/tests/regression/test-regression-seekonstartup.cc
index 8477355..4dc17e5 100644
--- a/tests/regression/test-regression-seekonstartup.cc
+++ b/tests/regression/test-regression-seekonstartup.cc
@@ -46,7 +46,7 @@ void dec_counter()
     if (g_atomic_int_dec_and_test (&counter))
     {
         prerolled = true;
-        bus->post(MessageApplication::create(pipeline));
+        bus->post(MessageApplication::create(pipeline, Structure("empty")));
     }
 }
 
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 01eaa66..2eff1b3 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -245,6 +245,8 @@ dnl Structure
 _CONVERSION(`Gst::Structure&',`GstStructure*',`$3.gobj()')
 _CONVERSION(`const Gst::Structure&',`GstStructure*',`const_cast<GstStructure*>($3.gobj())') 
 _CONVERSION(`GstStructure*', `Gst::Structure', `Glib::wrap($3)')
+_CONVERSION(`const Gst::Structure&',`const GstStructure*',`$3.gobj()')
+_CONVERSION(`const GstStructure*',`Gst::Structure', `Glib::wrap($3, false)')
 
 dnl TagList
 _CONVERSION(`const Gst::TagList&',`const GstTagList*',`$3.gobj()')


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