Commit 214396bc authored by Sam Hocevar's avatar Sam Hocevar

  * Put most builtins in plugins again due to performances issues (more
    about this in a forthcoming post here).
  * Fixed the painfully slow build process (at last!).
  * Moved the null plugin together with the dummy one.
  * Added new dummy input plugin.

   More on the dummy input plugin: we'll use it to insert commands in
  the playlist. Currently implemented are the "quit" and "pause" functions,
  here are examples on how they are used:

    vlc file.mpeg vlc:quit                # exit after file.mpeg has been read.

    vlc file1.mpeg vlc:pause:3 file2.mpeg # pause 3 seconds before playing
                                          # the next file.

   From now we can more efficiently benchmark vlc. For instance, to test
  the video output changes I am doing, I use such a command:

    time vlc -I dummy --noaudio file.mpeg vlc:quit

   Future extentions might include more interesting stuff like "switch
  to full screen", "repeat next file 3 times", "switch to SDL video
  output"...
parent 8dee1230
......@@ -4,7 +4,9 @@
HEAD
* Nothing yet.
* Put most builtins in plugins again due to performances issues.
* Fixed the painfully slow build process (at last!).
* Added new dummy input plugin.
0.2.80
Tue, 5 Jun 2001 04:41:06 +0200
......
......@@ -16,21 +16,21 @@ PLUGINS_DIR := alsa beos darwin directx dsp dummy \
downmix idct imdct \
macosx mga \
motion \
mpeg null qt sdl \
mpeg qt sdl \
text x11 yuv
#
# All possible plugin objects
#
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin directx/directx \
dsp/dsp dummy/dummy dvd/dvd esd/esd fb/fb ggi/ggi \
glide/glide gtk/gnome gtk/gtk \
dsp/dsp dummy/dummy dummy/null dvd/dvd esd/esd fb/fb \
ggi/ggi glide/glide gtk/gnome gtk/gtk \
downmix/downmix downmix/downmixsse downmix/downmix3dn \
idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
imdct/imdct imdct/imdct3dn imdct/imdctsse \
macosx/macosx mga/mga \
motion/motion motion/motionmmx motion/motionmmxext \
mpeg/es mpeg/ps mpeg/ts null/null qt/qt sdl/sdl \
mpeg/es mpeg/ps mpeg/ts qt/qt sdl/sdl \
text/ncurses text/rc x11/x11 x11/xvideo yuv/yuv yuv/yuvmmx
#
......
......@@ -119,7 +119,8 @@ PROGRAM_VERSION=@VLC_VERSION@
# DEFINE will contain some of the constants definitions decided in Makefile,
# including SYS_xx. It will be passed to C compiler.
DEFINE += -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
DEFINE += $(DEFINE_CONSTANTS)
# On Linux activate 64-bit off_t (by default under BSD)
ifneq (,$(findstring linux,$(SYS)))
......@@ -150,7 +151,8 @@ endif
# Libraries needed by built-in modules
#
ifneq (,$(BUILTINS))
LIB += $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
LIB += $(LIB_BUILTINS)
endif
#
......
This diff is collapsed.
......@@ -148,7 +148,8 @@ ARCH=${host_cpu}
dnl
dnl default modules
dnl
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
BUILTINS="${BUILTINS} es ps ts"
PLUGINS="${PLUGINS} yuv idct idctclassic motion imdct downmix"
dnl
dnl Accelerated modules
......@@ -248,9 +249,9 @@ dnl
AC_ARG_ENABLE(mmx,
[ --disable-mmx Disable MMX optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ],
PLUGINS="${PLUGINS} ${ACCEL_PLUGINS}"; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
PLUGINS="${PLUGINS} ${ACCEL_PLUGINS}"; fi ])
dnl
dnl AltiVec acceleration
......@@ -258,7 +259,7 @@ dnl
AC_ARG_ENABLE(altivec,
[ --enable-altivec Enable altivec optimizations (default disabled since it is broken)],
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
BUILTINS="${BUILTINS} idctaltivec"
PLUGINS="${PLUGINS} idctaltivec"
LIB_IDCTALTIVEC="-framework vecLib"
fi ])
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
......
###############################################################################
# vlc (VideoLAN Client) dummy module makefile
# vlc (VideoLAN Client) dummy and null module makefile
# (c)2001 VideoLAN
###############################################################################
......@@ -7,9 +7,13 @@
# Objects
#
PLUGIN_C = dummy.o aout_dummy.o vout_dummy.o intf_dummy.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
PLUGIN_NULL = null.o
PLUGIN_DUMMY = dummy.o aout_dummy.o vout_dummy.o intf_dummy.o input_dummy.o
BUILTIN_NULL = $(PLUGIN_NULL:%.o=BUILTIN_%.o)
BUILTIN_DUMMY = $(PLUGIN_DUMMY:%.o=BUILTIN_%.o)
PLUGIN_C = $(PLUGIN_NULL) $(PLUGIN_DUMMY)
BUILTIN_C = $(BUILTIN_NULL) $(BUILTIN_DUMMY)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
#
......@@ -22,10 +26,17 @@ include ../../Makefile.modules
# Real targets
#
../../lib/dummy.so: $(PLUGIN_C)
../../lib/null.so: $(PLUGIN_NULL)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/dummy.a: $(BUILTIN_C)
../../lib/null.a: $(BUILTIN_NULL)
ar r $@ $^
$(RANLIB) $@
../../lib/dummy.so: $(PLUGIN_DUMMY)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/dummy.a: $(BUILTIN_DUMMY)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* dummy.c : dummy plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: dummy.c,v 1.9 2001/05/30 17:03:12 sam Exp $
* $Id: dummy.c,v 1.10 2001/06/07 01:10:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -42,9 +42,10 @@
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
void _M( vout_getfunctions )( function_list_t * p_function_list );
void _M( intf_getfunctions )( function_list_t * p_function_list );
void _M( input_getfunctions ) ( function_list_t * p_function_list );
void _M( aout_getfunctions ) ( function_list_t * p_function_list );
void _M( vout_getfunctions ) ( function_list_t * p_function_list );
void _M( intf_getfunctions ) ( function_list_t * p_function_list );
/*****************************************************************************
* Build configuration tree.
......@@ -56,6 +57,7 @@ MODULE_CONFIG_STOP
MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_INPUT
| MODULE_CAPABILITY_AOUT
| MODULE_CAPABILITY_VOUT
| MODULE_CAPABILITY_INTF;
......@@ -63,6 +65,7 @@ MODULE_INIT_START
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( input_getfunctions )( &p_module->p_functions->input );
_M( aout_getfunctions )( &p_module->p_functions->aout );
_M( vout_getfunctions )( &p_module->p_functions->vout );
_M( intf_getfunctions )( &p_module->p_functions->intf );
......
/*****************************************************************************
* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input_dummy.c,v 1.1 2001/06/07 01:10:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*****************************************************************************/
#define MODULE_NAME dummy
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#ifdef STRNCASECMP_IN_STRINGS_H
# include <strings.h>
#endif
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "interface.h"
#include "intf_msg.h"
#include "main.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "input_ext-dec.h"
#include "input.h"
#include "modules.h"
#include "modules_export.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int DummyProbe ( probedata_t * );
static void DummyOpen ( struct input_thread_s * );
static void DummyClose ( struct input_thread_s * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void _M( input_getfunctions )( function_list_t * p_function_list )
{
#define input p_function_list->functions.input
p_function_list->pf_probe = DummyProbe;
input.pf_init = NULL; /* Not needed, open is called first */
input.pf_open = DummyOpen;
input.pf_close = DummyClose;
input.pf_end = NULL;
input.pf_set_area = NULL;
input.pf_read = NULL;
input.pf_demux = NULL;
input.pf_new_packet = NULL;
input.pf_new_pes = NULL;
input.pf_delete_packet = NULL;
input.pf_delete_pes = NULL;
input.pf_rewind = NULL;
input.pf_seek = NULL;
#undef input
}
/*
* Data reading functions
*/
/*****************************************************************************
* DummyProbe: verifies that the input is a vlc command
*****************************************************************************/
static int DummyProbe( probedata_t *p_data )
{
input_thread_t *p_input = (input_thread_t *)p_data;
char *psz_name = p_input->p_source;
if( TestMethod( INPUT_METHOD_VAR, "dummy" ) )
{
return( 999 );
}
if( ( strlen(psz_name) > 4 ) && !strncasecmp( psz_name, "vlc:", 4 ) )
{
/* If the user specified "vlc:" then it's probably a file */
return( 100 );
}
return( 1 );
}
/*****************************************************************************
* DummyOpen: open the target, ie. do what the command says
*****************************************************************************/
static void DummyOpen( input_thread_t * p_input )
{
char *psz_name = p_input->p_source;
int i_len = strlen( psz_name );
int i_arg;
/* XXX: Tell the input layer to quit immediately, there must
* be a nicer way to do this. */
p_input->b_error = 1;
if( ( i_len <= 4 ) || strncasecmp( psz_name, "vlc:", 4 ) )
{
/* If the user specified "vlc:" then it's probably a file */
return;
}
/* We don't need the "vlc:" stuff any more */
psz_name += 4;
i_len -= 4;
/* Check for a "vlc:quit" command */
if( i_len == 4 && !strncasecmp( psz_name, "quit", 4 ) )
{
intf_WarnMsg( 1, "input: playlist command `quit'" );
p_main->p_intf->b_die = 1;
return;
}
/* Check for a "vlc:pause:***" command */
if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) )
{
i_arg = atoi( psz_name + 6 );
intf_WarnMsg( 1, "input: playlist command `pause %i'", i_arg );
intf_FlushMsg();
msleep( i_arg * 1000000 );
return;
}
intf_ErrMsg( "input error: unknown playlist command `%s'", psz_name );
}
/*****************************************************************************
* DummyClose: close the target, ie. do nothing
*****************************************************************************/
static void DummyClose( input_thread_t * p_input )
{
return;
}
......@@ -2,7 +2,7 @@
* null.c : NULL module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: null.c,v 1.8 2001/06/03 12:47:21 sam Exp $
* $Id: null.c,v 1.1 2001/06/07 01:10:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
###############################################################################
# vlc (VideoLAN Client) null module makefile
# (c)2001 VideoLAN
###############################################################################
#
# Objects
#
PLUGIN_C = null.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
#
# Virtual targets
#
include ../../Makefile.modules
#
# Real targets
#
../../lib/null.so: $(PLUGIN_C)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/null.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.118 2001/05/31 12:45:39 sam Exp $
* $Id: input.c,v 1.119 2001/06/07 01:10:33 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -397,6 +397,8 @@ static int InitThread( input_thread_t * p_input )
p_input->pf_rewind = f.pf_rewind;
p_input->pf_seek = f.pf_seek;
#undef f
/* We found the appropriate plugin, open the target */
p_input->pf_open( p_input );
if( p_input->b_error )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment