]> git.sesse.net Git - vlc/blob - modules/stream_out/dummy.c
d4ae94fc851e7f25150655600c764863e646a453
[vlc] / modules / stream_out / dummy.c
1 /*****************************************************************************
2  * dummy.c: dummy stream output module
3  *****************************************************************************
4  * Copyright (C) 2003-2004 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27
28 #include <vlc/vlc.h>
29 #include <vlc_block.h>
30 #include <vlc_sout.h>
31
32 /*****************************************************************************
33  * Exported prototypes
34  *****************************************************************************/
35 static int      Open    ( vlc_object_t * );
36 static void     Close   ( vlc_object_t * );
37
38 static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
39 static int               Del ( sout_stream_t *, sout_stream_id_t * );
40 static int               Send( sout_stream_t *, sout_stream_id_t *, block_t* );
41
42 /*****************************************************************************
43  * Module descriptor
44  *****************************************************************************/
45 vlc_module_begin();
46     set_description( _("Dummy stream output") );
47     set_capability( "sout stream", 50 );
48     add_shortcut( "dummy" );
49     set_callbacks( Open, Close );
50 vlc_module_end();
51
52 /*****************************************************************************
53  * Open:
54  *****************************************************************************/
55 static int Open( vlc_object_t *p_this )
56 {
57     sout_stream_t *p_stream = (sout_stream_t*)p_this;
58
59     p_stream->pf_add    = Add;
60     p_stream->pf_del    = Del;
61     p_stream->pf_send   = Send;
62
63     p_stream->p_sys     = NULL;
64
65     return VLC_SUCCESS;
66 }
67
68 /*****************************************************************************
69  * Close:
70  *****************************************************************************/
71 static void Close( vlc_object_t * p_this )
72 {
73 #if 0
74     sout_stream_t   *p_stream = (sout_stream_t*)p_this;
75 #endif
76 }
77
78 struct sout_stream_id_t
79 {
80     int i_d_u_m_m_y;
81 };
82
83 static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
84 {
85     sout_stream_id_t *id;
86
87     id = malloc( sizeof( sout_stream_id_t ) );
88     id->i_d_u_m_m_y = 0;
89
90     return id;
91 }
92
93 static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
94 {
95     free( id );
96
97     return VLC_SUCCESS;
98 }
99
100 static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
101                  block_t *p_buffer )
102 {
103     block_ChainRelease( p_buffer );
104     return VLC_SUCCESS;
105 }
106