1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2001, 2002 the VideoLAN team
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
33 /*****************************************************************************
35 *****************************************************************************/
36 static int Open ( vlc_object_t * );
37 static void Close( vlc_object_t * );
40 set_description( _("Dummy stream output") );
41 set_shortname( _( "Dummy" ));
42 set_capability( "sout access", 0 );
43 set_category( CAT_SOUT );
44 set_subcategory( SUBCAT_SOUT_ACO );
45 add_shortcut( "dummy" );
46 set_callbacks( Open, Close );
50 /*****************************************************************************
52 *****************************************************************************/
53 static int Write( sout_access_out_t *, block_t * );
54 static int Seek ( sout_access_out_t *, off_t );
56 /*****************************************************************************
58 *****************************************************************************/
59 static int Open( vlc_object_t *p_this )
61 sout_access_out_t *p_access = (sout_access_out_t*)p_this;
63 p_access->p_sys = NULL;
64 p_access->pf_write = Write;
65 p_access->pf_seek = Seek;
67 msg_Dbg( p_access, "dummy stream output access opened" );
71 /*****************************************************************************
72 * Close: close the target
73 *****************************************************************************/
74 static void Close( vlc_object_t * p_this )
76 sout_access_out_t *p_access = (sout_access_out_t*)p_this;
77 msg_Dbg( p_access, "dummy stream output access closed" );
80 /*****************************************************************************
81 * Read: standard read on a file descriptor.
82 *****************************************************************************/
83 static int Write( sout_access_out_t *p_access, block_t *p_buffer )
86 block_t *b = p_buffer;
90 i_write += b->i_buffer;
95 block_ChainRelease( p_buffer );
100 /*****************************************************************************
101 * Seek: seek to a specific location in a file
102 *****************************************************************************/
103 static int Seek( sout_access_out_t *p_access, off_t i_pos )