root/modules/stream_out/dummy.c
| Revision 086b7b12b055aecf355e66c916f8cf531e16adec, 3.4 kB (checked in by Laurent Aimar <fenrir@videolan.org>, 3 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 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 | #ifdef HAVE_CONFIG_H |
| 29 | # include "config.h" |
| 30 | #endif |
| 31 | |
| 32 | #include <vlc_common.h> |
| 33 | #include <vlc_plugin.h> |
| 34 | #include <vlc_block.h> |
| 35 | #include <vlc_sout.h> |
| 36 | |
| 37 | /***************************************************************************** |
| 38 | * Exported prototypes |
| 39 | *****************************************************************************/ |
| 40 | static int Open ( vlc_object_t * ); |
| 41 | static void Close ( vlc_object_t * ); |
| 42 | |
| 43 | static sout_stream_id_t *Add ( sout_stream_t *, es_format_t * ); |
| 44 | static int Del ( sout_stream_t *, sout_stream_id_t * ); |
| 45 | static int Send( sout_stream_t *, sout_stream_id_t *, block_t* ); |
| 46 | |
| 47 | /***************************************************************************** |
| 48 | * Module descriptor |
| 49 | *****************************************************************************/ |
| 50 | vlc_module_begin(); |
| 51 | set_description( N_("Dummy stream output") ); |
| 52 | set_capability( "sout stream", 50 ); |
| 53 | add_shortcut( "dummy" ); |
| 54 | add_shortcut( "drop" ); |
| 55 | set_callbacks( Open, Close ); |
| 56 | vlc_module_end(); |
| 57 | |
| 58 | /***************************************************************************** |
| 59 | * Open: |
| 60 | *****************************************************************************/ |
| 61 | static int Open( vlc_object_t *p_this ) |
| 62 | { |
| 63 | sout_stream_t *p_stream = (sout_stream_t*)p_this; |
| 64 | |
| 65 | p_stream->pf_add = Add; |
| 66 | p_stream->pf_del = Del; |
| 67 | p_stream->pf_send = Send; |
| 68 | |
| 69 | p_stream->p_sys = NULL; |
| 70 | |
| 71 | return VLC_SUCCESS; |
| 72 | } |
| 73 | |
| 74 | /***************************************************************************** |
| 75 | * Close: |
| 76 | *****************************************************************************/ |
| 77 | static void Close( vlc_object_t * p_this ) |
| 78 | { |
| 79 | (void)p_this; |
| 80 | } |
| 81 | |
| 82 | static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) |
| 83 | { |
| 84 | VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt); |
| 85 | return malloc( 1 ); |
| 86 | } |
| 87 | |
| 88 | static int Del( sout_stream_t *p_stream, sout_stream_id_t *id ) |
| 89 | { |
| 90 | VLC_UNUSED(p_stream); |
| 91 | free( id ); |
| 92 | |
| 93 | return VLC_SUCCESS; |
| 94 | } |
| 95 | |
| 96 | static int Send( sout_stream_t *p_stream, sout_stream_id_t *id, |
| 97 | block_t *p_buffer ) |
| 98 | { |
| 99 | (void)p_stream; (void)id; |
| 100 | block_ChainRelease( p_buffer ); |
| 101 | return VLC_SUCCESS; |
| 102 | } |
| 103 |
Note: See TracBrowser for help on using the browser.
