* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_dummy.c,v 1.16 2002/03/01 00:33:18 massiot Exp $
+ * $Id: input_dummy.c,v 1.18 2002/06/01 12:31:58 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#include <string.h>
#include <errno.h>
-#include <videolan/vlc.h>
-
-#include "interface.h"
-#include "intf_playlist.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-#include "input_ext-dec.h"
-#include "input_ext-plugins.h"
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+#include <vlc/input.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
-static int DummyInit ( struct input_thread_s * );
-static int DummyOpen ( struct input_thread_s * );
-static void DummyClose ( struct input_thread_s * );
-static void DummyEnd ( struct input_thread_s * );
-static int DummyDemux ( struct input_thread_s * );
+static int DummyInit ( input_thread_t * );
+static int DummyOpen ( input_thread_t * );
+static void DummyClose ( input_thread_t * );
+static void DummyEnd ( input_thread_t * );
+static int DummyDemux ( input_thread_t * );
/*****************************************************************************
* access_sys_t: private input data
static int DummyOpen( input_thread_t * p_input )
{
p_input->stream.i_method = INPUT_METHOD_NONE;
+
/* Force dummy demux plug-in */
p_input->psz_demux = "vlc";
return( 0 );
/*****************************************************************************
* DummyInit: initialize the target, ie. parse the command
*****************************************************************************/
-static int DummyInit( struct input_thread_s *p_input )
+static int DummyInit( input_thread_t *p_input )
{
char * psz_name = p_input->psz_name;
int i_len = strlen( psz_name );
p_method = malloc( sizeof( struct demux_sys_s ) );
if( p_method == NULL )
{
- intf_ErrMsg( "input: out of memory" );
+ msg_Err( p_input, "out of memory" );
return( -1 );
}
/* Check for a "vlc:nop" command */
if( i_len == 3 && !strncasecmp( psz_name, "nop", 3 ) )
{
- intf_WarnMsg( 2, "input: command `nop'" );
+ msg_Info( p_input, "command `nop'" );
p_method->i_command = COMMAND_NOP;
return( 0 );
}
/* Check for a "vlc:quit" command */
if( i_len == 4 && !strncasecmp( psz_name, "quit", 4 ) )
{
- intf_WarnMsg( 2, "input: command `quit'" );
+ msg_Info( p_input, "command `quit'" );
p_method->i_command = COMMAND_QUIT;
return( 0 );
}
/* Check for a "vlc:loop" command */
if( i_len == 4 && !strncasecmp( psz_name, "loop", 4 ) )
{
- intf_WarnMsg( 2, "input: command `loop'" );
+ msg_Info( p_input, "command `loop'" );
p_method->i_command = COMMAND_LOOP;
return( 0 );
}
if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) )
{
i_arg = atoi( psz_name + 6 );
- intf_WarnMsg( 2, "input: command `pause %i'", i_arg );
+ msg_Info( p_input, "command `pause %i'", i_arg );
p_method->i_command = COMMAND_PAUSE;
p_method->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
return( 0 );
}
- intf_ErrMsg( "input error: unknown command `%s'", psz_name );
+ msg_Err( p_input, "unknown command `%s'", psz_name );
free( p_input->p_demux_data );
p_input->b_error = 1;
/*****************************************************************************
* DummyEnd: end the target, ie. do nothing
*****************************************************************************/
-static void DummyEnd( struct input_thread_s *p_input )
+static void DummyEnd( input_thread_t *p_input )
{
free( p_input->p_demux_data );
}
/*****************************************************************************
* DummyDemux: do what the command says
*****************************************************************************/
-static int DummyDemux( struct input_thread_s *p_input )
+static int DummyDemux( input_thread_t *p_input )
{
struct demux_sys_s * p_method = p_input->p_demux_data;
switch( p_method->i_command )
{
case COMMAND_QUIT:
+ p_input->p_vlc->b_die = 1;
p_input->b_die = 1;
break;
case COMMAND_LOOP:
- intf_PlaylistJumpto( p_main->p_playlist, -1 );
+ //playlist_Jumpto( p_input->p_vlc->p_playlist, -1 );
p_input->b_eof = 1;
break;