]> sjero.net Git - linphone/blob - linphone/mediastreamer2/src/msjoin.c
9d04b0c1b2f3b8c50c664cd3d45aad3d7f67e1fe
[linphone] / linphone / mediastreamer2 / src / msjoin.c
1 /*
2 mediastreamer2 library - modular sound and video processing and streaming
3 Copyright (C) 2006  Simon MORLAT (simon.morlat@linphone.org)
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 */
19
20 #include "mediastreamer2/msfilter.h"
21
22 static void join_process(MSFilter *f){
23         mblk_t *im;
24         if (f->inputs[0]!=NULL)
25         {
26                 while((im=ms_queue_get(f->inputs[0]))!=NULL){
27                         ms_queue_put(f->outputs[0],im);
28                 }
29         }
30         if (f->inputs[1]!=NULL)
31         {
32                 while((im=ms_queue_get(f->inputs[1]))!=NULL){
33                         int payload;
34                         payload=mblk_set_payload_type(im, 123);
35                         ms_queue_put(f->outputs[0],im);
36                 }
37         }
38 }
39
40 #ifdef _MSC_VER
41
42 MSFilterDesc ms_join_desc={
43         MS_JOIN_ID,
44         "MSJoin",
45         N_("A filter that send several inputs to one output."),
46         MS_FILTER_OTHER,
47         NULL,
48         2,
49         1,
50     NULL,
51         NULL,
52         join_process,
53         NULL,
54         NULL,
55     NULL
56 };
57
58 #else
59
60 MSFilterDesc ms_join_desc={
61         .id=MS_JOIN_ID,
62         .name="MSJoin",
63         .text=N_("A filter that send several inputs to one output."),
64         .category=MS_FILTER_OTHER,
65         .ninputs=2,
66         .noutputs=1,
67         .process=join_process
68 };
69
70 #endif
71
72 MS_FILTER_DESC_EXPORT(ms_join_desc)