]> git.sesse.net Git - vlc/blob - modules/access_output/dummy.c
A bit of headers cleanup
[vlc] / modules / access_output / dummy.c
1 /*****************************************************************************
2  * dummy.c
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *          Eric Petit <titer@videolan.org>
9  *
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.
14  *
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.
19  *
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  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28 #include <stdlib.h>
29
30 #include <vlc/vlc.h>
31 #include <vlc_sout.h>
32 #include <vlc_block.h>
33
34 /*****************************************************************************
35  * Module descriptor
36  *****************************************************************************/
37 static int  Open ( vlc_object_t * );
38 static void Close( vlc_object_t * );
39
40 vlc_module_begin();
41     set_description( _("Dummy stream output") );
42     set_shortname( _( "Dummy" ));
43     set_capability( "sout access", 0 );
44     set_category( CAT_SOUT );
45     set_subcategory( SUBCAT_SOUT_ACO );
46     add_shortcut( "dummy" );
47     set_callbacks( Open, Close );
48 vlc_module_end();
49
50
51 /*****************************************************************************
52  * Exported prototypes
53  *****************************************************************************/
54 static int     Write( sout_access_out_t *, block_t * );
55 static int     Seek ( sout_access_out_t *, off_t  );
56
57 /*****************************************************************************
58  * Open: open the file
59  *****************************************************************************/
60 static int Open( vlc_object_t *p_this )
61 {
62     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
63
64     p_access->p_sys    = NULL;
65     p_access->pf_write = Write;
66     p_access->pf_seek  = Seek;
67
68     msg_Dbg( p_access, "dummy stream output access opened" );
69     return VLC_SUCCESS;
70 }
71
72 /*****************************************************************************
73  * Close: close the target
74  *****************************************************************************/
75 static void Close( vlc_object_t * p_this )
76 {
77     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
78     msg_Dbg( p_access, "dummy stream output access closed" );
79 }
80
81 /*****************************************************************************
82  * Read: standard read on a file descriptor.
83  *****************************************************************************/
84 static int Write( sout_access_out_t *p_access, block_t *p_buffer )
85 {
86     int64_t i_write = 0;
87     block_t *b = p_buffer;
88
89     while( b )
90     {
91         i_write += b->i_buffer;
92
93         b = b->p_next;
94     }
95
96     block_ChainRelease( p_buffer );
97
98     return i_write;
99 }
100
101 /*****************************************************************************
102  * Seek: seek to a specific location in a file
103  *****************************************************************************/
104 static int Seek( sout_access_out_t *p_access, off_t i_pos )
105 {
106     return 0;
107 }
108
109