summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/modules/gstreamer
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2008-07-06 10:05:47 +0000
committerSebastian Dransfeld <sd@tango.flipp.net>2008-07-06 10:05:47 +0000
commit84553cfb4a50abb01719d4a835c3b3f2825ff649 (patch)
tree2dc6412b50de9759403a8f1ce6a50d11a4ecd458 /legacy/emotion/src/modules/gstreamer
parentec19c6f7007ba54ecfe922514104ab217d0eae81 (diff)
formatting
SVN revision: 35012
Diffstat (limited to 'legacy/emotion/src/modules/gstreamer')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c345
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_file.c59
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_uri.c57
3 files changed, 237 insertions, 224 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
index 61b5530c97..2292707e50 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_dvd.c
@@ -5,9 +5,9 @@
5#include "emotion_gstreamer_pipeline.h" 5#include "emotion_gstreamer_pipeline.h"
6 6
7 7
8static void dvd_pad_added_cb (GstElement *dvddemuxer, 8static void dvd_pad_added_cb (GstElement *dvddemuxer,
9 GObject *new_pad, 9 GObject *new_pad,
10 gpointer user_data); 10 gpointer user_data);
11 11
12static void dvd_no_more_pads_cb (GstElement *dvddemuxer, 12static void dvd_no_more_pads_cb (GstElement *dvddemuxer,
13 gpointer user_data); 13 gpointer user_data);
@@ -16,7 +16,7 @@ static int no_more_pads = 0;
16 16
17 17
18int 18int
19emotion_pipeline_dvd_build (void *video, const char *device) 19emotion_pipeline_dvd_build(void *video, const char *device)
20{ 20{
21 GstElement *dvdreadsrc; 21 GstElement *dvdreadsrc;
22 GstElement *dvddemux; 22 GstElement *dvddemux;
@@ -25,205 +25,216 @@ emotion_pipeline_dvd_build (void *video, const char *device)
25 ev = (Emotion_Gstreamer_Video *)video; 25 ev = (Emotion_Gstreamer_Video *)video;
26 if (!ev) return 0; 26 if (!ev) return 0;
27 27
28 dvdreadsrc = gst_element_factory_make ("dvdreadsrc", "src"); 28 dvdreadsrc = gst_element_factory_make("dvdreadsrc", "src");
29 if (!dvdreadsrc) 29 if (!dvdreadsrc)
30 goto failure_dvdreadsrc; 30 goto failure_dvdreadsrc;
31 if (device) 31 if (device)
32 g_object_set (G_OBJECT (dvdreadsrc), "device", device, NULL); 32 g_object_set(G_OBJECT(dvdreadsrc), "device", device, NULL);
33 33
34 dvddemux = gst_element_factory_make ("dvddemux", "dvddemux"); 34 dvddemux = gst_element_factory_make("dvddemux", "dvddemux");
35 if (!dvddemux) 35 if (!dvddemux)
36 goto failure_dvddemux; 36 goto failure_dvddemux;
37 g_signal_connect (dvddemux, "pad-added", 37 g_signal_connect(dvddemux, "pad-added",
38 G_CALLBACK (dvd_pad_added_cb), ev); 38 G_CALLBACK(dvd_pad_added_cb), ev);
39 g_signal_connect (dvddemux, "no-more-pads", 39 g_signal_connect(dvddemux, "no-more-pads",
40 G_CALLBACK (dvd_no_more_pads_cb), ev); 40 G_CALLBACK(dvd_no_more_pads_cb), ev);
41 41
42 gst_bin_add_many (GST_BIN (ev->pipeline), dvdreadsrc, dvddemux, NULL); 42 gst_bin_add_many(GST_BIN(ev->pipeline), dvdreadsrc, dvddemux, NULL);
43 if (!gst_element_link (dvdreadsrc, dvddemux)) 43 if (!gst_element_link(dvdreadsrc, dvddemux))
44 goto failure_link; 44 goto failure_link;
45 45
46 if (!emotion_pipeline_pause (ev->pipeline)) 46 if (!emotion_pipeline_pause(ev->pipeline))
47 goto failure_gstreamer_pause; 47 goto failure_gstreamer_pause;
48 48
49 while (no_more_pads == 0) { 49 while (no_more_pads == 0)
50 g_print ("toto\n");} 50 {
51 g_print("toto\n");
52 }
51 no_more_pads = 0; 53 no_more_pads = 0;
52 54
53 /* We get the informations of streams */ 55 /* We get the informations of streams */
54 ecore_list_first_goto (ev->video_sinks); 56 ecore_list_first_goto(ev->video_sinks);
55 ecore_list_first_goto (ev->audio_sinks); 57 ecore_list_first_goto(ev->audio_sinks);
56 58
57 { 59 {
58 GstIterator *it; 60 GstIterator *it;
59 gpointer data; 61 gpointer data;
60 62
61 it = gst_element_iterate_src_pads (dvddemux); 63 it = gst_element_iterate_src_pads(dvddemux);
62 while (gst_iterator_next (it, &data) == GST_ITERATOR_OK) { 64 while (gst_iterator_next(it, &data) == GST_ITERATOR_OK)
63 GstPad *pad; 65 {
64 GstCaps *caps; 66 GstPad *pad;
65 gchar *str; 67 GstCaps *caps;
66 68 gchar *str;
67 pad = GST_PAD (data); 69
68 70 pad = GST_PAD(data);
69 caps = gst_pad_get_caps (pad); 71
70 str = gst_caps_to_string (caps); 72 caps = gst_pad_get_caps(pad);
71 g_print ("caps !! %s\n", str); 73 str = gst_caps_to_string(caps);
72 /* video stream */ 74 g_print("caps !! %s\n", str);
73 if (g_str_has_prefix (str, "video/mpeg")) { 75 /* video stream */
74 Emotion_Video_Sink *vsink; 76 if (g_str_has_prefix(str, "video/mpeg"))
75 GstPad *sink_pad; 77 {
76 GstCaps *sink_caps; 78 Emotion_Video_Sink *vsink;
77 79 GstPad *sink_pad;
78 vsink = (Emotion_Video_Sink *)ecore_list_next (ev->video_sinks); 80 GstCaps *sink_caps;
79 sink_pad = gst_element_get_pad (gst_bin_get_by_name (GST_BIN (ev->pipeline), "mpeg2dec"), "src"); 81
80 sink_caps = gst_pad_get_caps (sink_pad); 82 vsink = (Emotion_Video_Sink *)ecore_list_next(ev->video_sinks);
81 str = gst_caps_to_string (sink_caps); 83 sink_pad = gst_element_get_pad(gst_bin_get_by_name(GST_BIN(ev->pipeline), "mpeg2dec"), "src");
82 g_print (" ** caps v !! %s\n", str); 84 sink_caps = gst_pad_get_caps(sink_pad);
83 85 str = gst_caps_to_string(sink_caps);
84 emotion_video_sink_fill (vsink, sink_pad, sink_caps); 86 g_print(" ** caps v !! %s\n", str);
85 87
86 gst_caps_unref (sink_caps); 88 emotion_video_sink_fill(vsink, sink_pad, sink_caps);
87 gst_object_unref (sink_pad); 89
88 } 90 gst_caps_unref(sink_caps);
89 /* audio stream */ 91 gst_object_unref(sink_pad);
90 else if (g_str_has_prefix (str, "audio/")) { 92 }
91 Emotion_Audio_Sink *asink; 93 /* audio stream */
92 GstPad *sink_pad; 94 else if (g_str_has_prefix(str, "audio/"))
93 GstCaps *sink_caps; 95 {
94 96 Emotion_Audio_Sink *asink;
95 asink = (Emotion_Audio_Sink *)ecore_list_next (ev->audio_sinks); 97 GstPad *sink_pad;
96 sink_pad = gst_element_get_pad (gst_bin_get_by_name (GST_BIN (ev->pipeline), "a52dec"), "src"); 98 GstCaps *sink_caps;
97 sink_caps = gst_pad_get_caps (sink_pad); 99
98 100 asink = (Emotion_Audio_Sink *)ecore_list_next(ev->audio_sinks);
99 emotion_audio_sink_fill (asink, sink_pad, sink_caps); 101 sink_pad = gst_element_get_pad(gst_bin_get_by_name(GST_BIN(ev->pipeline), "a52dec"), "src");
100 } 102 sink_caps = gst_pad_get_caps(sink_pad);
101 gst_caps_unref (caps); 103
102 g_free (str); 104 emotion_audio_sink_fill(asink, sink_pad, sink_caps);
103 gst_object_unref (pad); 105 }
104 } 106 gst_caps_unref(caps);
105 gst_iterator_free (it); 107 g_free(str);
106 } 108 gst_object_unref(pad);
109 }
110 gst_iterator_free(it);
111 }
107 112
108 /* The first vsink is a valid Emotion_Video_Sink * */ 113 /* The first vsink is a valid Emotion_Video_Sink * */
109 /* If no video stream is found, it's a visualisation sink */ 114 /* If no video stream is found, it's a visualisation sink */
110 { 115 {
111 Emotion_Video_Sink *vsink; 116 Emotion_Video_Sink *vsink;
112 117
113 vsink = (Emotion_Video_Sink *)ecore_list_first_goto (ev->video_sinks); 118 vsink = (Emotion_Video_Sink *)ecore_list_first_goto(ev->video_sinks);
114 if (vsink && vsink->sink) { 119 if (vsink && vsink->sink)
115 g_object_set (G_OBJECT (vsink->sink), "sync", TRUE, NULL); 120 {
116 g_object_set (G_OBJECT (vsink->sink), "signal-handoffs", TRUE, NULL); 121 g_object_set(G_OBJECT(vsink->sink), "sync", TRUE, NULL);
117 g_signal_connect (G_OBJECT (vsink->sink), 122 g_object_set(G_OBJECT(vsink->sink), "signal-handoffs", TRUE, NULL);
118 "handoff", 123 g_signal_connect(G_OBJECT(vsink->sink),
119 G_CALLBACK (cb_handoff), ev); 124 "handoff",
120 } 125 G_CALLBACK(cb_handoff), ev);
121 } 126 }
127 }
122 128
123 return 1; 129 return 1;
124 130
125 failure_gstreamer_pause: 131failure_gstreamer_pause:
126 failure_link: 132failure_link:
127 gst_element_set_state (ev->pipeline, GST_STATE_NULL); 133 gst_element_set_state(ev->pipeline, GST_STATE_NULL);
128 gst_bin_remove (GST_BIN (ev->pipeline), dvddemux); 134 gst_bin_remove(GST_BIN(ev->pipeline), dvddemux);
129 failure_dvddemux: 135failure_dvddemux:
130 gst_bin_remove (GST_BIN (ev->pipeline), dvdreadsrc); 136 gst_bin_remove(GST_BIN(ev->pipeline), dvdreadsrc);
131 failure_dvdreadsrc: 137failure_dvdreadsrc:
132 138
133 return 0; 139 return 0;
134} 140}
135 141
136static void 142static void
137dvd_pad_added_cb (GstElement *dvddemuxer, 143dvd_pad_added_cb(GstElement *dvddemuxer,
138 GObject *new_pad, 144 GObject *new_pad,
139 gpointer user_data) 145 gpointer user_data)
140{ 146{
141 Emotion_Gstreamer_Video *ev; 147 Emotion_Gstreamer_Video *ev;
142 GstCaps *caps; 148 GstCaps *caps;
143 gchar *str; 149 gchar *str;
144 150
145 ev = (Emotion_Gstreamer_Video *)user_data; 151 ev = (Emotion_Gstreamer_Video *)user_data;
146 caps = gst_pad_get_caps (GST_PAD (new_pad)); 152 caps = gst_pad_get_caps(GST_PAD(new_pad));
147 str = gst_caps_to_string (caps); 153 str = gst_caps_to_string(caps);
148 /* video stream */ 154 /* video stream */
149 if (g_str_has_prefix (str, "video/mpeg")) { 155 if (g_str_has_prefix(str, "video/mpeg"))
150 Emotion_Video_Sink *vsink; 156 {
151 GstElement *queue; 157 Emotion_Video_Sink *vsink;
152 GstElement *decoder; 158 GstElement *queue;
153 GstPad *videopad; 159 GstElement *decoder;
154 160 GstPad *videopad;
155 vsink = (Emotion_Video_Sink *)malloc (sizeof (Emotion_Video_Sink)); 161
156 if (!vsink) return; 162 vsink = (Emotion_Video_Sink *)malloc(sizeof(Emotion_Video_Sink));
157 if (!ecore_list_append (ev->video_sinks, vsink)) { 163 if (!vsink) return;
158 free(vsink); 164 if (!ecore_list_append(ev->video_sinks, vsink))
159 return; 165 {
160 } 166 free(vsink);
161 167 return;
162 queue = gst_element_factory_make ("queue", NULL); 168 }
163 decoder = gst_element_factory_make ("mpeg2dec", "mpeg2dec"); 169
164 vsink->sink = gst_element_factory_make ("fakesink", "videosink"); 170 queue = gst_element_factory_make("queue", NULL);
165 gst_bin_add_many (GST_BIN (ev->pipeline), queue, decoder, vsink->sink, NULL); 171 decoder = gst_element_factory_make("mpeg2dec", "mpeg2dec");
166 gst_element_link (queue, decoder); 172 vsink->sink = gst_element_factory_make("fakesink", "videosink");
167 gst_element_link (decoder, vsink->sink); 173 gst_bin_add_many(GST_BIN(ev->pipeline), queue, decoder, vsink->sink, NULL);
168 videopad = gst_element_get_pad (queue, "sink"); 174 gst_element_link(queue, decoder);
169 gst_pad_link (GST_PAD (new_pad), videopad); 175 gst_element_link(decoder, vsink->sink);
170 gst_object_unref (videopad); 176 videopad = gst_element_get_pad(queue, "sink");
171 if (ecore_list_count(ev->video_sinks) == 1) { 177 gst_pad_link(GST_PAD(new_pad), videopad);
172 ev->ratio = (double)vsink->width / (double)vsink->height; 178 gst_object_unref(videopad);
173 } 179 if (ecore_list_count(ev->video_sinks) == 1)
174 gst_element_set_state (queue, GST_STATE_PAUSED); 180 {
175 gst_element_set_state (decoder, GST_STATE_PAUSED); 181 ev->ratio = (double)vsink->width / (double)vsink->height;
176 gst_element_set_state (vsink->sink, GST_STATE_PAUSED); 182 }
177 } 183 gst_element_set_state(queue, GST_STATE_PAUSED);
184 gst_element_set_state(decoder, GST_STATE_PAUSED);
185 gst_element_set_state(vsink->sink, GST_STATE_PAUSED);
186 }
178 /* audio stream */ 187 /* audio stream */
179 else if (g_str_has_prefix (str, "audio/")) { 188 else if (g_str_has_prefix(str, "audio/"))
180 Emotion_Audio_Sink *asink; 189 {
181 GstElement *queue; 190 Emotion_Audio_Sink *asink;
182 GstElement *decoder; 191 GstElement *queue;
183 GstElement *conv; 192 GstElement *decoder;
184 GstElement *resample; 193 GstElement *conv;
185 GstElement *volume; 194 GstElement *resample;
186 GstPad *audiopad; 195 GstElement *volume;
187 double vol; 196 GstPad *audiopad;
188 197 double vol;
189 asink = (Emotion_Audio_Sink *)malloc (sizeof (Emotion_Audio_Sink)); 198
190 if (!asink) return; 199 asink = (Emotion_Audio_Sink *)malloc(sizeof(Emotion_Audio_Sink));
191 if (!ecore_list_append (ev->audio_sinks, asink)) { 200 if (!asink) return;
192 free(asink); 201 if (!ecore_list_append(ev->audio_sinks, asink))
193 return; 202 {
194 } 203 free(asink);
195 204 return;
196 queue = gst_element_factory_make ("queue", NULL); 205 }
197 decoder = gst_element_factory_make ("a52dec", "a52dec"); 206
198 conv = gst_element_factory_make ("audioconvert", NULL); 207 queue = gst_element_factory_make("queue", NULL);
199 resample = gst_element_factory_make ("audioresample", NULL); 208 decoder = gst_element_factory_make("a52dec", "a52dec");
200 volume = gst_element_factory_make ("volume", "volume"); 209 conv = gst_element_factory_make("audioconvert", NULL);
201 g_object_get (G_OBJECT (volume), "volume", &vol, NULL); 210 resample = gst_element_factory_make("audioresample", NULL);
202 ev->volume = vol / 10.0; 211 volume = gst_element_factory_make("volume", "volume");
203 212 g_object_get(G_OBJECT(volume), "volume", &vol, NULL);
204 /* FIXME: must manage several audio streams */ 213 ev->volume = vol / 10.0;
205 asink->sink = gst_element_factory_make ("fakesink", NULL); 214
206 215 /* FIXME: must manage several audio streams */
207 gst_bin_add_many (GST_BIN (ev->pipeline), 216 asink->sink = gst_element_factory_make("fakesink", NULL);
208 queue, decoder, conv, resample, volume, asink->sink, NULL); 217
209 gst_element_link_many (queue, decoder, conv, resample, volume, asink->sink, NULL); 218 gst_bin_add_many(GST_BIN(ev->pipeline),
210 219 queue, decoder, conv, resample, volume, asink->sink, NULL);
211 audiopad = gst_element_get_pad (queue, "sink"); 220 gst_element_link_many(queue, decoder, conv, resample, volume, asink->sink, NULL);
212 gst_pad_link (GST_PAD (new_pad), audiopad); 221
213 gst_object_unref (audiopad); 222 audiopad = gst_element_get_pad(queue, "sink");
214 223 gst_pad_link(GST_PAD(new_pad), audiopad);
215 gst_element_set_state (queue, GST_STATE_PAUSED); 224 gst_object_unref(audiopad);
216 gst_element_set_state (decoder, GST_STATE_PAUSED); 225
217 gst_element_set_state (conv, GST_STATE_PAUSED); 226 gst_element_set_state(queue, GST_STATE_PAUSED);
218 gst_element_set_state (resample, GST_STATE_PAUSED); 227 gst_element_set_state(decoder, GST_STATE_PAUSED);
219 gst_element_set_state (volume, GST_STATE_PAUSED); 228 gst_element_set_state(conv, GST_STATE_PAUSED);
220 gst_element_set_state (asink->sink, GST_STATE_PAUSED); 229 gst_element_set_state(resample, GST_STATE_PAUSED);
221 } 230 gst_element_set_state(volume, GST_STATE_PAUSED);
231 gst_element_set_state(asink->sink, GST_STATE_PAUSED);
232 }
222} 233}
223 234
224static void 235static void
225dvd_no_more_pads_cb (GstElement *dvddemuxer, 236dvd_no_more_pads_cb(GstElement *dvddemuxer,
226 gpointer user_data) 237 gpointer user_data)
227{ 238{
228 no_more_pads = 1; 239 no_more_pads = 1;
229} 240}
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_file.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_file.c
index 0ec76774be..393855d823 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_file.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_file.c
@@ -5,7 +5,7 @@
5#include "emotion_gstreamer_pipeline.h" 5#include "emotion_gstreamer_pipeline.h"
6 6
7int 7int
8emotion_pipeline_file_build (void *video, const char *file) 8emotion_pipeline_file_build(void *video, const char *file)
9{ 9{
10 GstElement *filesrc; 10 GstElement *filesrc;
11 GstElement *decodebin; 11 GstElement *decodebin;
@@ -14,50 +14,51 @@ emotion_pipeline_file_build (void *video, const char *file)
14 ev = (Emotion_Gstreamer_Video *)video; 14 ev = (Emotion_Gstreamer_Video *)video;
15 if (!ev) return 0; 15 if (!ev) return 0;
16 16
17 filesrc = gst_element_factory_make ("filesrc", "src"); 17 filesrc = gst_element_factory_make("filesrc", "src");
18 if (!filesrc) 18 if (!filesrc)
19 goto failure_filesrc; 19 goto failure_filesrc;
20 g_object_set (G_OBJECT (filesrc), "location", file, NULL); 20 g_object_set(G_OBJECT(filesrc), "location", file, NULL);
21 21
22 decodebin = gst_element_factory_make ("decodebin", "decodebin"); 22 decodebin = gst_element_factory_make("decodebin", "decodebin");
23 if (!decodebin) 23 if (!decodebin)
24 goto failure_decodebin; 24 goto failure_decodebin;
25 g_signal_connect (decodebin, "new-decoded-pad", 25 g_signal_connect(decodebin, "new-decoded-pad",
26 G_CALLBACK (file_new_decoded_pad_cb), ev); 26 G_CALLBACK(file_new_decoded_pad_cb), ev);
27 27
28 gst_bin_add_many (GST_BIN (ev->pipeline), filesrc, decodebin, NULL); 28 gst_bin_add_many(GST_BIN(ev->pipeline), filesrc, decodebin, NULL);
29 if (!gst_element_link (filesrc, decodebin)) 29 if (!gst_element_link(filesrc, decodebin))
30 goto failure_link; 30 goto failure_link;
31 31
32 if (!emotion_pipeline_pause (ev->pipeline)) 32 if (!emotion_pipeline_pause(ev->pipeline))
33 goto failure_gstreamer_pause; 33 goto failure_gstreamer_pause;
34 34
35 emotion_streams_sinks_get (ev, decodebin); 35 emotion_streams_sinks_get(ev, decodebin);
36 36
37 /* The first vsink is a valid Emotion_Video_Sink * */ 37 /* The first vsink is a valid Emotion_Video_Sink * */
38 /* If no video stream is found, it's a visualisation sink */ 38 /* If no video stream is found, it's a visualisation sink */
39 { 39 {
40 Emotion_Video_Sink *vsink; 40 Emotion_Video_Sink *vsink;
41 41
42 vsink = (Emotion_Video_Sink *)ecore_list_first_goto (ev->video_sinks); 42 vsink = (Emotion_Video_Sink *)ecore_list_first_goto(ev->video_sinks);
43 if (vsink && vsink->sink) { 43 if (vsink && vsink->sink)
44 g_object_set (G_OBJECT (vsink->sink), "sync", TRUE, NULL); 44 {
45 g_object_set (G_OBJECT (vsink->sink), "signal-handoffs", TRUE, NULL); 45 g_object_set(G_OBJECT(vsink->sink), "sync", TRUE, NULL);
46 g_signal_connect (G_OBJECT (vsink->sink), 46 g_object_set(G_OBJECT(vsink->sink), "signal-handoffs", TRUE, NULL);
47 "handoff", 47 g_signal_connect(G_OBJECT(vsink->sink),
48 G_CALLBACK (cb_handoff), ev); 48 "handoff",
49 } 49 G_CALLBACK(cb_handoff), ev);
50 } 50 }
51 }
51 52
52 return 1; 53 return 1;
53 54
54 failure_gstreamer_pause: 55failure_gstreamer_pause:
55 failure_link: 56failure_link:
56 gst_element_set_state (ev->pipeline, GST_STATE_NULL); 57 gst_element_set_state(ev->pipeline, GST_STATE_NULL);
57 gst_bin_remove (GST_BIN (ev->pipeline), decodebin); 58 gst_bin_remove(GST_BIN(ev->pipeline), decodebin);
58 failure_decodebin: 59failure_decodebin:
59 gst_bin_remove (GST_BIN (ev->pipeline), filesrc); 60 gst_bin_remove(GST_BIN(ev->pipeline), filesrc);
60 failure_filesrc: 61failure_filesrc:
61 62
62 return 0; 63 return 0;
63} 64}
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_uri.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_uri.c
index d83590f9f3..d6a1c00609 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_uri.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer_pipeline_uri.c
@@ -5,7 +5,7 @@
5#include "emotion_gstreamer_pipeline.h" 5#include "emotion_gstreamer_pipeline.h"
6 6
7int 7int
8emotion_pipeline_uri_build (void *video, const char *uri) 8emotion_pipeline_uri_build(void *video, const char *uri)
9{ 9{
10 GstElement *src; 10 GstElement *src;
11 GstElement *decodebin; 11 GstElement *decodebin;
@@ -16,50 +16,51 @@ emotion_pipeline_uri_build (void *video, const char *uri)
16 16
17 if (gst_uri_protocol_is_supported(GST_URI_SRC, uri)) 17 if (gst_uri_protocol_is_supported(GST_URI_SRC, uri))
18 goto failure_src; 18 goto failure_src;
19 src = gst_element_make_from_uri (GST_URI_SRC, uri, "src"); 19 src = gst_element_make_from_uri(GST_URI_SRC, uri, "src");
20 if (!src) 20 if (!src)
21 goto failure_src; 21 goto failure_src;
22 g_object_set (G_OBJECT (src), "location", uri, NULL); 22 g_object_set(G_OBJECT(src), "location", uri, NULL);
23 23
24 decodebin = gst_element_factory_make ("decodebin", "decodebin"); 24 decodebin = gst_element_factory_make("decodebin", "decodebin");
25 if (!decodebin) 25 if (!decodebin)
26 goto failure_decodebin; 26 goto failure_decodebin;
27 g_signal_connect (decodebin, "new-decoded-pad", 27 g_signal_connect(decodebin, "new-decoded-pad",
28 G_CALLBACK (file_new_decoded_pad_cb), ev); 28 G_CALLBACK(file_new_decoded_pad_cb), ev);
29 29
30 gst_bin_add_many (GST_BIN (ev->pipeline), src, decodebin, NULL); 30 gst_bin_add_many(GST_BIN(ev->pipeline), src, decodebin, NULL);
31 if (!gst_element_link (src, decodebin)) 31 if (!gst_element_link(src, decodebin))
32 goto failure_link; 32 goto failure_link;
33 33
34 if (!emotion_pipeline_pause (ev->pipeline)) 34 if (!emotion_pipeline_pause(ev->pipeline))
35 goto failure_gstreamer_pause; 35 goto failure_gstreamer_pause;
36 36
37 emotion_streams_sinks_get (ev, decodebin); 37 emotion_streams_sinks_get(ev, decodebin);
38 38
39 /* The first vsink is a valid Emotion_Video_Sink * */ 39 /* The first vsink is a valid Emotion_Video_Sink * */
40 /* If no video stream is found, it's a visualisation sink */ 40 /* If no video stream is found, it's a visualisation sink */
41 { 41 {
42 Emotion_Video_Sink *vsink; 42 Emotion_Video_Sink *vsink;
43 43
44 vsink = (Emotion_Video_Sink *)ecore_list_first_goto (ev->video_sinks); 44 vsink = (Emotion_Video_Sink *)ecore_list_first_goto(ev->video_sinks);
45 if (vsink && vsink->sink) { 45 if (vsink && vsink->sink)
46 g_object_set (G_OBJECT (vsink->sink), "sync", TRUE, NULL); 46 {
47 g_object_set (G_OBJECT (vsink->sink), "signal-handoffs", TRUE, NULL); 47 g_object_set(G_OBJECT(vsink->sink), "sync", TRUE, NULL);
48 g_signal_connect (G_OBJECT (vsink->sink), 48 g_object_set(G_OBJECT(vsink->sink), "signal-handoffs", TRUE, NULL);
49 "handoff", 49 g_signal_connect(G_OBJECT(vsink->sink),
50 G_CALLBACK (cb_handoff), ev); 50 "handoff",
51 } 51 G_CALLBACK(cb_handoff), ev);
52 } 52 }
53 }
53 54
54 return 1; 55 return 1;
55 56
56 failure_gstreamer_pause: 57failure_gstreamer_pause:
57 failure_link: 58failure_link:
58 gst_element_set_state (ev->pipeline, GST_STATE_NULL); 59 gst_element_set_state(ev->pipeline, GST_STATE_NULL);
59 gst_bin_remove (GST_BIN (ev->pipeline), decodebin); 60 gst_bin_remove(GST_BIN(ev->pipeline), decodebin);
60 failure_decodebin: 61failure_decodebin:
61 gst_bin_remove (GST_BIN (ev->pipeline), src); 62 gst_bin_remove(GST_BIN(ev->pipeline), src);
62 failure_src: 63failure_src:
63 64
64 return 0; 65 return 0;
65} 66}