]> git.sesse.net Git - vlc/blobdiff - modules/access_output/dummy.c
Fix menu removal of accelerators. This has yet to be more FIXMEd (jpeg :D)
[vlc] / modules / access_output / dummy.c
index 9fb380860f1610ec372cee84b0c7521652f3cd9a..183e41d323d201768f15f7c47ac2da90b2f2bf09 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * dummy.c
  *****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
- * $Id: dummy.c,v 1.1 2002/12/14 21:32:41 fenrir 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>
-#elif defined( _MSC_VER ) && defined( _WIN32 ) && !defined( UNDER_CE )
-#   include <io.h>
-#endif
 
-/*****************************************************************************
- * Exported prototypes
- *****************************************************************************/
-static int     Open   ( vlc_object_t * );
-static void    Close  ( vlc_object_t * );
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-static int     Write( sout_instance_t *, sout_buffer_t * );
-static int     Seek( sout_instance_t *, off_t  );
+#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( _("Dummy stream ouput") );
+    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_instance_t     *p_sout = (sout_instance_t*)p_this;
+    sout_access_out_t   *p_access = (sout_access_out_t*)p_this;
 
-    p_sout->i_method        = SOUT_METHOD_NONE;
-    p_sout->p_access_data   = NULL;
-    p_sout->pf_write        = Write;
-    p_sout->pf_seek         = Seek;
+    p_access->p_sys    = NULL;
+    p_access->pf_write = Write;
+    p_access->pf_seek  = Seek;
 
-    msg_Info( p_sout, "dummy stream output access launched" );
+    msg_Dbg( p_access, "dummy stream output access opened" );
     return VLC_SUCCESS;
 }
 
@@ -83,39 +78,38 @@ static int Open( vlc_object_t *p_this )
  *****************************************************************************/
 static void Close( vlc_object_t * p_this )
 {
-    sout_instance_t     *p_sout = (sout_instance_t*)p_this;
-    msg_Info( p_sout, "Close" );
+    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_instance_t *p_sout, 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_sout, p_buffer );
-        p_buffer = p_next;
-    } while( p_buffer );
+        i_write += b->i_buffer;
+
+        b = b->p_next;
+    }
 
-    msg_Dbg( p_sout, "Dummy Skipped: len:%d", (uint32_t)i_write );
+    block_ChainRelease( p_buffer );
 
-    return( i_write );
+    (void)p_access;
+    return i_write;
 }
 
 /*****************************************************************************
  * Seek: seek to a specific location in a file
  *****************************************************************************/
-static int Seek( sout_instance_t *p_sout, off_t i_pos )
+static int Seek( sout_access_out_t *p_access, off_t i_pos )
 {
-    msg_Dbg( p_sout, "Seek: pos:%lld", (int64_t)i_pos );
-    return( 0 );
+    (void)p_access; (void)i_pos;
+    return 0;
 }
 
 
-