]> git.sesse.net Git - vlc/blob - modules/stream_out/dummy.c
Compilation warning fixes and if-deffed unused functions/variables.
[vlc] / modules / stream_out / dummy.c
1 /*****************************************************************************
2  * dummy.c
3  *****************************************************************************
4  * Copyright (C) 2001, 2002 VideoLAN
5  * $Id: dummy.c,v 1.3 2003/12/07 19:06:21 jpsaman Exp $
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <stdlib.h>
28 #include <string.h>
29
30 #include <vlc/vlc.h>
31 #include <vlc/sout.h>
32
33 /*****************************************************************************
34  * Exported prototypes
35  *****************************************************************************/
36 static int      Open    ( vlc_object_t * );
37 static void     Close   ( vlc_object_t * );
38
39 static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * );
40 static int               Del ( sout_stream_t *, sout_stream_id_t * );
41 static int               Send( sout_stream_t *, sout_stream_id_t *, sout_buffer_t* );
42
43 /*****************************************************************************
44  * Module descriptor
45  *****************************************************************************/
46 vlc_module_begin();
47     set_description( _("Dummy stream") );
48     set_capability( "sout stream", 50 );
49     add_shortcut( "dummy" );
50     set_callbacks( Open, Close );
51 vlc_module_end();
52
53 /*****************************************************************************
54  * Open:
55  *****************************************************************************/
56 static int Open( vlc_object_t *p_this )
57 {
58     sout_stream_t   *p_stream = (sout_stream_t*)p_this;
59
60     p_stream->pf_add    = Add;
61     p_stream->pf_del    = Del;
62     p_stream->pf_send   = Send;
63
64     p_stream->p_sys     = NULL;
65
66     return VLC_SUCCESS;
67 }
68
69 /*****************************************************************************
70  * Close:
71  *****************************************************************************/
72
73 static void Close( vlc_object_t * p_this )
74 {
75 #if 0
76     sout_stream_t   *p_stream = (sout_stream_t*)p_this;
77 #endif
78 }
79
80 struct sout_stream_id_t
81 {
82     int i_d_u_m_m_y;
83 };
84
85
86 static sout_stream_id_t * Add      ( sout_stream_t *p_stream, es_format_t *p_fmt )
87 {
88     sout_stream_id_t *id;
89
90     id = malloc( sizeof( sout_stream_id_t ) );
91     id->i_d_u_m_m_y = 0;
92
93     return id;
94 }
95
96 static int     Del      ( sout_stream_t *p_stream, sout_stream_id_t *id )
97 {
98     free( id );
99
100     return VLC_SUCCESS;
101 }
102
103 static int     Send     ( sout_stream_t *p_stream, sout_stream_id_t *id, sout_buffer_t *p_buffer )
104 {
105     sout_buffer_t *p_next;
106
107     while( p_buffer )
108     {
109         p_next = p_buffer->p_next;
110
111         sout_BufferDelete( p_stream->p_sout, p_buffer );
112         p_buffer = p_next;
113     }
114
115     return VLC_SUCCESS;
116 }
117