diff options
Diffstat (limited to 'src/conversation/gnunet_gst.c')
-rw-r--r-- | src/conversation/gnunet_gst.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/conversation/gnunet_gst.c b/src/conversation/gnunet_gst.c index 7703215bb..d776189cd 100644 --- a/src/conversation/gnunet_gst.c +++ b/src/conversation/gnunet_gst.c | |||
@@ -62,6 +62,7 @@ BREAKOUT: | |||
62 | return; | 62 | return; |
63 | } | 63 | } |
64 | 64 | ||
65 | |||
65 | /*** | 66 | /*** |
66 | * load gnunet configuration | 67 | * load gnunet configuration |
67 | */ | 68 | */ |
@@ -142,6 +143,7 @@ gg_load_configuration (GNUNET_gstData *d) | |||
142 | // GNUNET_CONFIGURATION_write(cfg, "mediahelper.conf"); | 143 | // GNUNET_CONFIGURATION_write(cfg, "mediahelper.conf"); |
143 | } | 144 | } |
144 | 145 | ||
146 | |||
145 | static void | 147 | static void |
146 | write_data (const char *ptr, size_t msg_size) | 148 | write_data (const char *ptr, size_t msg_size) |
147 | { | 149 | { |
@@ -163,7 +165,6 @@ write_data (const char *ptr, size_t msg_size) | |||
163 | } | 165 | } |
164 | 166 | ||
165 | 167 | ||
166 | |||
167 | extern GstFlowReturn | 168 | extern GstFlowReturn |
168 | on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) | 169 | on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) |
169 | { | 170 | { |
@@ -179,9 +180,7 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) | |||
179 | char *si_str; | 180 | char *si_str; |
180 | GstCaps *s_caps; | 181 | GstCaps *s_caps; |
181 | char *caps_str; | 182 | char *caps_str; |
182 | */ | 183 | */if (gst_app_sink_is_eos (GST_APP_SINK (element))) |
183 | |||
184 | if (gst_app_sink_is_eos (GST_APP_SINK (element))) | ||
185 | return GST_FLOW_OK; | 184 | return GST_FLOW_OK; |
186 | 185 | ||
187 | // pull sample from appsink | 186 | // pull sample from appsink |
@@ -198,7 +197,6 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) | |||
198 | GST_WARNING ("caps are %" GST_PTR_FORMAT, gst_sample_get_caps (s)); | 197 | GST_WARNING ("caps are %" GST_PTR_FORMAT, gst_sample_get_caps (s)); |
199 | 198 | ||
200 | 199 | ||
201 | |||
202 | gst_buffer_map (b, &map, GST_MAP_READ); | 200 | gst_buffer_map (b, &map, GST_MAP_READ); |
203 | 201 | ||
204 | size_t len; | 202 | size_t len; |
@@ -226,6 +224,7 @@ on_appsink_new_sample (GstElement *element, GNUNET_gstData *d) | |||
226 | return GST_FLOW_OK; | 224 | return GST_FLOW_OK; |
227 | } | 225 | } |
228 | 226 | ||
227 | |||
229 | /*** | 228 | /*** |
230 | * Dump a pipeline graph | 229 | * Dump a pipeline graph |
231 | */ | 230 | */ |
@@ -248,7 +247,6 @@ pl_graph (GstElement *pipeline) | |||
248 | } | 247 | } |
249 | 248 | ||
250 | 249 | ||
251 | |||
252 | extern gboolean | 250 | extern gboolean |
253 | gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data) | 251 | gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data) |
254 | { | 252 | { |
@@ -286,6 +284,7 @@ gnunet_gst_bus_call (GstBus *bus, GstMessage *msg, gpointer data) | |||
286 | return TRUE; | 284 | return TRUE; |
287 | } | 285 | } |
288 | 286 | ||
287 | |||
289 | /* called when pipeline changes state */ | 288 | /* called when pipeline changes state */ |
290 | extern void | 289 | extern void |
291 | state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d) | 290 | state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d) |
@@ -326,6 +325,7 @@ state_changed_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *d) | |||
326 | } | 325 | } |
327 | } | 326 | } |
328 | 327 | ||
328 | |||
329 | static void | 329 | static void |
330 | application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | 330 | application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) |
331 | { | 331 | { |
@@ -333,6 +333,7 @@ application_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | |||
333 | return; | 333 | return; |
334 | } | 334 | } |
335 | 335 | ||
336 | |||
336 | static void | 337 | static void |
337 | error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | 338 | error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) |
338 | { | 339 | { |
@@ -340,6 +341,7 @@ error_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | |||
340 | return; | 341 | return; |
341 | } | 342 | } |
342 | 343 | ||
344 | |||
343 | static void | 345 | static void |
344 | eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | 346 | eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) |
345 | { | 347 | { |
@@ -347,6 +349,7 @@ eos_cb (GstBus *bus, GstMessage *msg, GNUNET_gstData *data) | |||
347 | return; | 349 | return; |
348 | } | 350 | } |
349 | 351 | ||
352 | |||
350 | extern void | 353 | extern void |
351 | gg_setup_gst_bus (GNUNET_gstData *d) | 354 | gg_setup_gst_bus (GNUNET_gstData *d) |
352 | { | 355 | { |
@@ -367,6 +370,7 @@ gg_setup_gst_bus (GNUNET_gstData *d) | |||
367 | gst_object_unref (bus); | 370 | gst_object_unref (bus); |
368 | } | 371 | } |
369 | 372 | ||
373 | |||
370 | /* | 374 | /* |
371 | * take buffer from gstreamer and feed it to gnunet | 375 | * take buffer from gstreamer and feed it to gnunet |
372 | */ | 376 | */ |
@@ -543,7 +547,6 @@ feed_buffer_to_gst (const char *audio, size_t b_len, GNUNET_gstData *d) | |||
543 | } | 547 | } |
544 | 548 | ||
545 | 549 | ||
546 | |||
547 | /** | 550 | /** |
548 | * debug making elements | 551 | * debug making elements |
549 | */ | 552 | */ |
@@ -567,6 +570,7 @@ gst_element_factory_make_debug (gchar *factoryname, gchar *name) | |||
567 | } | 570 | } |
568 | } | 571 | } |
569 | 572 | ||
573 | |||
570 | /* | 574 | /* |
571 | static gboolean | 575 | static gboolean |
572 | gst_element_link_many_debug(...) | 576 | gst_element_link_many_debug(...) |
@@ -585,6 +589,7 @@ lf (char *msg) | |||
585 | exit (10); | 589 | exit (10); |
586 | } | 590 | } |
587 | 591 | ||
592 | |||
588 | /*** | 593 | /*** |
589 | * used to set properties on autoaudiosink's chosen sink | 594 | * used to set properties on autoaudiosink's chosen sink |
590 | */ | 595 | */ |
@@ -601,6 +606,7 @@ autoaudiosink_child_added (GstChildProxy *child_proxy, | |||
601 | NULL); | 606 | NULL); |
602 | } | 607 | } |
603 | 608 | ||
609 | |||
604 | /*** | 610 | /*** |
605 | * used to set properties on autoaudiosource's chosen sink | 611 | * used to set properties on autoaudiosource's chosen sink |
606 | */ | 612 | */ |
@@ -624,6 +630,7 @@ get_pipeline (GstElement *element) | |||
624 | return GST_ELEMENT (p); | 630 | return GST_ELEMENT (p); |
625 | } | 631 | } |
626 | 632 | ||
633 | |||
627 | static void | 634 | static void |
628 | decoder_ogg_pad_added (GstElement *element, | 635 | decoder_ogg_pad_added (GstElement *element, |
629 | GstPad *pad, | 636 | GstPad *pad, |
@@ -682,6 +689,7 @@ gnunet_read (GNUNET_gstData *d) | |||
682 | return 0; | 689 | return 0; |
683 | } | 690 | } |
684 | 691 | ||
692 | |||
685 | /** | 693 | /** |
686 | * Message callback | 694 | * Message callback |
687 | * | 695 | * |
@@ -802,6 +810,7 @@ get_app (GNUNET_gstData *d, int type) | |||
802 | return bin; | 810 | return bin; |
803 | } | 811 | } |
804 | 812 | ||
813 | |||
805 | extern GstBin * | 814 | extern GstBin * |
806 | get_coder (GNUNET_gstData *d, int type) | 815 | get_coder (GNUNET_gstData *d, int type) |
807 | { | 816 | { |
@@ -824,8 +833,7 @@ get_coder (GNUNET_gstData *d, int type) | |||
824 | "sprop-stereo", G_TYPE_STRING, "0", | 833 | "sprop-stereo", G_TYPE_STRING, "0", |
825 | "encoding-params", G_TYPE_STRING, "2", | 834 | "encoding-params", G_TYPE_STRING, "2", |
826 | NULL); | 835 | NULL); |
827 | */ | 836 | */ rtpcaps = gst_caps_new_simple ("application/x-rtp", |
828 | rtpcaps = gst_caps_new_simple ("application/x-rtp", | ||
829 | "media", G_TYPE_STRING, "audio", | 837 | "media", G_TYPE_STRING, "audio", |
830 | "clock-rate", G_TYPE_INT, SAMPLING_RATE, | 838 | "clock-rate", G_TYPE_INT, SAMPLING_RATE, |
831 | "encoding-name", G_TYPE_STRING, "OPUS", | 839 | "encoding-name", G_TYPE_STRING, "OPUS", |
@@ -1013,8 +1021,7 @@ get_audiobin (GNUNET_gstData *d, int type) | |||
1013 | "enough-data", | 1021 | "enough-data", |
1014 | G_CALLBACK(appsrc_enough_data), | 1022 | G_CALLBACK(appsrc_enough_data), |
1015 | NULL); | 1023 | NULL); |
1016 | */ | 1024 | *//* |
1017 | /* | ||
1018 | g_signal_connect (queue, | 1025 | g_signal_connect (queue, |
1019 | "notify::current-level-bytes", | 1026 | "notify::current-level-bytes", |
1020 | G_CALLBACK(queue_current_level), | 1027 | G_CALLBACK(queue_current_level), |
@@ -1039,11 +1046,7 @@ get_audiobin (GNUNET_gstData *d, int type) | |||
1039 | "pushing", | 1046 | "pushing", |
1040 | G_CALLBACK(queue_pushing), | 1047 | G_CALLBACK(queue_pushing), |
1041 | NULL); | 1048 | NULL); |
1042 | */ | 1049 | */ } |
1043 | } | ||
1044 | |||
1045 | |||
1046 | |||
1047 | 1050 | ||
1048 | 1051 | ||
1049 | gst_bin_add_many (bin, conv, resampler, sink, NULL); | 1052 | gst_bin_add_many (bin, conv, resampler, sink, NULL); |