diff options
author | Diane Trout <diane@ghic.org> | 2015-03-21 13:08:29 -0700 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-11-01 20:52:17 +0200 |
commit | 0384481b2f670b3db1a147a1ac0c5ea24c66554e (patch) | |
tree | 3c6468cac9309731fae549c1e6d6781d443f5d93 | |
parent | fc159e5c4c8ffeabdc7319514c6bb19c9c9e1d3b (diff) |
gst_message_new_application fails when passed a NULL structure
QGst provided a default null structure argument ApplicationMessagePtr::create
gst_message_new_application then failed with the error:
GStreamer-CRITICAL **: gst_message_new_application: assertion 'structure != NULL' failed
This defines a meaningless structure for the refpointer test and removes
the default to make sure a structure is provided.
https://bugzilla.gnome.org/show_bug.cgi?id=746584
-rw-r--r-- | src/QGst/message.h | 4 | ||||
-rw-r--r-- | tests/auto/refpointertest.cpp | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/QGst/message.h b/src/QGst/message.h index 04f4984..2d66ba1 100644 --- a/src/QGst/message.h +++ b/src/QGst/message.h @@ -205,7 +205,7 @@ class QTGSTREAMER_EXPORT ApplicationMessage : public Message QGST_WRAPPER_FAKE_SUBCLASS(Application, Message) public: static ApplicationMessagePtr create(const ObjectPtr & source, - const Structure & structure = Structure()); + const Structure & structure); }; /*! \headerfile message.h <QGst/Message> @@ -216,7 +216,7 @@ class QTGSTREAMER_EXPORT ElementMessage : public Message QGST_WRAPPER_FAKE_SUBCLASS(Element, Message) public: static ElementMessagePtr create(const ObjectPtr & source, - const Structure & structure = Structure()); + const Structure & structure); }; //maybe do: SEGMENT_START (internal) diff --git a/tests/auto/refpointertest.cpp b/tests/auto/refpointertest.cpp index 9a21e03..3bbca6b 100644 --- a/tests/auto/refpointertest.cpp +++ b/tests/auto/refpointertest.cpp @@ -171,7 +171,10 @@ void RefPointerTest::cppWrappersTest() } { - QGst::MessagePtr msg = QGst::ApplicationMessage::create(e); + QGst::Structure s("mystruct"); + s.setValue("days", 365); + QGst::MessagePtr msg = QGst::ApplicationMessage::create(e, s); + QVERIFY(!msg.isNull()); QGst::MessagePtr msg2 = msg; QCOMPARE(static_cast<QGlib::RefCountedObject*>(msg.operator->()), static_cast<QGlib::RefCountedObject*>(msg2.operator->())); @@ -199,8 +202,10 @@ void RefPointerTest::cppWrappersTest() void RefPointerTest::messageDynamicCastTest() { + QGst::Structure s("mystruct"); + s.setValue("frequency", 123456); QGst::BinPtr bin = QGst::Bin::create(); - QGst::MessagePtr msg = QGst::ApplicationMessage::create(bin); + QGst::MessagePtr msg = QGst::ApplicationMessage::create(bin, s); QVERIFY(!msg.isNull()); QVERIFY(!msg.dynamicCast<QGst::ApplicationMessage>().isNull()); QVERIFY(msg.dynamicCast<QGst::EosMessage>().isNull()); |