本文整理汇总了C++中qgst::ElementPtr::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ ElementPtr::isNull方法的具体用法?C++ ElementPtr::isNull怎么用?C++ ElementPtr::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgst::ElementPtr
的用法示例。
在下文中一共展示了ElementPtr::isNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeTest
void UriHandlerTest::makeTest()
{
QVERIFY(QGst::UriHandler::protocolIsSupported(QGst::UriSrc, "file"));
QGst::ElementPtr e = QGst::UriHandler::makeFromUri(QGst::UriSrc, QUrl::fromLocalFile("/bin/sh"));
QVERIFY(!e.isNull());
QGst::UriHandlerPtr u = e.dynamicCast<QGst::UriHandler>();
QVERIFY(!u.isNull());
QCOMPARE(u->uri(), QUrl::fromLocalFile("/bin/sh"));
}
示例2: cppWrappersTest
void RefPointerTest::cppWrappersTest()
{
QGst::ElementPtr e = QGst::ElementFactory::make("playbin");
QVERIFY(!e.isNull());
{
QGst::PipelinePtr pipeline = e.dynamicCast<QGst::Pipeline>();
QVERIFY(!pipeline.isNull());
//the C++ wrappers must be the same
QCOMPARE(static_cast<QGlib::RefCountedObject*>(pipeline.operator->()),
static_cast<QGlib::RefCountedObject*>(e.operator->()));
}
{
QGst::ChildProxyPtr proxy = e.dynamicCast<QGst::ChildProxy>();
QVERIFY(!proxy.isNull());
//the C++ wrappers must be the same
QCOMPARE(static_cast<QGlib::RefCountedObject*>(proxy.operator->()),
static_cast<QGlib::RefCountedObject*>(e.operator->()));
}
{ //new wrap() should give the same C++ instance
GstElement *gobj = e;
QGst::ElementPtr e2 = QGst::ElementPtr::wrap(gobj);
QCOMPARE(static_cast<QGlib::RefCountedObject*>(e2.operator->()),
static_cast<QGlib::RefCountedObject*>(e.operator->()));
}
{
QGst::StreamVolumePtr sv = e.dynamicCast<QGst::StreamVolume>();
QVERIFY(!sv.isNull());
//now the C++ wrapper must not be the same, since Pipeline does not inherit StreamVolume
QVERIFY(static_cast<QGlib::RefCountedObject*>(sv.operator->())
!= static_cast<QGlib::RefCountedObject*>(e.operator->()));
}
{
QGst::MessagePtr msg = QGst::ApplicationMessage::create(e);
QGst::MessagePtr msg2 = msg;
QCOMPARE(static_cast<QGlib::RefCountedObject*>(msg.operator->()),
static_cast<QGlib::RefCountedObject*>(msg2.operator->()));
QVERIFY(msg2 == msg);
QGst::MessagePtr msg3 = QGst::MessagePtr::wrap(msg2);
QVERIFY(static_cast<QGlib::RefCountedObject*>(msg3.operator->())
!= static_cast<QGlib::RefCountedObject*>(msg2.operator->()));
QVERIFY(msg3 == msg2);
}
}