/*****************************************************************************
* dummy.c
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: dummy.c,v 1.3 2003/03/03 14:21:08 gbazin Exp $
+ * Copyright (C) 2001, 2002 the VideoLAN team
+ * $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
*
* 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.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/sout.h>
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
#endif
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_sout.h>
+#include <vlc_block.h>
+
/*****************************************************************************
- * Exported prototypes
+ * Module descriptor
*****************************************************************************/
-static int Open ( vlc_object_t * );
-static void Close ( vlc_object_t * );
+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 ()
-static int Write( sout_access_out_t *, sout_buffer_t * );
-static int Seek ( sout_access_out_t *, off_t );
/*****************************************************************************
- * Module descriptor
+ * Exported prototypes
*****************************************************************************/
-vlc_module_begin();
- set_description( _("Dummy stream ouput") );
- set_capability( "sout access", 0 );
- add_shortcut( "dummy" );
- set_callbacks( Open, Close );
-vlc_module_end();
-
+static ssize_t Write( sout_access_out_t *, block_t * );
+static int Seek ( sout_access_out_t *, off_t );
/*****************************************************************************
* Open: open the file
p_access->pf_write = Write;
p_access->pf_seek = Seek;
- msg_Info( p_access, "dummy stream output access launched" );
+ msg_Dbg( p_access, "dummy stream output access opened" );
return VLC_SUCCESS;
}
static void Close( vlc_object_t * p_this )
{
sout_access_out_t *p_access = (sout_access_out_t*)p_this;
- msg_Info( p_access, "Close" );
+ 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, sout_buffer_t *p_buffer )
+static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
{
size_t i_write = 0;
+ block_t *b = p_buffer;
- do
+ while( b )
{
- sout_buffer_t *p_next;
- i_write += p_buffer->i_size;
- p_next = p_buffer->p_next;
- sout_BufferDelete( p_access->p_sout, p_buffer );
- p_buffer = p_next;
- } while( p_buffer );
+ i_write += b->i_buffer;
+
+ b = b->p_next;
+ }
- msg_Dbg( p_access, "Dummy Skipped: len:"I64Fd, (int64_t)i_write );
+ block_ChainRelease( p_buffer );
- return( i_write );
+ (void)p_access;
+ return i_write;
}
/*****************************************************************************
*****************************************************************************/
static int Seek( sout_access_out_t *p_access, off_t i_pos )
{
- msg_Dbg( p_access, "Seek: pos:"I64Fd, (int64_t)i_pos );
- return( 0 );
+ (void)p_access; (void)i_pos;
+ return 0;
}