X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fstream_out%2Fdummy.c;h=fbf7a2ed59585132f5f0a12cf0b28de318b58e6b;hb=3dd2478ce13bb16c5f3f55518b057f21d354ef32;hp=d61caf9ea8454a1d71f13fb543baba106b3c7355;hpb=bfeea8d61f8591f77a75a8c8a7a0c09c8681bda7;p=vlc diff --git a/modules/stream_out/dummy.c b/modules/stream_out/dummy.c index d61caf9ea8..fbf7a2ed59 100644 --- a/modules/stream_out/dummy.c +++ b/modules/stream_out/dummy.c @@ -1,8 +1,8 @@ /***************************************************************************** - * dummy.c + * dummy.c: dummy stream output module ***************************************************************************** - * Copyright (C) 2001, 2002 VideoLAN - * $Id: dummy.c,v 1.2 2003/11/21 15:32:08 fenrir Exp $ + * Copyright (C) 2003-2004 the VideoLAN team + * $Id$ * * Authors: Laurent Aimar * @@ -18,17 +18,21 @@ * * 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, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include /***************************************************************************** * Exported prototypes @@ -38,24 +42,25 @@ static void Close ( vlc_object_t * ); static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * ); static int Del ( sout_stream_t *, sout_stream_id_t * ); -static int Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* ); +static int Send( sout_stream_t *, sout_stream_id_t *, block_t* ); /***************************************************************************** * Module descriptor *****************************************************************************/ -vlc_module_begin(); - set_description( _("Dummy stream") ); - set_capability( "sout stream", 50 ); - add_shortcut( "dummy" ); - set_callbacks( Open, Close ); -vlc_module_end(); +vlc_module_begin () + set_description( N_("Dummy stream output") ) + set_capability( "sout stream", 50 ) + add_shortcut( "dummy" ) + add_shortcut( "drop" ) + set_callbacks( Open, Close ) +vlc_module_end () /***************************************************************************** * Open: *****************************************************************************/ static int Open( vlc_object_t *p_this ) { - sout_stream_t *p_stream = (sout_stream_t*)p_this; + sout_stream_t *p_stream = (sout_stream_t*)p_this; p_stream->pf_add = Add; p_stream->pf_del = Del; @@ -69,48 +74,30 @@ static int Open( vlc_object_t *p_this ) /***************************************************************************** * Close: *****************************************************************************/ - static void Close( vlc_object_t * p_this ) { - sout_stream_t *p_stream = (sout_stream_t*)p_this; - + (void)p_this; } -struct sout_stream_id_t -{ - int i_d_u_m_m_y; -}; - - -static sout_stream_id_t * Add ( sout_stream_t *p_stream, es_format_t *p_fmt ) +static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) { - sout_stream_id_t *id; - - id = malloc( sizeof( sout_stream_id_t ) ); - id->i_d_u_m_m_y = 0; - - return id; + VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt); + return malloc( 1 ); } -static int Del ( sout_stream_t *p_stream, sout_stream_id_t *id ) +static int Del( sout_stream_t *p_stream, sout_stream_id_t *id ) { + VLC_UNUSED(p_stream); free( id ); return VLC_SUCCESS; } -static int Send ( sout_stream_t *p_stream, sout_stream_id_t *id, sout_buffer_t *p_buffer ) +static int Send( sout_stream_t *p_stream, sout_stream_id_t *id, + block_t *p_buffer ) { - sout_buffer_t *p_next; - - while( p_buffer ) - { - p_next = p_buffer->p_next; - - sout_BufferDelete( p_stream->p_sout, p_buffer ); - p_buffer = p_next; - } - + (void)p_stream; (void)id; + block_ChainRelease( p_buffer ); return VLC_SUCCESS; }