join.c 1.66 KB
Newer Older
aymeric's avatar
aymeric committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006  Simon MORLAT (simon.morlat@linphone.org)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

Simon Morlat's avatar
Simon Morlat committed
20 21 22 23
#if defined(HAVE_CONFIG_H)
#include "mediastreamer-config.h"
#endif

aymeric's avatar
aymeric committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include "mediastreamer2/msfilter.h"

static void join_process(MSFilter *f){
	mblk_t *im;
	if (f->inputs[0]!=NULL)
	{
		while((im=ms_queue_get(f->inputs[0]))!=NULL){
			ms_queue_put(f->outputs[0],im);
		}
	}
	if (f->inputs[1]!=NULL)
	{
		while((im=ms_queue_get(f->inputs[1]))!=NULL){
			ms_queue_put(f->outputs[0],im);
		}
	}
}

#ifdef _MSC_VER

MSFilterDesc ms_join_desc={
	MS_JOIN_ID,
	"MSJoin",
47
	N_("A filter that send several inputs to one output."),
aymeric's avatar
aymeric committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
	MS_FILTER_OTHER,
	NULL,
	2,
	1,
    NULL,
	NULL,
	join_process,
	NULL,
	NULL,
    NULL
};

#else

MSFilterDesc ms_join_desc={
	.id=MS_JOIN_ID,
	.name="MSJoin",
65
	.text=N_("A filter that send several inputs to one output."),
aymeric's avatar
aymeric committed
66 67 68 69 70 71 72 73 74
	.category=MS_FILTER_OTHER,
	.ninputs=2,
	.noutputs=1,
	.process=join_process
};

#endif

MS_FILTER_DESC_EXPORT(ms_join_desc)