dummy.c
上传用户:riyaled888
上传日期:2009-03-27
资源大小:7338k
文件大小:4k
- /*****************************************************************************
- * dummy.c
- *****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: dummy.c 7522 2004-04-27 16:35:15Z sam $
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
- /*****************************************************************************
- * Preamble
- *****************************************************************************/
- #include <stdlib.h>
- #include <vlc/vlc.h>
- #include <vlc/sout.h>
- /*****************************************************************************
- * Module descriptor
- *****************************************************************************/
- static int Open ( vlc_object_t * );
- static void Close( vlc_object_t * );
- vlc_module_begin();
- set_description( _("Dummy stream output") );
- set_capability( "sout access", 0 );
- add_shortcut( "dummy" );
- set_callbacks( Open, Close );
- vlc_module_end();
- /*****************************************************************************
- * Exported prototypes
- *****************************************************************************/
- static int 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 int Write( sout_access_out_t *p_access, block_t *p_buffer )
- {
- int64_t i_write = 0;
- block_t *b = p_buffer;
- while( b )
- {
- i_write += b->i_buffer;
- b = b->p_next;
- }
- block_ChainRelease( p_buffer );
- 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 )
- {
- return 0;
- }