1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2001, 2002 VideoLAN
5 * $Id: dummy.c,v 1.3 2003/02/24 10:45:55 fenrir Exp $
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Eric Petit <titer@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
29 #include <sys/types.h>
36 #include <vlc/input.h>
41 #elif defined( _MSC_VER ) && defined( _WIN32 ) && !defined( UNDER_CE )
47 /*****************************************************************************
49 *****************************************************************************/
50 static int Open ( vlc_object_t * );
51 static void Close ( vlc_object_t * );
53 static int AddStream( sout_instance_t *, sout_input_t * );
54 static int DelStream( sout_instance_t *, sout_input_t * );
55 static int Mux ( sout_instance_t * );
57 /*****************************************************************************
59 *****************************************************************************/
61 set_description( _("Dummy muxer") );
62 set_capability( "sout mux", 5 );
63 add_shortcut( "dummy" );
64 set_callbacks( Open, Close );
67 /*****************************************************************************
69 *****************************************************************************/
70 static int Open( vlc_object_t *p_this )
72 sout_instance_t *p_sout = (sout_instance_t*)p_this;
74 msg_Info( p_sout, "Open" );
76 p_sout->pf_mux_capacity = NULL;
77 p_sout->pf_mux_addstream = AddStream;
78 p_sout->pf_mux_delstream = DelStream;
84 /*****************************************************************************
86 *****************************************************************************/
88 static void Close( vlc_object_t * p_this )
90 sout_instance_t *p_sout = (sout_instance_t*)p_this;
91 msg_Info( p_sout, "Close" );
95 static int AddStream( sout_instance_t *p_sout, sout_input_t *p_input )
97 msg_Dbg( p_sout, "adding input" );
101 static int DelStream( sout_instance_t *p_sout, sout_input_t *p_input )
104 msg_Dbg( p_sout, "removing input" );
108 static int Mux ( sout_instance_t *p_sout )
111 for( i = 0; i < p_sout->i_nb_inputs; i++ )
116 p_fifo = p_sout->pp_inputs[i]->p_fifo;
117 i_count = p_fifo->i_depth;
120 sout_buffer_t *p_data;
122 p_data = sout_FifoGet( p_fifo );
124 sout_AccessOutWrite( p_sout->p_access, p_data );