dummy.c 3.1 KB
Newer Older
1
/*****************************************************************************
2
 * dummy.c: dummy stream output module
3
 *****************************************************************************
4
 * Copyright (C) 2003-2004 VLC authors and VideoLAN
5
 * $Id$
6 7 8
 *
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
 *
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
19 20 21
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23 24 25 26 27
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/

28 29 30 31
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

32
#include <vlc_common.h>
33
#include <vlc_plugin.h>
Clément Stenac's avatar
Clément Stenac committed
34 35
#include <vlc_block.h>
#include <vlc_sout.h>
36 37 38 39 40 41

/*****************************************************************************
 * Exported prototypes
 *****************************************************************************/
static int      Open    ( vlc_object_t * );

42
static sout_stream_id_sys_t *Add( sout_stream_t *, const es_format_t * );
43
static void              Del ( sout_stream_t *, sout_stream_id_sys_t * );
44
static int               Send( sout_stream_t *, sout_stream_id_sys_t *, block_t* );
45 46 47 48

/*****************************************************************************
 * Module descriptor
 *****************************************************************************/
49 50 51
vlc_module_begin ()
    set_description( N_("Dummy stream output") )
    set_capability( "sout stream", 50 )
52
    add_shortcut( "dummy", "drop" )
53
    set_callbacks( Open, NULL )
54
vlc_module_end ()
55 56 57 58 59 60

/*****************************************************************************
 * Open:
 *****************************************************************************/
static int Open( vlc_object_t *p_this )
{
61
    sout_stream_t *p_stream = (sout_stream_t*)p_this;
62 63 64 65 66 67 68 69 70 71

    p_stream->pf_add    = Add;
    p_stream->pf_del    = Del;
    p_stream->pf_send   = Send;

    p_stream->p_sys     = NULL;

    return VLC_SUCCESS;
}

72
static sout_stream_id_sys_t *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
73
{
Rafaël Carré's avatar
Rafaël Carré committed
74
    VLC_UNUSED(p_stream); VLC_UNUSED(p_fmt);
75
    return malloc( 1 );
76 77
}

78
static void Del( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
79
{
Rafaël Carré's avatar
Rafaël Carré committed
80
    VLC_UNUSED(p_stream);
81 82 83
    free( id );
}

84
static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
85
                 block_t *p_buffer )
86
{
Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
87
    (void)p_stream; (void)id;
88
    block_ChainRelease( p_buffer );
89 90 91
    return VLC_SUCCESS;
}