summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/modules/gstreamer
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2011-11-10 11:35:49 +0000
committerCedric BAIL <cedric.bail@free.fr>2011-11-10 11:35:49 +0000
commitde109574ed53c1e2c23d4fc6dd2f7a117eb41649 (patch)
tree9ff7b7bf68e2dbe287ef069bc624a82dcec26687 /legacy/emotion/src/modules/gstreamer
parent37efd502fe75883ebb03520ff8761787167343d8 (diff)
emotion: and now support custom pipeline in emotion.
SVN revision: 65018
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_sink.c45
1 files changed, 37 insertions, 8 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_sink.c b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
index ae4b27ec63..5f7312c192 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_sink.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_sink.c
@@ -938,6 +938,7 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
938 GstPad *pad; 938 GstPad *pad;
939 GstPad *teepad; 939 GstPad *teepad;
940 int flags; 940 int flags;
941 const char *launch;
941#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H 942#if defined HAVE_ECORE_X && defined HAVE_XOVERLAY_H
942 const char *engine; 943 const char *engine;
943 Eina_List *engines; 944 Eina_List *engines;
@@ -953,11 +954,32 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
953 if (!uri) 954 if (!uri)
954 return NULL; 955 return NULL;
955 956
956 playbin = gst_element_factory_make("playbin2", "playbin"); 957 launch = emotion_webcam_custom_get(uri);
957 if (!playbin) 958 if (launch)
958 { 959 {
959 ERR("Unable to create 'playbin' GstElement."); 960 GError *error = NULL;
960 return NULL; 961
962 playbin = gst_parse_bin_from_description(launch, 1, &error);
963 if (!playbin)
964 {
965 ERR("Unable to setup command : '%s' got error '%s'.", launch, error->message);
966 g_error_free(error);
967 return NULL;
968 }
969 if (error)
970 {
971 WRN("got recoverable error '%s' for command : '%s'.", error->message, launch);
972 g_error_free(error);
973 }
974 }
975 else
976 {
977 playbin = gst_element_factory_make("playbin2", "playbin");
978 if (!playbin)
979 {
980 ERR("Unable to create 'playbin' GstElement.");
981 return NULL;
982 }
961 } 983 }
962 984
963 bin = gst_bin_new(NULL); 985 bin = gst_bin_new(NULL);
@@ -1111,10 +1133,17 @@ gstreamer_video_sink_new(Emotion_Gstreamer_Video *ev,
1111#define GST_PLAY_FLAG_AUDIO (1 << 1) 1133#define GST_PLAY_FLAG_AUDIO (1 << 1)
1112#define GST_PLAY_FLAG_NATIVE_AUDIO (1 << 5) 1134#define GST_PLAY_FLAG_NATIVE_AUDIO (1 << 5)
1113 1135
1114 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL); 1136 if (launch)
1115 g_object_set(G_OBJECT(playbin), "flags", flags | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_DOWNLOAD | GST_PLAY_FLAG_NATIVE_AUDIO, NULL); 1137 {
1116 g_object_set(G_OBJECT(playbin), "video-sink", bin, NULL); 1138 g_object_set(G_OBJECT(playbin), "sink", bin, NULL);
1117 g_object_set(G_OBJECT(playbin), "uri", uri, NULL); 1139 }
1140 else
1141 {
1142 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL);
1143 g_object_set(G_OBJECT(playbin), "flags", flags | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_DOWNLOAD | GST_PLAY_FLAG_NATIVE_AUDIO, NULL);
1144 g_object_set(G_OBJECT(playbin), "video-sink", bin, NULL);
1145 g_object_set(G_OBJECT(playbin), "uri", uri, NULL);
1146 }
1118 1147
1119 evas_object_image_pixels_get_callback_set(obj, NULL, NULL); 1148 evas_object_image_pixels_get_callback_set(obj, NULL, NULL);
1120 1149