Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

dummy.c

00001 /*****************************************************************************
00002  * dummy.c
00003  *****************************************************************************
00004  * Copyright (C) 2001, 2002 the VideoLAN team
00005  * $Id: dummy.c 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Laurent Aimar <[email protected]>
00008  *          Eric Petit <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 /*****************************************************************************
00026  * Preamble
00027  *****************************************************************************/
00028 #include <stdlib.h>
00029 
00030 #include <vlc/vlc.h>
00031 #include <vlc/sout.h>
00032 
00033 /*****************************************************************************
00034  * Module descriptor
00035  *****************************************************************************/
00036 static int  Open ( vlc_object_t * );
00037 static void Close( vlc_object_t * );
00038 
00039 vlc_module_begin();
00040     set_description( _("Dummy stream output") );
00041     set_shortname( N_( "Dummy" ));
00042     set_capability( "sout access", 0 );
00043     set_category( CAT_SOUT );
00044     set_subcategory( SUBCAT_SOUT_ACO );
00045     add_shortcut( "dummy" );
00046     set_callbacks( Open, Close );
00047 vlc_module_end();
00048 
00049 
00050 /*****************************************************************************
00051  * Exported prototypes
00052  *****************************************************************************/
00053 static int     Write( sout_access_out_t *, block_t * );
00054 static int     Seek ( sout_access_out_t *, off_t  );
00055 
00056 /*****************************************************************************
00057  * Open: open the file
00058  *****************************************************************************/
00059 static int Open( vlc_object_t *p_this )
00060 {
00061     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
00062 
00063     p_access->p_sys    = NULL;
00064     p_access->pf_write = Write;
00065     p_access->pf_seek  = Seek;
00066 
00067     msg_Dbg( p_access, "dummy stream output access opened" );
00068     return VLC_SUCCESS;
00069 }
00070 
00071 /*****************************************************************************
00072  * Close: close the target
00073  *****************************************************************************/
00074 static void Close( vlc_object_t * p_this )
00075 {
00076     sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
00077     msg_Dbg( p_access, "dummy stream output access closed" );
00078 }
00079 
00080 /*****************************************************************************
00081  * Read: standard read on a file descriptor.
00082  *****************************************************************************/
00083 static int Write( sout_access_out_t *p_access, block_t *p_buffer )
00084 {
00085     int64_t i_write = 0;
00086     block_t *b = p_buffer;
00087 
00088     while( b )
00089     {
00090         i_write += b->i_buffer;
00091 
00092         b = b->p_next;
00093     }
00094 
00095     block_ChainRelease( p_buffer );
00096 
00097     return i_write;
00098 }
00099 
00100 /*****************************************************************************
00101  * Seek: seek to a specific location in a file
00102  *****************************************************************************/
00103 static int Seek( sout_access_out_t *p_access, off_t i_pos )
00104 {
00105     return 0;
00106 }
00107 
00108 

Generated on Tue Dec 20 10:14:27 2005 for vlc-0.8.4a by  doxygen 1.4.2