You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
3.8 KiB
115 lines
3.8 KiB
/*****************************************************************************
|
|
* dummy.c
|
|
*****************************************************************************
|
|
* Copyright (C) 2001, 2002 the VideoLAN team
|
|
* $Id$
|
|
*
|
|
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
|
|
* Eric Petit <titer@videolan.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (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
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU 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.
|
|
*****************************************************************************/
|
|
|
|
/*****************************************************************************
|
|
* Preamble
|
|
*****************************************************************************/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include "config.h"
|
|
#endif
|
|
|
|
#include <vlc_common.h>
|
|
#include <vlc_plugin.h>
|
|
#include <vlc_sout.h>
|
|
#include <vlc_block.h>
|
|
|
|
/*****************************************************************************
|
|
* Module descriptor
|
|
*****************************************************************************/
|
|
static int Open ( vlc_object_t * );
|
|
static void Close( vlc_object_t * );
|
|
|
|
vlc_module_begin ()
|
|
set_description( N_("Dummy stream output") )
|
|
set_shortname( N_( "Dummy" ))
|
|
set_capability( "sout access", 0 )
|
|
set_category( CAT_SOUT )
|
|
set_subcategory( SUBCAT_SOUT_ACO )
|
|
add_shortcut( "dummy" )
|
|
set_callbacks( Open, Close )
|
|
vlc_module_end ()
|
|
|
|
|
|
/*****************************************************************************
|
|
* Exported prototypes
|
|
*****************************************************************************/
|
|
static ssize_t Write( sout_access_out_t *, block_t * );
|
|
static int Seek ( sout_access_out_t *, off_t );
|
|
|
|
/*****************************************************************************
|
|
* Open: open the file
|
|
*****************************************************************************/
|
|
static int Open( vlc_object_t *p_this )
|
|
{
|
|
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
|
|
|
|
p_access->p_sys = NULL;
|
|
p_access->pf_write = Write;
|
|
p_access->pf_seek = Seek;
|
|
|
|
msg_Dbg( p_access, "dummy stream output access opened" );
|
|
return VLC_SUCCESS;
|
|
}
|
|
|
|
/*****************************************************************************
|
|
* Close: close the target
|
|
*****************************************************************************/
|
|
static void Close( vlc_object_t * p_this )
|
|
{
|
|
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
|
|
msg_Dbg( p_access, "dummy stream output access closed" );
|
|
}
|
|
|
|
/*****************************************************************************
|
|
* Read: standard read on a file descriptor.
|
|
*****************************************************************************/
|
|
static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
|
|
{
|
|
size_t i_write = 0;
|
|
block_t *b = p_buffer;
|
|
|
|
while( b )
|
|
{
|
|
i_write += b->i_buffer;
|
|
|
|
b = b->p_next;
|
|
}
|
|
|
|
block_ChainRelease( p_buffer );
|
|
|
|
(void)p_access;
|
|
return i_write;
|
|
}
|
|
|
|
/*****************************************************************************
|
|
* Seek: seek to a specific location in a file
|
|
*****************************************************************************/
|
|
static int Seek( sout_access_out_t *p_access, off_t i_pos )
|
|
{
|
|
(void)p_access; (void)i_pos;
|
|
return 0;
|
|
}
|
|
|
|
|
|
|