1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2001, 2002 VideoLAN
5 * $Id: dummy.c,v 1.1 2002/12/14 21:32:41 fenrir Exp $
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Eric Petit <titer@videolan.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
29 #include <sys/types.h>
36 #include <vlc/input.h>
41 #elif defined( _MSC_VER ) && defined( _WIN32 ) && !defined( UNDER_CE )
45 /*****************************************************************************
47 *****************************************************************************/
48 static int Open ( vlc_object_t * );
49 static void Close ( vlc_object_t * );
51 static int Write( sout_instance_t *, sout_buffer_t * );
52 static int Seek( sout_instance_t *, off_t );
54 /*****************************************************************************
56 *****************************************************************************/
58 set_description( _("Dummy stream ouput") );
59 set_capability( "sout access", 0 );
60 add_shortcut( "dummy" );
61 set_callbacks( Open, Close );
65 /*****************************************************************************
67 *****************************************************************************/
68 static int Open( vlc_object_t *p_this )
70 sout_instance_t *p_sout = (sout_instance_t*)p_this;
72 p_sout->i_method = SOUT_METHOD_NONE;
73 p_sout->p_access_data = NULL;
74 p_sout->pf_write = Write;
75 p_sout->pf_seek = Seek;
77 msg_Info( p_sout, "dummy stream output access launched" );
81 /*****************************************************************************
82 * Close: close the target
83 *****************************************************************************/
84 static void Close( vlc_object_t * p_this )
86 sout_instance_t *p_sout = (sout_instance_t*)p_this;
87 msg_Info( p_sout, "Close" );
90 /*****************************************************************************
91 * Read: standard read on a file descriptor.
92 *****************************************************************************/
93 static int Write( sout_instance_t *p_sout, sout_buffer_t *p_buffer )
99 sout_buffer_t *p_next;
100 i_write += p_buffer->i_size;
101 p_next = p_buffer->p_next;
102 sout_BufferDelete( p_sout, p_buffer );
106 msg_Dbg( p_sout, "Dummy Skipped: len:%d", (uint32_t)i_write );
111 /*****************************************************************************
112 * Seek: seek to a specific location in a file
113 *****************************************************************************/
114 static int Seek( sout_instance_t *p_sout, off_t i_pos )
116 msg_Dbg( p_sout, "Seek: pos:%lld", (int64_t)i_pos );