]> git.sesse.net Git - vlc/blob - modules/access_output/dummy.c
Don't include config.h from the headers - refs #297.
[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
29 #ifdef HAVE_CONFIG_H
30 # include "config.h"
31 #endif
32
33 #include <vlc/vlc.h>
34 #include <vlc_sout.h>
35 #include <vlc_block.h>
36
37 /*****************************************************************************
38  * Module descriptor
39  *****************************************************************************/
40 static int  Open ( vlc_object_t * );
41 static void Close( vlc_object_t * );
42
43 vlc_module_begin();
44     set_description( _("Dummy stream output") );
45     set_shortname( _( "Dummy" ));
46     set_capability( "sout access", 0 );
47     set_category( CAT_SOUT );
48     set_subcategory( SUBCAT_SOUT_ACO );
49     add_shortcut( "dummy" );
50     set_callbacks( Open, Close );
51 vlc_module_end();
52
53
54 /*****************************************************************************
55  * Exported prototypes
56  *****************************************************************************/
57 static int     Write( sout_access_out_t *, block_t * );
58 static int     Seek ( sout_access_out_t *, off_t  );
59
60 /*****************************************************************************
61  * Open: open the file
62  *****************************************************************************/
63 static int Open( vlc_object_t *p_this )
64 {
65     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
66
67     p_access->p_sys    = NULL;
68     p_access->pf_write = Write;
69     p_access->pf_seek  = Seek;
70
71     msg_Dbg( p_access, "dummy stream output access opened" );
72     return VLC_SUCCESS;
73 }
74
75 /*****************************************************************************
76  * Close: close the target
77  *****************************************************************************/
78 static void Close( vlc_object_t * p_this )
79 {
80     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
81     msg_Dbg( p_access, "dummy stream output access closed" );
82 }
83
84 /*****************************************************************************
85  * Read: standard read on a file descriptor.
86  *****************************************************************************/
87 static int Write( sout_access_out_t *p_access, block_t *p_buffer )
88 {
89     int64_t i_write = 0;
90     block_t *b = p_buffer;
91
92     while( b )
93     {
94         i_write += b->i_buffer;
95
96         b = b->p_next;
97     }
98
99     block_ChainRelease( p_buffer );
100
101     return i_write;
102 }
103
104 /*****************************************************************************
105  * Seek: seek to a specific location in a file
106  *****************************************************************************/
107 static int Seek( sout_access_out_t *p_access, off_t i_pos )
108 {
109     return 0;
110 }
111
112