[aravis] viewer: check for gstreamer plugins at application launch.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] viewer: check for gstreamer plugins at application launch.
- Date: Sun, 3 Nov 2013 09:04:21 +0000 (UTC)
commit 6f33fe89d354d367467a768b4576f6cf50806498
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sun Nov 3 10:02:29 2013 +0100
viewer: check for gstreamer plugins at application launch.
viewer/arvviewer.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/viewer/arvviewer.c b/viewer/arvviewer.c
index 2bb52bc..81efc80 100644
--- a/viewer/arvviewer.c
+++ b/viewer/arvviewer.c
@@ -833,6 +833,42 @@ static const GOptionEntry arv_viewer_option_entries[] =
{ NULL }
};
+static gboolean
+_gstreamer_plugin_check (void)
+{
+ GstRegistry *registry;
+ unsigned int i;
+ gboolean success = TRUE;
+
+ static char *plugins[] = {
+ "appsrc",
+ "ffmpegcolorspace",
+ "videoflip",
+ "autovideosink",
+ "bayer2rgb"
+ };
+
+ registry = gst_registry_get_default ();
+
+ for (i = 0; i < G_N_ELEMENTS (plugins); i++) {
+ GstPluginFeature *feature;
+
+ feature = gst_registry_lookup_feature (registry, plugins[i]);
+ if (!GST_IS_PLUGIN_FEATURE (feature)) {
+ g_print ("Gstreamer plugin '%s' is missing.\n", plugins[i]);
+ success = FALSE;
+ }
+ else
+
+ g_object_unref (feature);
+ }
+
+ if (!success)
+ g_print ("Check your gstreamer installation.\n");
+
+ return success;
+}
+
int
main (int argc,char *argv[])
{
@@ -862,6 +898,12 @@ main (int argc,char *argv[])
gtk_init (&argc, &argv);
gst_init (&argc, &argv);
+ if (!_gstreamer_plugin_check ()) {
+ arv_shutdown ();
+
+ return EXIT_FAILURE;
+ }
+
arv_debug_enable (arv_viewer_option_debug_domains);
arv_enable_interface ("Fake");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]