diff options
author | Diane Trout <diane@ghic.org> | 2014-01-12 16:09:19 -0800 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2014-04-27 18:23:34 +0200 |
commit | db43dd0fa1e1a55afb690adc4f56389d3f75fb04 (patch) | |
tree | fc794ed1fa66820f407e3ccafc78c017743e2db0 /elements | |
parent | 068d125c11f4a1c44749bdd80cb7edcd33973276 (diff) |
elements/gstqtvideosink/gstqtvideosinkplugin.cpp add error handling to plugin registration.
The GStreamer plugin examples returned FALSE when their plugins failed
initalization. We should as well.
Diffstat (limited to 'elements')
-rw-r--r-- | elements/gstqtvideosink/gstqtvideosinkplugin.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/elements/gstqtvideosink/gstqtvideosinkplugin.cpp b/elements/gstqtvideosink/gstqtvideosinkplugin.cpp index 6b2e3e5..b960e43 100644 --- a/elements/gstqtvideosink/gstqtvideosinkplugin.cpp +++ b/elements/gstqtvideosink/gstqtvideosinkplugin.cpp @@ -32,18 +32,30 @@ static gboolean plugin_init(GstPlugin *plugin) GST_DEBUG_CATEGORY_INIT(gst_qt_video_sink_debug, QTVIDEOSINK_NAME, 0, "Debug category for GstQtVideoSink"); - gst_element_register(plugin, QTVIDEOSINK_NAME, - GST_RANK_NONE, GST_TYPE_QT_VIDEO_SINK); + if(!gst_element_register(plugin, QTVIDEOSINK_NAME, + GST_RANK_NONE, GST_TYPE_QT_VIDEO_SINK)) { + GST_ERROR("Failed to register " QTVIDEOSINK_NAME); + return FALSE; + } #ifndef GST_QT_VIDEO_SINK_NO_OPENGL - gst_element_register(plugin, QTGLVIDEOSINK_NAME, - GST_RANK_NONE, GST_TYPE_QT_GL_VIDEO_SINK); + if(!gst_element_register(plugin, QTGLVIDEOSINK_NAME, + GST_RANK_NONE, GST_TYPE_QT_GL_VIDEO_SINK)) { + GST_ERROR("Failed to register " QTGLVIDEOSINK_NAME); + return FALSE; + } #endif - gst_element_register(plugin, QWIDGETVIDEOSINK_NAME, - GST_RANK_NONE, GST_TYPE_QWIDGET_VIDEO_SINK); + if(!gst_element_register(plugin, QWIDGETVIDEOSINK_NAME, + GST_RANK_NONE, GST_TYPE_QWIDGET_VIDEO_SINK)) { + GST_ERROR("Failed to register " QWIDGETVIDEOSINK_NAME); + return FALSE; + } #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - gst_element_register(plugin, "qtquick2videosink", - GST_RANK_NONE, GST_TYPE_QT_QUICK2_VIDEO_SINK); + if (!gst_element_register(plugin, "qtquick2videosink", + GST_RANK_NONE, GST_TYPE_QT_QUICK2_VIDEO_SINK)) { + GST_ERROR("Failed to register qtquick2videosink"); + return FALSE; + } #endif return TRUE; |