diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 12:08:40 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 12:08:40 +0000 |
commit | a59b71b601cc302a77309dcb8c3db33993117097 (patch) | |
tree | 3127cc02e440a1615f0b98c7f9049481f5c0abb5 /src/conversation/gnunet_gst_test.c | |
parent | 298ab1efc669836811f5a0234e65cf0fb5313ace (diff) | |
download | gnunet-a59b71b601cc302a77309dcb8c3db33993117097.tar.gz gnunet-a59b71b601cc302a77309dcb8c3db33993117097.zip |
add copyright headers, fix includes
Diffstat (limited to 'src/conversation/gnunet_gst_test.c')
-rw-r--r-- | src/conversation/gnunet_gst_test.c | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/src/conversation/gnunet_gst_test.c b/src/conversation/gnunet_gst_test.c index 3e1454c5b..2ea007583 100644 --- a/src/conversation/gnunet_gst_test.c +++ b/src/conversation/gnunet_gst_test.c | |||
@@ -1,3 +1,28 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | Copyright (C) 2016 GNUnet e.V. | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | /** | ||
21 | * @file conversation/gnunet_gst.c | ||
22 | * @brief FIXME | ||
23 | * @author Hark | ||
24 | */ | ||
25 | |||
1 | #include "gnunet_gst_def.h" | 26 | #include "gnunet_gst_def.h" |
2 | #include "gnunet_gst.h" | 27 | #include "gnunet_gst.h" |
3 | 28 | ||
@@ -15,7 +40,7 @@ main (int argc, char *argv[]) | |||
15 | //audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO); | 40 | //audio_message->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO); |
16 | 41 | ||
17 | 42 | ||
18 | //GstPipeline *pipeline; | 43 | //GstPipeline *pipeline; |
19 | 44 | ||
20 | gst = (GNUNET_gstData*)malloc(sizeof(struct GNUNET_gstData)); | 45 | gst = (GNUNET_gstData*)malloc(sizeof(struct GNUNET_gstData)); |
21 | 46 | ||
@@ -30,7 +55,7 @@ main (int argc, char *argv[]) | |||
30 | */ | 55 | */ |
31 | /* Initialize GStreamer */ | 56 | /* Initialize GStreamer */ |
32 | gst_init (&argc, &argv); | 57 | gst_init (&argc, &argv); |
33 | 58 | ||
34 | gst->pipeline = GST_PIPELINE(gst_pipeline_new ("gnunet-media-helper")); | 59 | gst->pipeline = GST_PIPELINE(gst_pipeline_new ("gnunet-media-helper")); |
35 | 60 | ||
36 | #ifdef IS_SPEAKER | 61 | #ifdef IS_SPEAKER |
@@ -45,22 +70,22 @@ main (int argc, char *argv[]) | |||
45 | if ( type == SPEAKER) | 70 | if ( type == SPEAKER) |
46 | { | 71 | { |
47 | 72 | ||
48 | gnunetsrc = GST_ELEMENT(get_app(gst, SOURCE)); | 73 | gnunetsrc = GST_ELEMENT(get_app(gst, SOURCE)); |
49 | 74 | ||
50 | sink = GST_ELEMENT(get_audiobin(gst, SINK)); | 75 | sink = GST_ELEMENT(get_audiobin(gst, SINK)); |
51 | decoder = GST_ELEMENT(get_coder(gst, DECODER)); | 76 | decoder = GST_ELEMENT(get_coder(gst, DECODER)); |
52 | gst_bin_add_many( GST_BIN(gst->pipeline), gnunetsrc, decoder, sink, NULL); | 77 | gst_bin_add_many( GST_BIN(gst->pipeline), gnunetsrc, decoder, sink, NULL); |
53 | gst_element_link_many( gnunetsrc, decoder, sink , NULL); | 78 | gst_element_link_many( gnunetsrc, decoder, sink , NULL); |
54 | 79 | ||
55 | } | 80 | } |
56 | if ( type == MICROPHONE ) { | 81 | if ( type == MICROPHONE ) { |
57 | 82 | ||
58 | source = GST_ELEMENT(get_audiobin(gst, SOURCE)); | 83 | source = GST_ELEMENT(get_audiobin(gst, SOURCE)); |
59 | 84 | ||
60 | encoder = GST_ELEMENT(get_coder(gst, ENCODER)); | 85 | encoder = GST_ELEMENT(get_coder(gst, ENCODER)); |
61 | 86 | ||
62 | gnunetsink = GST_ELEMENT(get_app(gst, SINK)); | 87 | gnunetsink = GST_ELEMENT(get_app(gst, SINK)); |
63 | 88 | ||
64 | gst_bin_add_many( GST_BIN(gst->pipeline), source, encoder, gnunetsink, NULL); | 89 | gst_bin_add_many( GST_BIN(gst->pipeline), source, encoder, gnunetsink, NULL); |
65 | gst_element_link_many( source, encoder, gnunetsink , NULL); | 90 | gst_element_link_many( source, encoder, gnunetsink , NULL); |
66 | 91 | ||
@@ -70,11 +95,11 @@ main (int argc, char *argv[]) | |||
70 | gst_bin_add_many( GST_BIN(gst->pipeline), appsource, appsink, source, encoder, decoder, sink, NULL); | 95 | gst_bin_add_many( GST_BIN(gst->pipeline), appsource, appsink, source, encoder, decoder, sink, NULL); |
71 | gst_element_link_many( source, encoder, decoder, sink , NULL); | 96 | gst_element_link_many( source, encoder, decoder, sink , NULL); |
72 | */ | 97 | */ |
73 | pl_graph(gst->pipeline); | 98 | pl_graph(gst->pipeline); |
74 | /* Start playing */ | 99 | /* Start playing */ |
75 | gst_element_set_state (GST_ELEMENT(gst->pipeline), GST_STATE_PLAYING); | 100 | gst_element_set_state (GST_ELEMENT(gst->pipeline), GST_STATE_PLAYING); |
76 | 101 | ||
77 | //pl_graph(gst->pipeline); | 102 | //pl_graph(gst->pipeline); |
78 | 103 | ||
79 | /* Wait until error or EOS */ | 104 | /* Wait until error or EOS */ |
80 | //bus = gst_element_get_bus (GST_ELEMENT(gst->pipeline)); | 105 | //bus = gst_element_get_bus (GST_ELEMENT(gst->pipeline)); |
@@ -101,7 +126,7 @@ main (int argc, char *argv[]) | |||
101 | flow = on_appsink_new_sample (gst->appsink, gst); | 126 | flow = on_appsink_new_sample (gst->appsink, gst); |
102 | } | 127 | } |
103 | */ | 128 | */ |
104 | } | 129 | } |
105 | if ( type == SPEAKER ) | 130 | if ( type == SPEAKER ) |
106 | { | 131 | { |
107 | while ( 1 ) | 132 | while ( 1 ) |