E: dae@via.ecp.fr
C: dae
D: FreeBSD port and tests
+D: KDE interface
N: Markus Kuespert
E: ltlBeBoy@beosmail.com
#===================#
HEAD
+ * Fixed a few warnings with gcc 3.0.
+ * aout and vout are now allocated in banks, making it possible to have
+ several of them at the same time.
+ * configure now checks for MMX and MMX EXT support in the assembler.
+ * Removed all MMX code from the main program and moved it to the
+ existing idct modules (Closes: Debian bug #96036).
+ * KDE interface.
* FreeBSD CSS decryption support.
* Fixed a segfault in TS input (psi packets with adaptation field).
* Corrected vlc-howto.sgml thanks to Arnaud Gomes-do-Vale
#end of optimisations
endif
-# Optional MMX optimizations for x86
-ifneq (,$(findstring mmx,$(ARCH)))
-CFLAGS += -DHAVE_MMX
-endif
-
#
# C compiler flags: dependancies
#
rm -f conftest*
CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
-echo $ac_n "checking if \$CC groks -rdynamic without complaining too much""... $ac_c" 1>&6
-echo "configure:2842: checking if \$CC groks -rdynamic without complaining too much" >&5
+echo $ac_n "checking if \$CC miserably fails with the -rdynamic flag""... $ac_c" 1>&6
+echo "configure:2842: checking if \$CC miserably fails with the -rdynamic flag" >&5
cat > conftest.$ac_ext <<EOF
#line 2844 "configure"
#include "confdefs.h"
if { (eval echo configure:2851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
LCFLAGS="${LCFLAGS} -rdynamic"
- echo "$ac_t""yes" 1>&6
+ echo "$ac_t""no" 1>&6
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- echo "$ac_t""no" 1>&6
+ echo "$ac_t""yes" 1>&6
fi
rm -f conftest*
ARCH=${host_cpu}
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
+
case x$host_os in
- xbeos|xnto-qnx)
- ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
- ;;
xmingw32msvc)
- ACCEL_PLUGINS="idctmmx idctmmxext motionmmx motionmmxext"
+ MMX_PLUGINS="idctmmx motionmmx"
;;
*)
- ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
+ MMX_PLUGINS="yuvmmx idctmmx motionmmx"
;;
esac
+echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
+echo "configure:3178: checking if \$CC groks MMX inline assembly" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3180 "configure"
+#include "confdefs.h"
+void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ACCEL_PLUGINS="${ACCEL_PLUGINS} ${MMX_PLUGINS}"
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
+echo $ac_n "checking if \$CC groks MMX EXT (SSE) inline assembly""... $ac_c" 1>&6
+echo "configure:3200: checking if \$CC groks MMX EXT (SSE) inline assembly" >&5
+cat > conftest.$ac_ext <<EOF
+#line 3202 "configure"
+#include "confdefs.h"
+void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:3209: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ACCEL_PLUGINS="${ACCEL_PLUGINS} idctmmxext motionmmxext"
+ echo "$ac_t""yes" 1>&6
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ echo "$ac_t""no" 1>&6
+fi
+rm -f conftest*
+
for ac_hdr in sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3183: checking for $ac_hdr" >&5
+echo "configure:3225: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3188 "configure"
+#line 3230 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3219: checking for $ac_hdr" >&5
+echo "configure:3261: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3224 "configure"
+#line 3266 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3229: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
BSD_DVD_STRUCT=0
cat > conftest.$ac_ext <<EOF
-#line 3257 "configure"
+#line 3299 "configure"
#include "confdefs.h"
#include <sys/dvdio.h>
EOF
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3275 "configure"
+#line 3317 "configure"
#include "confdefs.h"
#include <sys/cdio.h>
EOF
fi
cat > conftest.$ac_ext <<EOF
-#line 3299 "configure"
+#line 3341 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
# Extract the first word of "esd-config", so it can be a program name with args.
set dummy esd-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3450: checking for $ac_word" >&5
+echo "configure:3492: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3515: checking for $ac_hdr" >&5
+echo "configure:3557: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3520 "configure"
+#line 3562 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3596: checking for $ac_hdr" >&5
+echo "configure:3638: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3601 "configure"
+#line 3643 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3644: checking for $ac_hdr" >&5
+echo "configure:3686: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3649 "configure"
+#line 3691 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3754: checking for $ac_word" >&5
+echo "configure:3796: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3814: checking for $ac_hdr" >&5
+echo "configure:3856: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3819 "configure"
+#line 3861 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3876: checking for $ac_hdr" >&5
+echo "configure:3918: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3881 "configure"
+#line 3923 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:3924: checking for sys/asoundlib.h" >&5
+echo "configure:3966: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3929 "configure"
+#line 3971 "configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:3951: checking for main in -lasound" >&5
+echo "configure:3993: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3959 "configure"
+#line 4001 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
dnl Check for -rdynamic flag
CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
-AC_MSG_CHECKING([if \$CC groks -rdynamic without complaining too much])
+AC_MSG_CHECKING([if \$CC miserably fails with the -rdynamic flag])
AC_TRY_COMPILE([],,
LCFLAGS="${LCFLAGS} -rdynamic"
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+ AC_MSG_RESULT(no), AC_MSG_RESULT(yes))
dnl End of the bizarre compilation tests
CFLAGS="${save_CFLAGS}"
dnl default modules
dnl
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion"
+
+dnl
+dnl Accelerated modules
+dnl
case x$host_os in
- xbeos|xnto-qnx)
- ACCEL_PLUGINS="yuvmmx idctmmx motionmmx"
- ;;
xmingw32msvc)
- ACCEL_PLUGINS="idctmmx idctmmxext motionmmx motionmmxext"
+ MMX_PLUGINS="idctmmx motionmmx"
;;
*)
- ACCEL_PLUGINS="yuvmmx idctmmx idctmmxext motionmmx motionmmxext"
+ MMX_PLUGINS="yuvmmx idctmmx motionmmx"
;;
esac
+AC_MSG_CHECKING([if \$CC groks MMX inline assembly])
+AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],,
+ ACCEL_PLUGINS="${ACCEL_PLUGINS} ${MMX_PLUGINS}"
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+
+AC_MSG_CHECKING([if \$CC groks MMX EXT (SSE) inline assembly])
+AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
+ ACCEL_PLUGINS="${ACCEL_PLUGINS} idctmmxext motionmmxext"
+ AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+
dnl
dnl DVD module: check for DVD ioctls
dnl
+vlc (0.2.73-2) unstable; urgency=low
+
+ * We now build without MMX in the main application (Closes: #96036).
+
+ -- Samuel Hocevar <sam@zoy.org> Fri, 4 May 2001 07:13:04 +0200
+
vlc (0.2.73-1) unstable; urgency=low
* New upstream release.
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: audio_output.h,v 1.33 2001/05/01 04:18:17 sam Exp $
+ * $Id: audio_output.h,v 1.34 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+/*****************************************************************************
+ * aout_bank_t, p_aout_bank (global variable)
+ *****************************************************************************
+ * This global variable is accessed by any function using the audio output.
+ *****************************************************************************/
+typedef struct
+{
+ /* Array to all the audio outputs */
+ struct aout_thread_s *pp_aout[ AOUT_MAX_THREADS ];
+
+ int i_count;
+ vlc_mutex_t lock; /* Global lock */
+
+} aout_bank_t;
+
+extern aout_bank_t *p_aout_bank;
+
/*****************************************************************************
* aout_increment_t
*****************************************************************************
int i_fd;
/* The current volume */
- int i_vol;
+ int i_volume;
+ int i_savedvolume;
/* Format of the audio output samples */
int i_format;
/* Number of channels */
/*****************************************************************************
* Prototypes
*****************************************************************************/
+void aout_InitBank ( void );
+void aout_EndBank ( void );
+
aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *, int * );
* beos_specific.h: BeOS specific features
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: beos_specific.h,v 1.5 2001/04/12 01:52:45 sam Exp $
+ * $Id: beos_specific.h,v 1.6 2001/05/06 04:32:02 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
*
extern "C" {
#endif
-void system_Create ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
-void system_Destroy( void );
+void system_Init ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
+void system_End ( void );
char * system_GetProgramPath( void );
#ifdef __cplusplus
* Audio configuration
*****************************************************************************/
+/* Maximum number of audio output threads */
+#define AOUT_MAX_THREADS 10
+
/* Environment variable containing the audio output method */
#define AOUT_METHOD_VAR "vlc_aout"
* Video configuration
*****************************************************************************/
+/* Maximum number of video output threads */
+#define VOUT_MAX_THREADS 10
+
/*
* Default settings for video output threads
*/
* darwin_specific.h: Darwin specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: darwin_specific.h,v 1.1 2001/04/12 01:52:45 sam Exp $
+ * $Id: darwin_specific.h,v 1.2 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/*****************************************************************************
* Prototypes
*****************************************************************************/
-void system_Create ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
-void system_Destroy( void );
+void system_Init ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
+void system_End ( void );
char * system_GetProgramPath( void );
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: main.h,v 1.17 2001/05/01 04:18:17 sam Exp $
+ * $Id: main.h,v 1.18 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
boolean_t b_channels; /* is channel changing supported ? */
/* Unique threads */
- p_vout_thread_t p_vout; /* video output thread */
- p_aout_thread_t p_aout; /* audio output thread */
p_intf_thread_t p_intf; /* main interface thread */
/* Shared data - these structures are accessed directly from p_main by
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.22 2001/05/01 04:18:17 sam Exp $
+ * $Id: modules.h,v 1.23 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
#endif
/*****************************************************************************
- * bank_t, p_bank (global variable)
+ * module_bank_t, p_module_bank (global variable)
*****************************************************************************
* This global variable is accessed by any function using modules.
*****************************************************************************/
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful it
is to design thread-safe linked lists. */
-} bank_t;
+} module_bank_t;
-extern bank_t *p_bank;
+extern module_bank_t *p_module_bank;
/*****************************************************************************
* Module #defines.
/* IDCT plugin */
struct
{
- void ( * pf_init ) ( struct vdec_thread_s * );
+ void ( * pf_idct_init ) ( struct vdec_thread_s * );
void ( * pf_sparse_idct ) ( struct vdec_thread_s *,
dctelem_t *, int );
void ( * pf_idct ) ( struct vdec_thread_s *,
dctelem_t *, int );
void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] );
+
+ void ( * pf_vdec_init ) ( struct vdec_thread_s * );
+ void ( * pf_decode_mb_c ) ( struct vdec_thread_s *,
+ struct macroblock_s * );
+ void ( * pf_decode_mb_bw ) ( struct vdec_thread_s *,
+ struct macroblock_s * );
} idct;
/* YUV transformation plugin */
* modules.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: netutils.h,v 1.11 2001/04/27 18:07:56 henri Exp $
+ * $Id: netutils.h,v 1.12 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org>
*****************************************************************************/
int network_BuildLocalAddr ( struct sockaddr_in *, int, char * );
int network_BuildRemoteAddr( struct sockaddr_in *, char * );
-int network_ChannelJoin( int i_channel_id );
-int network_ChannelCreate( void );
+int network_ChannelJoin ( int i_channel_id );
+int network_ChannelCreate ( void );
* video_decoder.h : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_decoder.h,v 1.22 2001/01/13 12:57:19 sam Exp $
+ * $Id: video_decoder.h,v 1.23 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
/* idct iformations */
dctelem_t p_pre_idct[64*64];
+ /* Macroblock copy functions */
+ void ( * pf_vdec_init ) ( struct vdec_thread_s * );
+ void ( * pf_decode_mb_c ) ( struct vdec_thread_s *, struct macroblock_s * );
+ void ( * pf_decode_mb_bw )( struct vdec_thread_s *, struct macroblock_s * );
+
/* Input properties */
struct vpar_thread_s * p_vpar; /* video_parser thread */
-#ifndef HAVE_MMX
- /* Lookup tables */
- u8 pi_crop_buf[VDEC_CROPRANGE];
- u8 * pi_crop;
-#endif
} vdec_thread_t;
/*****************************************************************************
* video_fifo.h : FIFO for the pool of video_decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_fifo.h,v 1.4 2001/02/23 14:07:25 massiot Exp $
+ * $Id: video_fifo.h,v 1.18 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
vlc_mutex_unlock( &p_fifo->lock );
#else
- vdec_DecodeMacroblockC( p_fifo->p_vpar->pp_vdec[0], p_mb );
+ p_fifo->p_vpar->pf_decode_mb_c( p_fifo->p_vpar->pp_vdec[0], p_mb );
#endif
}
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.58 2001/05/01 04:18:17 sam Exp $
+ * $Id: video_output.h,v 1.59 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+/*****************************************************************************
+ * vout_bank_t, p_vout_bank (global variable)
+ *****************************************************************************
+ * This global variable is accessed by any function using the video output.
+ *****************************************************************************/
+typedef struct
+{
+ /* Array to all the video outputs */
+ struct vout_thread_s *pp_vout[ VOUT_MAX_THREADS ];
+
+ int i_count;
+ vlc_mutex_t lock; /* Global lock */
+
+} vout_bank_t;
+
+extern vout_bank_t *p_vout_bank;
+
/*****************************************************************************
* vout_yuv_convert_t: YUV conversion function
*****************************************************************************
/*****************************************************************************
* Prototypes
*****************************************************************************/
+void vout_InitBank ( void );
+void vout_EndBank ( void );
+
vout_thread_t * vout_CreateThread ( int *pi_status );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.h,v 1.8 2001/01/24 19:05:55 massiot Exp $
+ * $Id: video_parser.h,v 1.34 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
void ( * ppf_motion_skipped[4][4] ) ( struct macroblock_s * );
/* IDCT plugin used and shortcuts to access its capabilities */
- struct module_s * p_idct_module;
- idct_init_t pf_init;
- f_idct_t pf_sparse_idct;
- f_idct_t pf_idct;
- norm_scan_t pf_norm_scan;
+ struct module_s * p_idct_module;
+ void ( * pf_idct_init ) ( struct vdec_thread_s * );
+ void ( * pf_sparse_idct ) ( struct vdec_thread_s *, dctelem_t*, int );
+ void ( * pf_idct ) ( struct vdec_thread_s *, dctelem_t*, int );
+ void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] );
+ void ( * pf_vdec_init ) ( struct vdec_thread_s * );
+ void ( * pf_decode_mb_c ) ( struct vdec_thread_s *, struct macroblock_s * );
+ void ( * pf_decode_mb_bw )( struct vdec_thread_s *, struct macroblock_s * );
#ifdef STATS
/* Statistics */
* vpar_headers.h : video parser : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.h,v 1.6 2001/02/13 13:01:14 massiot Exp $
+ * $Id: vpar_headers.h,v 1.26 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
* vpar_synchro.h : video parser blocks management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_synchro.h,v 1.8 2001/03/06 15:16:42 massiot Exp $
+ * $Id: vpar_synchro.h,v 1.33 2001/05/06 04:32:02 sam Exp $
*
* Author: Christophe Massiot <massiot@via.ecp.fr>
*
* aout_alsa.c : Alsa functions library
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: aout_alsa.c,v 1.13 2001/04/06 09:15:47 sam Exp $
+ * $Id: aout_alsa.c,v 1.14 2001/05/06 04:32:02 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
#include <stdlib.h> /* calloc(), malloc(), free() */
#include <sys/asoundlib.h>
-#include <linux/asound.h>
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
* vout_fb.c: framebuffer video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
- * $Id: vout_fb.c,v 1.10 2001/03/21 13:42:33 sam Exp $
+ * $Id: vout_fb.c,v 1.11 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
*****************************************************************************/
static void FBSwitchDisplay(int i_signal)
{
- if( p_main->p_vout != NULL )
+ vout_thread_t *p_vout;
+
+ vlc_mutex_lock( &p_vout_bank->lock );
+
+ /* XXX: only test the first video output */
+ if( p_vout_bank->i_count )
{
+ p_vout = p_vout_bank->pp_vout[0];
+
switch( i_signal )
{
case SIGUSR1: /* vt has been released */
- p_main->p_vout->b_active = 0;
- ioctl( ((vout_sys_t *)p_main->p_vout->p_sys)->i_tty_dev,
- VT_RELDISP, 1 );
+ p_vout->b_active = 0;
+ ioctl( p_vout->p_sys->i_tty_dev, VT_RELDISP, 1 );
break;
case SIGUSR2: /* vt has been acquired */
- p_main->p_vout->b_active = 1;
- ioctl( ((vout_sys_t *)p_main->p_vout->p_sys)->i_tty_dev,
- VT_RELDISP, VT_ACTIVATE );
+ p_vout->b_active = 1;
+ ioctl( p_vout->p_sys->i_tty_dev, VT_RELDISP, VT_ACTIVATE );
/* handle blanking */
- vlc_mutex_lock( &p_main->p_vout->change_lock );
- p_main->p_vout->i_changes |= VOUT_SIZE_CHANGE;
- vlc_mutex_unlock( &p_main->p_vout->change_lock );
+ vlc_mutex_lock( &p_vout->change_lock );
+ p_vout->i_changes |= VOUT_SIZE_CHANGE;
+ vlc_mutex_unlock( &p_vout->change_lock );
break;
}
}
+
+ vlc_mutex_unlock( &p_vout_bank->lock );
}
/*****************************************************************************
PLUGIN_IDCTMMX = idctmmx.o
PLUGIN_IDCTMMXEXT = idctmmxext.o
PLUGIN_IDCTALTIVEC = idctaltivec.o
-PLUGIN_IDCTCOMMON = idct_common.o
+PLUGIN_IDCTCOMMON = vdec_idct.o
+PLUGIN_VDECBLOCK_C = vdec_block_c.o
+PLUGIN_VDECBLOCK_MMX = vdec_block_mmx.o
BUILTIN_IDCT = $(PLUGIN_IDCT:%.o=BUILTIN_IDCT_%.o) \
- $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCT_%.o)
+ $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCT_%.o) \
+ $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCT_%.o)
BUILTIN_IDCTCLASSIC = $(PLUGIN_IDCTCLASSIC:%.o=BUILTIN_IDCTCLASSIC_%.o) \
- $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTCLASSIC_%.o)
+ $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTCLASSIC_%.o) \
+ $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTCLASSIC_%.o)
BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o) \
- $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMX_%.o)
+ $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMX_%.o) \
+ $(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMX_%.o)
BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o) \
- $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMXEXT_%.o)
+ $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMXEXT_%.o) \
+ $(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMXEXT_%.o)
BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o) \
- $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTALTIVEC_%.o)
+ $(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTALTIVEC_%.o) \
+ $(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTALTIVEC_%.o)
-PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
+PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) $(PLUGIN_VDECBLOCK_MMX)
ALL_OBJ = $(PLUGIN_C) $(PLUGIN_IDCTALTIVEC) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) $(BUILTIN_IDCTMMXEXT) $(BUILTIN_IDCTALTIVEC)
#
* idct.c : IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct.c,v 1.8 2001/04/15 04:19:57 sam Exp $
+ * $Id: idct.c,v 1.9 2001/05/06 04:32:02 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "modules.h"
-#include "idct.h"
+#include "vdec_block.h"
+#include "vdec_idct.h"
/*****************************************************************************
* Local and extern prototypes.
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = _M( vdec_InitIDCT );
- p_function_list->functions.idct.pf_sparse_idct = _M( vdec_SparseIDCT );
- p_function_list->functions.idct.pf_idct = _M( vdec_IDCT );
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
+#define F p_function_list->functions.idct
+ F.pf_idct_init = _M( vdec_InitIDCT );
+ F.pf_sparse_idct = _M( vdec_SparseIDCT );
+ F.pf_idct = _M( vdec_IDCT );
+ F.pf_norm_scan = vdec_NormScan;
+ F.pf_vdec_init = _M( vdec_Init );
+ F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
+ F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
+#undef F
}
/*****************************************************************************
* idctaltivec.c : Altivec IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctaltivec.c,v 1.4 2001/04/15 04:19:57 sam Exp $
+ * $Id: idctaltivec.c,v 1.5 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include "modules.h"
#include "modules_inner.h"
-#include "idct.h"
+#include "vdec_block.h"
+#include "vdec_idct.h"
#include "idctaltivec.h"
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = _M( vdec_InitIDCT );
- p_function_list->functions.idct.pf_sparse_idct = _M( vdec_SparseIDCT );
- p_function_list->functions.idct.pf_idct = _M( vdec_IDCT );
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
+#define F p_function_list->functions.idct
+ F.pf_idct_init = _M( vdec_InitIDCT );
+ F.pf_sparse_idct = _M( vdec_SparseIDCT );
+ F.pf_idct = _M( vdec_IDCT );
+ F.pf_norm_scan = vdec_NormScan;
+ F.pf_vdec_init = _M( vdec_Init );
+ F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
+ F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
+#undef F
}
/*****************************************************************************
* idctclassic.c : Classic IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctclassic.c,v 1.8 2001/04/15 04:19:57 sam Exp $
+ * $Id: idctclassic.c,v 1.9 2001/05/06 04:32:02 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "modules.h"
#include "modules_inner.h"
-#include "idct.h"
+#include "vdec_block.h"
+#include "vdec_idct.h"
/*****************************************************************************
* Local and extern prototypes.
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = _M( vdec_InitIDCT );
- p_function_list->functions.idct.pf_sparse_idct = _M( vdec_SparseIDCT );
- p_function_list->functions.idct.pf_idct = _M( vdec_IDCT );
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
+#define F p_function_list->functions.idct
+ F.pf_idct_init = _M( vdec_InitIDCT );
+ F.pf_sparse_idct = _M( vdec_SparseIDCT );
+ F.pf_idct = _M( vdec_IDCT );
+ F.pf_norm_scan = vdec_NormScan;
+ F.pf_vdec_init = _M( vdec_Init );
+ F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
+ F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
+#undef F
}
/*****************************************************************************
* idctmmx.c : MMX IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctmmx.c,v 1.9 2001/04/15 04:19:57 sam Exp $
+ * $Id: idctmmx.c,v 1.10 2001/05/06 04:32:02 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "modules.h"
#include "modules_inner.h"
-#include "idct.h"
+#include "vdec_block.h"
+#include "vdec_idct.h"
#include "attributes.h"
#include "mmx.h"
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = _M( vdec_InitIDCT );
- p_function_list->functions.idct.pf_sparse_idct = _M( vdec_SparseIDCT );
- p_function_list->functions.idct.pf_idct = _M( vdec_IDCT );
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
+#define F p_function_list->functions.idct
+ F.pf_idct_init = _M( vdec_InitIDCT );
+ F.pf_sparse_idct = _M( vdec_SparseIDCT );
+ F.pf_idct = _M( vdec_IDCT );
+ F.pf_norm_scan = vdec_NormScan;
+ F.pf_vdec_init = _M( vdec_Init );
+ F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
+ F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
+#undef F
}
/*****************************************************************************
* idctmmxext.c : MMX EXT IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctmmxext.c,v 1.6 2001/04/15 04:19:57 sam Exp $
+ * $Id: idctmmxext.c,v 1.7 2001/05/06 04:32:02 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Michel Lespinasse <walken@zoy.org>
#include "modules.h"
#include "modules_inner.h"
-#include "idct.h"
+#include "vdec_block.h"
+#include "vdec_idct.h"
#include "attributes.h"
#include "mmx.h"
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
- p_function_list->functions.idct.pf_init = _M( vdec_InitIDCT );
- p_function_list->functions.idct.pf_sparse_idct = _M( vdec_SparseIDCT );
- p_function_list->functions.idct.pf_idct = _M( vdec_IDCT );
- p_function_list->functions.idct.pf_norm_scan = vdec_NormScan;
+#define F p_function_list->functions.idct
+ F.pf_idct_init = _M( vdec_InitIDCT );
+ F.pf_sparse_idct = _M( vdec_SparseIDCT );
+ F.pf_idct = _M( vdec_IDCT );
+ F.pf_norm_scan = vdec_NormScan;
+ F.pf_vdec_init = _M( vdec_Init );
+ F.pf_decode_mb_c = _M( vdec_DecodeMacroblockC );
+ F.pf_decode_mb_bw = _M( vdec_DecodeMacroblockBW );
+#undef F
}
/*****************************************************************************
--- /dev/null
+/*****************************************************************************
+ * vdec_block_h: Macroblock copy functions
+ *****************************************************************************
+ * Copyright (C) 1999, 2000, 2001 VideoLAN
+ * $Id: vdec_block.h,v 1.1 2001/05/06 04:32:02 sam Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+void _M( vdec_Init ) ( struct vdec_thread_s *p_vdec );
+void _M( vdec_DecodeMacroblockC ) ( struct vdec_thread_s *p_vdec,
+ struct macroblock_s * p_mb );
+void _M( vdec_DecodeMacroblockBW ) ( struct vdec_thread_s *p_vdec,
+ struct macroblock_s * p_mb );
+
+/*****************************************************************************
+ * vdec_DecodeMacroblock : decode a macroblock of a picture
+ *****************************************************************************/
+#define DECODEBLOCKSC( OPBLOCK ) \
+{ \
+ int i_b, i_mask; \
+ \
+ i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
+ \
+ /* luminance */ \
+ for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
+ { \
+ if( p_mb->i_coded_block_pattern & i_mask ) \
+ { \
+ /* \
+ * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
+ */ \
+ (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->pi_sparse_pos[i_b] ); \
+ \
+ /* \
+ * Adding prediction and coefficient data (ISO/IEC 13818-2 \
+ * section 7.6.8) \
+ */ \
+ OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
+ } \
+ } \
+ \
+ /* chrominance */ \
+ for( i_b = 4; i_b < 4 + p_mb->i_chroma_nb_blocks; \
+ i_b++, i_mask >>= 1 ) \
+ { \
+ if( p_mb->i_coded_block_pattern & i_mask ) \
+ { \
+ /* \
+ * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
+ */ \
+ (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->pi_sparse_pos[i_b] ); \
+ \
+ /* \
+ * Adding prediction and coefficient data (ISO/IEC 13818-2 \
+ * section 7.6.8) \
+ */ \
+ OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->p_data[i_b], p_mb->i_addb_c_stride ); \
+ } \
+ } \
+}
+
+#define DECODEBLOCKSBW( OPBLOCK ) \
+{ \
+ int i_b, i_mask; \
+ \
+ i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
+ \
+ /* luminance */ \
+ for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
+ { \
+ if( p_mb->i_coded_block_pattern & i_mask ) \
+ { \
+ /* \
+ * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
+ */ \
+ (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->pi_sparse_pos[i_b] ); \
+ \
+ /* \
+ * Adding prediction and coefficient data (ISO/IEC 13818-2 \
+ * section 7.6.8) \
+ */ \
+ OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
+ p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
+ } \
+ } \
+}
+
--- /dev/null
+/*****************************************************************************
+ * vdec_block_c.c: Macroblock copy functions in C
+ *****************************************************************************
+ * Copyright (C) 1999, 2000, 2001 VideoLAN
+ * $Id: vdec_block_c.c,v 1.1 2001/05/06 04:32:02 sam Exp $
+ *
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
+ *
+ * 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.
+ *****************************************************************************/
+
+/* MODULE_NAME defined in Makefile together with -DBUILTIN */
+#ifdef BUILTIN
+# include "modules_inner.h"
+#else
+# define _M( foo ) foo
+#endif
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+
+#include "intf_msg.h"
+
+#include "input_ext-dec.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "vdec_motion.h"
+#include "video_decoder.h"
+
+#include "vpar_blocks.h"
+
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
+
+#include "vdec_block.h"
+
+/*****************************************************************************
+ * Static variables
+ *****************************************************************************
+ * We can keep them static since they will always contain the same values.
+ *****************************************************************************/
+static u8 pi_crop_buf[VDEC_CROPRANGE];
+static u8 *pi_crop;
+
+/*****************************************************************************
+ * vdec_Init: initialize video decoder thread
+ *****************************************************************************/
+void _M( vdec_Init ) ( vdec_thread_t *p_vdec )
+{
+ int i_dummy;
+
+ /* Init crop table */
+ pi_crop = pi_crop_buf + (VDEC_CROPRANGE >> 1);
+
+ for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ )
+ {
+ pi_crop[i_dummy] = 0;
+ }
+
+ for( ; i_dummy < 255; i_dummy ++ )
+ {
+ pi_crop[i_dummy] = i_dummy;
+ }
+
+ for( ; i_dummy < (VDEC_CROPRANGE >> 1) -1; i_dummy++ )
+ {
+ pi_crop[i_dummy] = 255;
+ }
+}
+
+/*****************************************************************************
+ * AddBlock : add a block
+ *****************************************************************************/
+static __inline__ void AddBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
+ yuv_data_t * p_data, int i_incr )
+{
+ int i_x, i_y;
+
+ for( i_y = 0; i_y < 8; i_y++ )
+ {
+ for( i_x = 0; i_x < 8; i_x++ )
+ {
+ *p_data = pi_crop[*p_data + *p_block++];
+ p_data++;
+ }
+ p_data += i_incr;
+ }
+}
+
+/*****************************************************************************
+ * CopyBlock : copy a block
+ *****************************************************************************/
+static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
+ yuv_data_t * p_data, int i_incr )
+{
+ int i_x, i_y;
+
+ for( i_y = 0; i_y < 8; i_y++ )
+ {
+ for( i_x = 0; i_x < 8; i_x++ )
+ {
+ *p_data++ = pi_crop[*p_block++];
+ }
+ p_data += i_incr;
+ }
+}
+
+void _M( vdec_DecodeMacroblockC ) ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
+{
+ if( !(p_mb->i_mb_type & MB_INTRA) )
+ {
+ /*
+ * Motion Compensation (ISO/IEC 13818-2 section 7.6)
+ */
+ if( p_mb->pf_motion == 0 )
+ {
+ intf_WarnMsg( 2, "pf_motion set to NULL" );
+ }
+ else
+ {
+ p_mb->pf_motion( p_mb );
+ }
+
+ DECODEBLOCKSC( AddBlock )
+ }
+ else
+ {
+ DECODEBLOCKSC( CopyBlock )
+ }
+
+ /*
+ * Decoding is finished, release the macroblock and free
+ * unneeded memory.
+ */
+ vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
+}
+
+void _M( vdec_DecodeMacroblockBW ) ( vdec_thread_t *p_vdec,
+ macroblock_t * p_mb )
+{
+ if( !(p_mb->i_mb_type & MB_INTRA) )
+ {
+ /*
+ * Motion Compensation (ISO/IEC 13818-2 section 7.6)
+ */
+ if( p_mb->pf_motion == 0 )
+ {
+ intf_WarnMsg( 2, "pf_motion set to NULL" );
+ }
+ else
+ {
+ p_mb->pf_motion( p_mb );
+ }
+
+ DECODEBLOCKSBW( AddBlock )
+ }
+ else
+ {
+ DECODEBLOCKSBW( CopyBlock )
+ }
+
+ /*
+ * Decoding is finished, release the macroblock and free
+ * unneeded memory.
+ */
+ vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
+}
+
--- /dev/null
+/*****************************************************************************
+ * vdec_block_mmx.c: Macroblock copy functions in MMX assembly
+ *****************************************************************************
+ * Copyright (C) 1999, 2000, 2001 VideoLAN
+ * $Id: vdec_block_mmx.c,v 1.1 2001/05/06 04:32:02 sam Exp $
+ *
+ * Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
+ *
+ * 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.
+ *****************************************************************************/
+
+/* MODULE_NAME defined in Makefile together with -DBUILTIN */
+#ifdef BUILTIN
+# include "modules_inner.h"
+#else
+# define _M( foo ) foo
+#endif
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+
+#include "intf_msg.h"
+
+#include "input_ext-dec.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "vdec_motion.h"
+#include "video_decoder.h"
+
+#include "vpar_blocks.h"
+
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
+
+#include "vdec_block.h"
+
+/*****************************************************************************
+ * vdec_Init: initialize video decoder thread
+ *****************************************************************************/
+void _M( vdec_Init ) ( vdec_thread_t *p_vdec )
+{
+ ;
+}
+
+/*****************************************************************************
+ * AddBlock : add a block
+ *****************************************************************************/
+static __inline__ void AddBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
+ yuv_data_t * p_data, int i_incr )
+{
+ asm __volatile__ (
+ "pxor %%mm7,%%mm7\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw (%2),%%mm2\n\t"
+ "paddw 8(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 16(%2),%%mm2\n\t"
+ "paddw 24(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 32(%2),%%mm2\n\t"
+ "paddw 40(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 48(%2),%%mm2\n\t"
+ "paddw 56(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 64(%2),%%mm2\n\t"
+ "paddw 72(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 80(%2),%%mm2\n\t"
+ "paddw 88(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 96(%2),%%mm2\n\t"
+ "paddw 104(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq (%0),%%mm1\n\t"
+ "movq %%mm1,%%mm2\n\t"
+ "punpckhbw %%mm7,%%mm1\n\t"
+ "punpcklbw %%mm7,%%mm2\n\t"
+ "paddw 112(%2),%%mm2\n\t"
+ "paddw 120(%2),%%mm1\n\t"
+ "packuswb %%mm1,%%mm2\n\t"
+ "movq %%mm2,(%0)\n\t"
+
+ //"emms"
+ : "=r" (p_data)
+ : "0" (p_data), "r" (p_block), "r" (i_incr + 8) );
+}
+
+/*****************************************************************************
+ * CopyBlock : copy a block
+ *****************************************************************************/
+static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
+ yuv_data_t * p_data, int i_incr )
+{
+ asm __volatile__ (
+ "movq (%2),%%mm0\n\t"
+ "packuswb 8(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 16(%2),%%mm0\n\t"
+ "packuswb 24(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 32(%2),%%mm0\n\t"
+ "packuswb 40(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 48(%2),%%mm0\n\t"
+ "packuswb 56(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 64(%2),%%mm0\n\t"
+ "packuswb 72(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 80(%2),%%mm0\n\t"
+ "packuswb 88(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 96(%2),%%mm0\n\t"
+ "packuswb 104(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+ "addl %3,%0\n\t"
+
+ "movq 112(%2),%%mm0\n\t"
+ "packuswb 120(%2),%%mm0\n\t"
+ "movq %%mm0,(%0)\n\t"
+
+ //"emms"
+ : "=r" (p_data)
+ : "0" (p_data), "r" (p_block), "r" (i_incr + 8) );
+}
+
+void _M( vdec_DecodeMacroblockC ) ( vdec_thread_t *p_vdec,
+ macroblock_t * p_mb )
+{
+ if( !(p_mb->i_mb_type & MB_INTRA) )
+ {
+ /*
+ * Motion Compensation (ISO/IEC 13818-2 section 7.6)
+ */
+ if( p_mb->pf_motion == 0 )
+ {
+ intf_WarnMsg( 2, "pf_motion set to NULL" );
+ }
+ else
+ {
+ p_mb->pf_motion( p_mb );
+ }
+
+ DECODEBLOCKSC( AddBlock )
+ }
+ else
+ {
+ DECODEBLOCKSC( CopyBlock )
+ }
+
+ /*
+ * Decoding is finished, release the macroblock and free
+ * unneeded memory.
+ */
+ vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
+}
+
+void _M( vdec_DecodeMacroblockBW ) ( vdec_thread_t *p_vdec,
+ macroblock_t * p_mb )
+{
+ if( !(p_mb->i_mb_type & MB_INTRA) )
+ {
+ /*
+ * Motion Compensation (ISO/IEC 13818-2 section 7.6)
+ */
+ if( p_mb->pf_motion == 0 )
+ {
+ intf_WarnMsg( 2, "pf_motion set to NULL" );
+ }
+ else
+ {
+ p_mb->pf_motion( p_mb );
+ }
+
+ DECODEBLOCKSBW( AddBlock )
+ }
+ else
+ {
+ DECODEBLOCKSBW( CopyBlock )
+ }
+
+ /*
+ * Decoding is finished, release the macroblock and free
+ * unneeded memory.
+ */
+ vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
+}
+
/*****************************************************************************
- * idct_common.c : common IDCT functions
+ * vdec_idct.c : common IDCT functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct_common.c,v 1.5 2001/04/15 04:19:57 sam Exp $
+ * $Id: vdec_idct.c,v 1.1 2001/05/06 04:32:02 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
#include "modules.h"
-#include "idct.h"
+#include "vdec_idct.h"
/*****************************************************************************
* vdec_InitIDCT : initialize datas for vdec_SparseIDCT
/*****************************************************************************
- * idct.h : macros for the inverse discrete cosine transform
+ * vdec_idct.h : macros for the inverse discrete cosine transform
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct.h,v 1.3 2001/04/15 04:19:57 sam Exp $
+ * $Id: vdec_idct.h,v 1.1 2001/05/06 04:32:02 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
$(PLUGIN_QT): %.o: %.moc
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
$(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
- $(MOC) -i $< -o $@
+ grep -q Q_OBJECT $< && $(MOC) -i $< -o $@ || true
$(BUILTIN_QT): BUILTIN_%.o: .dep/%.dpp
$(BUILTIN_QT): %.o: %.moc
$(CC) $(CFLAGS) -DBUILTIN -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:BUILTIN_%.moc=%.cpp)
$(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
- $(MOC) -i $< -o $@
+ grep -q Q_OBJECT $< && $(MOC) -i $< -o $@ || true
#
# Real targets
#include "video.h"
#include "video_output.h"
-#include "main.h"
-
-
/*****************************************************************************
* intf_sys_t: description and status of rc interface
*****************************************************************************/
case 'f':
case 'F':
- p_main->p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+ vlc_mutex_lock( &p_vout_bank->lock );
+ /* XXX: only fullscreen the first video output */
+ if( p_vout_bank->i_count )
+ {
+ p_vout_bank->pp_vout[0]->i_changes
+ |= VOUT_FULLSCREEN_CHANGE;
+ }
+ vlc_mutex_unlock( &p_vout_bank->lock );
break;
case 'm':
* ac3_bit_allocate.c: ac3 allocation tables
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: ac3_bit_allocate.c,v 1.19 2001/04/26 11:23:16 sam Exp $
+ * $Id: ac3_bit_allocate.c,v 1.20 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
*****************************************************************************/
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
* ac3_decoder.c: core ac3 decoder
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder.c,v 1.30 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_decoder.c,v 1.31 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
#include "stream_control.h"
#include "input_ext-dec.h"
-#include "audio_output.h"
+#include "audio_output.h"
#include "ac3_decoder.h"
#include "ac3_decoder_thread.h"
-
#include "ac3_internal.h"
#include <stdio.h>
* ac3_decoder_thread.c: ac3 decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder_thread.c,v 1.31 2001/05/01 04:18:18 sam Exp $
+ * $Id: ac3_decoder_thread.c,v 1.32 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* malloc(), free() */
+#include <string.h> /* memset() */
#include "config.h"
#include "common.h"
* ac3_downmix.c: ac3 downmix functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_downmix.c,v 1.21 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_downmix.c,v 1.22 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
*****************************************************************************/
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
#include "stream_control.h"
#include "input_ext-dec.h"
+
#include "ac3_decoder.h"
#include "ac3_internal.h"
#include "ac3_downmix.h"
* ac3_downmix_c.c: ac3 downmix functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_downmix_c.c,v 1.6 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_downmix_c.c,v 1.7 2001/05/06 04:32:02 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
* ac3_imdct.c: ac3 DCT
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct.c,v 1.17 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_imdct.c,v 1.18 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include <math.h>
#include <stdio.h>
* ac3_imdct_c.c: ac3 DCT
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_imdct_c.c,v 1.1 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_imdct_c.c,v 1.2 2001/05/06 04:32:02 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include <math.h>
#include <stdio.h>
#include "ac3_decoder.h"
#include "ac3_internal.h"
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
+
void fft_64p_c (complex_t *x);
void fft_128p_c (complex_t *x);
void imdct_do_512_c (imdct_t * p_imdct, float data[], float delay[]);
* ac3_mantissa.c: ac3 mantissa computation
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_mantissa.c,v 1.25 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_mantissa.c,v 1.26 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
* ac3_parse.c: ac3 parsing procedures
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: ac3_parse.c,v 1.19 2001/04/26 00:12:19 reno Exp $
+ * $Id: ac3_parse.c,v 1.20 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memset() */
+
#include "config.h"
#include "common.h"
* ac3_rematrix.c: ac3 audio rematrixing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_rematrix.c,v 1.15 2001/04/30 21:04:20 reno Exp $
+ * $Id: ac3_rematrix.c,v 1.16 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
*****************************************************************************/
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include "config.h"
#include "common.h"
#include "threads.h"
* ac3_srfft.c: ac3 FFT
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_srfft.c,v 1.2 2001/04/30 21:10:25 reno Exp $
+ * $Id: ac3_srfft.c,v 1.3 2001/05/06 04:32:02 sam Exp $
*
* Authors: Renaud Dartus <reno@videolan.org>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
#include "defs.h"
+#include <string.h> /* memcpy() */
+
#include <math.h>
#include <stdio.h>
* ac3_iec958.c: ac3 to spdif converter
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_iec958.c,v 1.2 2001/05/01 04:18:18 sam Exp $
+ * $Id: ac3_iec958.c,v 1.3 2001/05/06 04:32:02 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h> /* memset() */
#include <fcntl.h>
#include <unistd.h>
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: ac3_spdif.c,v 1.2 2001/05/01 04:18:18 sam Exp $
+ * $Id: ac3_spdif.c,v 1.3 2001/05/06 04:32:02 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
* 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.
- ****************************************************************************/
+ *****************************************************************************/
-/****************************************************************************
+/*****************************************************************************
* Preamble
- ****************************************************************************/
+ *****************************************************************************/
#include "defs.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h> /* memcpy() */
#include <fcntl.h>
#include <unistd.h>
* aout_ext-dec.c : exported fifo management functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_ext-dec.c,v 1.1 2001/05/01 04:18:18 sam Exp $
+ * $Id: aout_ext-dec.c,v 1.2 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
long l_units, long l_frame_size,
void *p_buffer )
{
-#define P_AOUT p_main->p_aout
+ aout_thread_t *p_aout;
int i_fifo;
/* Spawn an audio output if there is none */
- if( P_AOUT == NULL )
+ vlc_mutex_lock( &p_aout_bank->lock );
+
+ if( p_aout_bank->i_count == 0 )
{
- P_AOUT = aout_CreateThread( NULL );
+ intf_Msg( "aout: no aout present, spawning one" );
+
+ p_aout = aout_CreateThread( NULL );
- if( P_AOUT == NULL )
+ /* Everything failed */
+ if( p_aout == NULL )
{
+ vlc_mutex_unlock( &p_aout_bank->lock );
return NULL;
}
+
+ p_aout_bank->pp_aout[ p_aout_bank->i_count ] = p_aout;
+ p_aout_bank->i_count++;
+ }
+ else
+ {
+ /* Take the first audio output FIXME: take the best one */
+ p_aout = p_aout_bank->pp_aout[ 0 ];
}
/* Take the fifos lock */
- vlc_mutex_lock( &P_AOUT->fifos_lock );
+ vlc_mutex_lock( &p_aout->fifos_lock );
/* Looking for a free fifo structure */
for( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
{
- if( P_AOUT->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO )
+ if( p_aout->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO )
{
/* Not very clever, but at least we know which fifo it is */
- P_AOUT->fifo[i_fifo].i_fifo = i_fifo;
+ p_aout->fifo[i_fifo].i_fifo = i_fifo;
break;
}
}
if( i_fifo == AOUT_MAX_FIFOS )
{
intf_ErrMsg( "aout error: no fifo available" );
- vlc_mutex_unlock( &P_AOUT->fifos_lock );
+ vlc_mutex_unlock( &p_aout->fifos_lock );
+ vlc_mutex_unlock( &p_aout_bank->lock );
return( NULL );
}
/* Initialize the new fifo structure */
- switch ( P_AOUT->fifo[i_fifo].i_type = i_type )
+ switch ( p_aout->fifo[i_fifo].i_type = i_type )
{
case AOUT_INTF_MONO_FIFO:
case AOUT_INTF_STEREO_FIFO:
- P_AOUT->fifo[i_fifo].b_die = 0;
+ p_aout->fifo[i_fifo].b_die = 0;
- P_AOUT->fifo[i_fifo].i_channels = i_channels;
- P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
- P_AOUT->fifo[i_fifo].l_rate = l_rate;
+ p_aout->fifo[i_fifo].i_channels = i_channels;
+ p_aout->fifo[i_fifo].b_stereo = ( i_channels == 2 );
+ p_aout->fifo[i_fifo].l_rate = l_rate;
- P_AOUT->fifo[i_fifo].buffer = p_buffer;
+ p_aout->fifo[i_fifo].buffer = p_buffer;
- P_AOUT->fifo[i_fifo].l_unit = 0;
- InitializeIncrement( &P_AOUT->fifo[i_fifo].unit_increment,
- l_rate, P_AOUT->l_rate );
- P_AOUT->fifo[i_fifo].l_units = l_units;
+ p_aout->fifo[i_fifo].l_unit = 0;
+ InitializeIncrement( &p_aout->fifo[i_fifo].unit_increment,
+ l_rate, p_aout->l_rate );
+ p_aout->fifo[i_fifo].l_units = l_units;
break;
case AOUT_ADEC_MONO_FIFO:
case AOUT_ADEC_STEREO_FIFO:
- P_AOUT->fifo[i_fifo].b_die = 0;
+ p_aout->fifo[i_fifo].b_die = 0;
- P_AOUT->fifo[i_fifo].i_channels = i_channels;
- P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
- P_AOUT->fifo[i_fifo].l_rate = l_rate;
+ p_aout->fifo[i_fifo].i_channels = i_channels;
+ p_aout->fifo[i_fifo].b_stereo = ( i_channels == 2 );
+ p_aout->fifo[i_fifo].l_rate = l_rate;
- P_AOUT->fifo[i_fifo].l_frame_size = l_frame_size;
+ p_aout->fifo[i_fifo].l_frame_size = l_frame_size;
/* Allocate the memory needed to store the audio frames. As the
* fifo is a rotative fifo, we must be able to find out whether
* the fifo is full or empty, that's why we must in fact allocate
* memory for (AOUT_FIFO_SIZE+1) audio frames. */
- P_AOUT->fifo[i_fifo].buffer = malloc( sizeof(s16) *
+ p_aout->fifo[i_fifo].buffer = malloc( sizeof(s16) *
( AOUT_FIFO_SIZE + 1 ) * l_frame_size );
- if ( P_AOUT->fifo[i_fifo].buffer == NULL )
+ if ( p_aout->fifo[i_fifo].buffer == NULL )
{
intf_ErrMsg( "aout error: cannot create frame buffer" );
- P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
- vlc_mutex_unlock( &P_AOUT->fifos_lock );
+ p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+ vlc_mutex_unlock( &p_aout->fifos_lock );
+ vlc_mutex_unlock( &p_aout_bank->lock );
return( NULL );
}
/* Allocate the memory needed to store the dates of the frames */
- P_AOUT->fifo[i_fifo].date =
+ p_aout->fifo[i_fifo].date =
malloc( sizeof(mtime_t) * ( AOUT_FIFO_SIZE + 1) );
- if ( P_AOUT->fifo[i_fifo].date == NULL )
+ if ( p_aout->fifo[i_fifo].date == NULL )
{
intf_ErrMsg( "aout error: cannot create date buffer");
- free( P_AOUT->fifo[i_fifo].buffer );
- P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
- vlc_mutex_unlock( &P_AOUT->fifos_lock );
+ free( p_aout->fifo[i_fifo].buffer );
+ p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+ vlc_mutex_unlock( &p_aout->fifos_lock );
+ vlc_mutex_unlock( &p_aout_bank->lock );
return( NULL );
}
/* Set the fifo's buffer as empty (the first frame that is to be
* played is also the first frame that is not to be played) */
- P_AOUT->fifo[i_fifo].l_start_frame = 0;
- /* P_AOUT->fifo[i_fifo].l_next_frame = 0; */
- P_AOUT->fifo[i_fifo].l_end_frame = 0;
+ p_aout->fifo[i_fifo].l_start_frame = 0;
+ /* p_aout->fifo[i_fifo].l_next_frame = 0; */
+ p_aout->fifo[i_fifo].l_end_frame = 0;
/* Waiting for the audio decoder to compute enough frames to work
* out the fifo's current rate (as soon as the decoder has decoded
* enough frames, the members of the fifo structure that are not
* initialized now will be calculated) */
- P_AOUT->fifo[i_fifo].b_start_frame = 0;
- P_AOUT->fifo[i_fifo].b_next_frame = 0;
+ p_aout->fifo[i_fifo].b_start_frame = 0;
+ p_aout->fifo[i_fifo].b_next_frame = 0;
break;
default:
intf_ErrMsg( "aout error: unknown fifo type 0x%x",
- P_AOUT->fifo[i_fifo].i_type );
- P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
- vlc_mutex_unlock( &P_AOUT->fifos_lock );
+ p_aout->fifo[i_fifo].i_type );
+ p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
+ vlc_mutex_unlock( &p_aout->fifos_lock );
+ vlc_mutex_unlock( &p_aout_bank->lock );
return( NULL );
}
/* Release the fifos lock */
- vlc_mutex_unlock( &P_AOUT->fifos_lock );
+ vlc_mutex_unlock( &p_aout->fifos_lock );
+ vlc_mutex_unlock( &p_aout_bank->lock );
intf_WarnMsg( 2, "aout info: fifo #%i allocated, %i channels, rate %li",
- P_AOUT->fifo[i_fifo].i_fifo, P_AOUT->fifo[i_fifo].i_channels,
- P_AOUT->fifo[i_fifo].l_rate );
+ p_aout->fifo[i_fifo].i_fifo, p_aout->fifo[i_fifo].i_channels,
+ p_aout->fifo[i_fifo].l_rate );
/* Return the pointer to the fifo structure */
- return( &P_AOUT->fifo[i_fifo] );
-#undef P_AOUT
+ return( &p_aout->fifo[i_fifo] );
}
/*****************************************************************************
{
((s16 *)p_aout->buffer)[l_buffer] =
(s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS )
- * p_aout->i_vol / 256 ) ;
+ * p_aout->i_volume / 256 ) ;
p_aout->s32_buffer[l_buffer] = 0;
}
* aout_spdif: ac3 passthrough output
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: aout_spdif.c,v 1.1 2001/04/29 02:55:36 stef Exp $
+ * $Id: aout_spdif.c,v 1.2 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* calloc(), malloc(), free() */
+#include <string.h> /* memset() */
#include "config.h"
#include "common.h"
* aout_u8.c: 8 bit unsigned audio output functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_u8.c,v 1.3 2001/05/01 04:18:18 sam Exp $
+ * $Id: aout_u8.c,v 1.4 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{
- ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->i_vol / 256 );
+ ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->i_volume / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{
- ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_vol / 256 );
+ ((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_volume / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: audio_output.c,v 1.59 2001/05/01 04:18:18 sam Exp $
+ * $Id: audio_output.c,v 1.60 2001/05/06 04:32:02 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
*****************************************************************************/
static int aout_SpawnThread( aout_thread_t * p_aout );
+/*****************************************************************************
+ * aout_InitBank: initialize the audio output bank.
+ *****************************************************************************/
+void aout_InitBank ( void )
+{
+ p_aout_bank->i_count = 0;
+
+ vlc_mutex_init( &p_aout_bank->lock );
+}
+
+/*****************************************************************************
+ * aout_EndBank: empty the audio output bank.
+ *****************************************************************************
+ * This function ends all unused audio outputs and empties the bank in
+ * case of success.
+ *****************************************************************************/
+void aout_EndBank ( void )
+{
+ /* Ask all remaining audio outputs to die */
+ while( p_aout_bank->i_count )
+ {
+ aout_DestroyThread(
+ p_aout_bank->pp_aout[ --p_aout_bank->i_count ], NULL );
+ }
+
+ vlc_mutex_destroy( &p_aout_bank->lock );
+}
+
/*****************************************************************************
* aout_CreateThread: initialize audio thread
*****************************************************************************/
}
/* Initialize the volume level */
- p_aout->i_vol = VOLUME_DEFAULT;
+ p_aout->i_volume = VOLUME_DEFAULT;
+ p_aout->i_savedvolume = 0;
/* FIXME: maybe it would be cleaner to change SpawnThread prototype
* see vout to handle status correctly ?? however, it is not critical since
*****************************************************************************/
void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
{
-
int i_fifo;
/* FIXME: pi_status is not handled correctly: check vout how to do!?? */
* input_netlist.c: netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: input_netlist.c,v 1.35 2001/04/28 23:19:19 henri Exp $
+ * $Id: input_netlist.c,v 1.36 2001/05/06 04:32:02 sam Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <sys/types.h>
-#ifndef WIN32
-#include <sys/uio.h> /* struct iovec */
-#endif
#include <unistd.h>
+#ifndef WIN32
+# include <sys/uio.h> /* struct iovec */
+#else
+ struct iovec
+ {
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+ };
+#endif
+
#include "config.h"
#include "common.h"
#include "threads.h" /* mutex */
#include "input.h"
#include "input_netlist.h"
-#ifdef WIN32
-struct iovec
- {
- void *iov_base; /* Pointer to data. */
- size_t iov_len; /* Length of data. */
- };
-#endif
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
-
/*****************************************************************************
* input_NetlistInit: allocates netlist buffers and init indexes
*****************************************************************************/
/* Fills a table of pointers to packets associated with the io_vec's */
-while (i_loop < i_nb_iovec )
+ while (i_loop < i_nb_iovec )
{
if( i_current >= p_netlist->i_nb_data )
i_current-=p_netlist->i_nb_data;
return ( NULL );
}
- p_return = (p_netlist->pp_free_data[p_netlist->i_data_start]);
+ p_return = p_netlist->pp_free_data[p_netlist->i_data_start];
p_netlist->i_data_start++;
p_netlist->i_data_start &= ( p_netlist->i_nb_data - 1 );
p_data->p_next = NULL;
/* unlock */
- vlc_mutex_unlock (&p_netlist->lock);
+ vlc_mutex_unlock( &p_netlist->lock );
}
/*****************************************************************************
p_netlist->pp_free_pes[p_netlist->i_pes_end] = p_pes;
/* unlock */
- vlc_mutex_unlock (&p_netlist->lock);
+ vlc_mutex_unlock( &p_netlist->lock );
}
vlc_mutex_destroy (&p_netlist->lock);
/* free the FIFO, the buffer, and the netlist structure */
- free (p_netlist->pp_free_data);
- free (p_netlist->pp_free_pes);
- free (p_netlist->p_pes);
- free (p_netlist->p_data);
- free (p_netlist->p_buffers);
+ free( p_netlist->pp_free_data );
+ free( p_netlist->pp_free_pes );
+ free( p_netlist->p_pes );
+ free( p_netlist->p_data );
+ free( p_netlist->p_buffers );
/* free the netlist */
- free (p_netlist);
+ free( p_netlist );
}
+
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: interface.c,v 1.75 2001/05/01 04:18:18 sam Exp $
+ * $Id: interface.c,v 1.76 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
*****************************************************************************/
int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
{
- static int i_volbackup;
+ int i_index;
keyparm k_reply;
k_reply = intf_GetKey( p_intf, g_key);
case INTF_KEY_QUIT: /* quit order */
p_intf->b_die = 1;
break;
+
case INTF_KEY_SET_CHANNEL:
/* Change channel - return code is ignored since SelectChannel displays
* its own error messages */
/* FIXME : keyboard event is for the time being half handled by the interface
* half handled directly by the plugins. We should decide what to do. */
break;
+
case INTF_KEY_INC_VOLUME: /* volume + */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol < VOLUME_MAX) )
- p_main->p_aout->i_vol += VOLUME_STEP;
+ vlc_mutex_lock( &p_aout_bank->lock );
+ for( i_index = 0 ; i_index < p_aout_bank->i_count ; i_index++ )
+ {
+ if( p_aout_bank->pp_aout[i_index]->i_volume
+ < VOLUME_MAX - VOLUME_STEP )
+ {
+ p_aout_bank->pp_aout[i_index]->i_volume += VOLUME_STEP;
+ }
+ else
+ {
+ p_aout_bank->pp_aout[i_index]->i_volume = VOLUME_MAX;
+ }
+ }
+ vlc_mutex_unlock( &p_aout_bank->lock );
break;
+
case INTF_KEY_DEC_VOLUME: /* volume - */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol > VOLUME_STEP) )
- p_main->p_aout->i_vol -= VOLUME_STEP;
+ vlc_mutex_lock( &p_aout_bank->lock );
+ for( i_index = 0 ; i_index < p_aout_bank->i_count ; i_index++ )
+ {
+ if( p_aout_bank->pp_aout[i_index]->i_volume > VOLUME_STEP )
+ {
+ p_aout_bank->pp_aout[i_index]->i_volume -= VOLUME_STEP;
+ }
+ else
+ {
+ p_aout_bank->pp_aout[i_index]->i_volume = 0;
+ }
+ }
+ vlc_mutex_unlock( &p_aout_bank->lock );
break;
+
case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
- if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol))
+ vlc_mutex_lock( &p_aout_bank->lock );
+ for( i_index = 0 ; i_index < p_aout_bank->i_count ; i_index++ )
{
- i_volbackup = p_main->p_aout->i_vol;
- p_main->p_aout->i_vol = 0;
+ if( p_aout_bank->pp_aout[i_index]->i_savedvolume )
+ {
+ p_aout_bank->pp_aout[i_index]->i_volume =
+ p_aout_bank->pp_aout[i_index]->i_savedvolume;
+ p_aout_bank->pp_aout[i_index]->i_savedvolume = 0;
+ }
+ else
+ {
+ p_aout_bank->pp_aout[i_index]->i_savedvolume =
+ p_aout_bank->pp_aout[i_index]->i_volume;
+ p_aout_bank->pp_aout[i_index]->i_volume = 0;
+ }
}
- else if( (p_main->p_aout != NULL) && (!p_main->p_aout->i_vol))
- p_main->p_aout->i_vol = i_volbackup;
+ vlc_mutex_unlock( &p_aout_bank->lock );
break;
+
+/* XXX: fix this later */
+#if 0
case INTF_KEY_DEC_GAMMA: /* gamma - */
if( (p_main->p_vout != NULL) && (p_main->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
{
p_main->p_vout->i_changes |= VOUT_GAMMA_CHANGE;
}
break;
+#endif
+
case INTF_KEY_DUMP_STREAM:
if( p_intf->p_input != NULL )
{
vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
}
break;
- default: /* unknown key */
+
+ default: /* unknown key */
return( 1 );
}
return( 0 );
}
+
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: main.c,v 1.91 2001/05/01 04:18:18 sam Exp $
+ * $Id: main.c,v 1.92 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* Global variable program_data - these are the only ones, see main.h and
* modules.h
*****************************************************************************/
-main_t *p_main;
-bank_t *p_bank;
+main_t *p_main;
+module_bank_t *p_module_bank;
+aout_bank_t *p_aout_bank;
+vout_bank_t *p_vout_bank;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
{
- main_t main_data; /* root of all data - see main.h */
- bank_t module_bank;
+ main_t main_data; /* root of all data - see main.h */
+ module_bank_t module_bank;
+ aout_bank_t aout_bank;
+ vout_bank_t vout_bank;
- p_main = &main_data; /* set up the global variables */
- p_bank = &module_bank;
+ p_main = &main_data; /* set up the global variables */
+ p_module_bank = &module_bank;
+ p_aout_bank = &aout_bank;
+ p_vout_bank = &vout_bank;
/*
- * Initialize the main structure
+ * Test if our code is likely to run on this CPU
*/
p_main->i_cpu_capabilities = CPUCapabilities();
- p_main->p_aout = NULL;
- p_main->p_vout = NULL;
-
- /*
- * System specific initialization code
- */
-#if defined( SYS_BEOS ) || defined( SYS_DARWIN1_3 )
- system_Create( &i_argc, ppsz_argv, ppsz_env );
-#endif
-
- /*
- * Test if our code is likely to run on this CPU
- */
#if defined( __pentium__ ) || defined( __pentiumpro__ )
if( ! TestCPU( CPU_CAPABILITY_586 ) )
{
}
#endif
-#ifdef HAVE_MMX
- if( ! TestCPU( CPU_CAPABILITY_MMX ) )
- {
- fprintf( stderr, "error: this program needs MMX extensions,\n"
- "please try a version without MMX support\n" );
- return( 1 );
- }
+ /*
+ * System specific initialization code
+ */
+#if defined( SYS_BEOS ) || defined( SYS_DARWIN1_3 )
+ system_Init( &i_argc, ppsz_argv, ppsz_env );
#endif
/*
GetFilenames( i_argc, ppsz_argv );
/*
- * Initialize module bank
+ * Initialize module, aout and vout banks
*/
module_InitBank();
+ aout_InitBank();
+ vout_InitBank();
/*
* Initialize shared resources and libraries
}
/*
- * Run interface
+ * Try to run the interface
*/
p_main->p_intf = intf_Create();
- if( !p_main->p_intf )
+ if( p_main->p_intf == NULL )
{
intf_ErrMsg( "intf error: interface initialization failed" );
- module_EndBank();
- intf_PlaylistDestroy( p_main->p_playlist );
- intf_MsgDestroy();
- return( errno );
- }
-
- /*
- * Set signal handling policy for all threads
- */
- InitSignalHandler();
-
- /*
- * This is the main loop
- */
- p_main->p_intf->pf_run( p_main->p_intf );
-
- /*
- * Finished, destroy the interface
- */
- intf_Destroy( p_main->p_intf );
-
- /*
- * Close all video devices
- */
- if( p_main->p_vout != NULL )
- {
- vout_DestroyThread( p_main->p_vout, NULL );
}
-
- /*
- * Close all audio devices
- */
- if( p_main->p_aout != NULL )
- {
- aout_DestroyThread( p_main->p_aout, NULL );
- }
-
- /*
- * Go back into channel 0 which is the network
- */
- if( p_main->b_channels )
+ else
{
- network_ChannelJoin( COMMON_CHANNEL );
+ /*
+ * Set signal handling policy for all threads
+ */
+ InitSignalHandler();
+
+ /*
+ * This is the main loop
+ */
+ p_main->p_intf->pf_run( p_main->p_intf );
+
+ /*
+ * Finished, destroy the interface
+ */
+ intf_Destroy( p_main->p_intf );
+
+ /*
+ * Go back into channel 0 which is the network
+ */
+ if( p_main->b_channels )
+ {
+ network_ChannelJoin( COMMON_CHANNEL );
+ }
}
/*
- * Free module bank
+ * Free module, aout and vout banks
*/
+ vout_EndBank();
+ aout_EndBank();
module_EndBank();
/*
* System specific cleaning code
*/
#if defined( SYS_BEOS ) || defined( SYS_DARWIN1_3 )
- system_Destroy();
+ system_End();
#endif
/*
intf_Msg( "intf: program terminated" );
intf_MsgDestroy();
- return( 0 );
+ return 0;
}
/*****************************************************************************
* beos_init.cpp: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: beos_specific.cpp,v 1.10 2001/04/29 17:03:20 sam Exp $
+ * $Id: beos_specific.cpp,v 1.11 2001/05/06 04:32:02 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
*
static void system_AppThread( void * args );
/*****************************************************************************
- * system_Create: create a BApplication object and fill in program path.
+ * system_Init: create a BApplication object and fill in program path.
*****************************************************************************/
-void system_Create( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
+void system_Init( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
{
/* Prepare the lock/wait before launching the BApplication thread */
vlc_mutex_init( &app_lock );
}
/*****************************************************************************
- * system_Destroy: destroy the BApplication object.
+ * system_End: destroy the BApplication object.
*****************************************************************************/
-void system_Destroy( void )
+void system_End( void )
{
free( psz_program_path );
* darwin_specific.c: Darwin specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: darwin_specific.c,v 1.3 2001/04/14 07:41:20 sam Exp $
+ * $Id: darwin_specific.c,v 1.4 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
static char * psz_program_path;
/*****************************************************************************
- * system_Create: fill in program path.
+ * system_Init: fill in program path.
*****************************************************************************/
-void system_Create( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
+void system_Init( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
{
char i_dummy;
char *p_char, *p_oldchar = &i_dummy;
}
/*****************************************************************************
- * system_Destroy: free the program path.
+ * system_End: free the program path.
*****************************************************************************/
-void system_Destroy( void )
+void system_End( void )
{
free( psz_program_path );
}
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: modules.c,v 1.28 2001/05/01 04:18:18 sam Exp $
+ * $Id: modules.c,v 1.29 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
* This function creates a module bank structure and fills it with the
* built-in modules, as well as all the plugin modules it can find.
*****************************************************************************/
-void module_InitBank( )
+void module_InitBank( void )
{
#ifdef HAVE_DYNAMIC_PLUGINS
static char * path[] = { ".", "lib", PLUGIN_PATH, NULL, NULL };
struct dirent * file;
#endif /* HAVE_DYNAMIC_PLUGINS */
- p_bank->first = NULL;
- vlc_mutex_init( &p_bank->lock );
+ p_module_bank->first = NULL;
+ vlc_mutex_init( &p_module_bank->lock );
+ /*
+ * Check all the built-in modules
+ */
intf_WarnMsg( 2, "module: checking built-in modules" );
ALLOCATE_ALL_BUILTINS();
+ /*
+ * Check all the plugin modules we can find
+ */
#ifdef HAVE_DYNAMIC_PLUGINS
intf_WarnMsg( 2, "module: checking plugin modules" );
}
/*****************************************************************************
- * module_EndBank: destroy the module bank.
+ * module_EndBank: empty the module bank.
*****************************************************************************
- * This function unloads all unused plugin modules and removes the module
+ * This function unloads all unused plugin modules and empties the module
* bank in case of success.
*****************************************************************************/
-void module_EndBank( )
+void module_EndBank( void )
{
module_t * p_next;
- while( p_bank->first != NULL )
+ while( p_module_bank->first != NULL )
{
- if( DeleteModule( p_bank->first ) )
+ if( DeleteModule( p_module_bank->first ) )
{
/* Module deletion failed */
intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
- p_bank->first->psz_name );
+ p_module_bank->first->psz_name );
/* We just free the module by hand. Niahahahahaha. */
- p_next = p_bank->first->next;
- free(p_bank->first);
- p_bank->first = p_next;
+ p_next = p_module_bank->first->next;
+ free(p_module_bank->first);
+ p_module_bank->first = p_next;
}
}
/* Destroy the lock */
- vlc_mutex_destroy( &p_bank->lock );
+ vlc_mutex_destroy( &p_module_bank->lock );
return;
}
* This function resets the module bank by unloading all unused plugin
* modules.
*****************************************************************************/
-void module_ResetBank( )
+void module_ResetBank( void )
{
intf_ErrMsg( "FIXME: module_ResetBank unimplemented" );
return;
* This function parses the module bank and hides modules that have been
* unused for a while.
*****************************************************************************/
-void module_ManageBank( )
+void module_ManageBank( void )
{
#ifdef HAVE_DYNAMIC_PLUGINS
module_t * p_module;
/* We take the global lock */
- vlc_mutex_lock( &p_bank->lock );
+ vlc_mutex_lock( &p_module_bank->lock );
/* Parse the module list to see if any modules need to be unloaded */
- for( p_module = p_bank->first ;
+ for( p_module = p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
}
/* We release the global lock */
- vlc_mutex_unlock( &p_bank->lock );
+ vlc_mutex_unlock( &p_module_bank->lock );
#endif /* HAVE_DYNAMIC_PLUGINS */
return;
int i_index;
/* We take the global lock */
- vlc_mutex_lock( &p_bank->lock );
+ vlc_mutex_lock( &p_module_bank->lock );
/* Parse the module list for capabilities and probe each of them */
- for( p_module = p_bank->first ;
+ for( p_module = p_module_bank->first ;
p_module != NULL ;
p_module = p_module->next )
{
}
/* We can release the global lock, module refcount was incremented */
- vlc_mutex_unlock( &p_bank->lock );
+ vlc_mutex_unlock( &p_module_bank->lock );
if( p_bestmodule != NULL )
{
void module_Unneed( module_t * p_module )
{
/* We take the global lock */
- vlc_mutex_lock( &p_bank->lock );
+ vlc_mutex_lock( &p_module_bank->lock );
/* Just unlock the module - we can't do anything if it fails,
* so there is no need to check the return value. */
intf_WarnMsg( 3, "module: unlocking module `%s'", p_module->psz_name );
/* We release the global lock */
- vlc_mutex_unlock( &p_bank->lock );
+ vlc_mutex_unlock( &p_module_bank->lock );
return;
}
}
/* Check that we don't already have a module with this name */
- for( p_othermodule = p_bank->first ;
+ for( p_othermodule = p_module_bank->first ;
p_othermodule != NULL ;
p_othermodule = p_othermodule->next )
{
p_module->b_builtin = 0;
/* Link module into the linked list */
- if( p_bank->first != NULL )
+ if( p_module_bank->first != NULL )
{
- p_bank->first->prev = p_module;
+ p_module_bank->first->prev = p_module;
}
- p_module->next = p_bank->first;
+ p_module->next = p_module_bank->first;
p_module->prev = NULL;
- p_bank->first = p_module;
+ p_module_bank->first = p_module;
/* Immediate message so that a slow module doesn't make the user wait */
intf_WarnMsgImm( 2, "module: plugin module `%s', %s",
}
/* Check that we don't already have a module with this name */
- for( p_othermodule = p_bank->first ;
+ for( p_othermodule = p_module_bank->first ;
p_othermodule != NULL ;
p_othermodule = p_othermodule->next )
{
p_module->is.builtin.pf_deactivate = pf_deactivate;
/* Link module into the linked list */
- if( p_bank->first != NULL )
+ if( p_module_bank->first != NULL )
{
- p_bank->first->prev = p_module;
+ p_module_bank->first->prev = p_module;
}
- p_module->next = p_bank->first;
+ p_module->next = p_module_bank->first;
p_module->prev = NULL;
- p_bank->first = p_module;
+ p_module_bank->first = p_module;
/* Immediate message so that a slow module doesn't make the user wait */
intf_WarnMsgImm( 2, "module: builtin module `%s', %s",
#endif
/* Unlink the module from the linked list. */
- if( p_module == p_bank->first )
+ if( p_module == p_module_bank->first )
{
- p_bank->first = p_module->next;
+ p_module_bank->first = p_module->next;
}
if( p_module->prev != NULL )
* spu_decoder.c : spu decoder thread
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: spu_decoder.c,v 1.39 2001/05/01 12:22:18 sam Exp $
+ * $Id: spu_decoder.c,v 1.40 2001/05/06 04:32:02 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_spudec->p_fifo = p_config->decoder_config.p_decoder_fifo;
/* XXX: The vout request and fifo opening will eventually be here */
- if( p_spudec->p_vout == NULL )
+
+ /* Spawn an audio output if there is none */
+ vlc_mutex_lock( &p_vout_bank->lock );
+
+ if( p_vout_bank->i_count == 0 )
{
- if( p_main->p_vout == NULL )
+ intf_Msg( "spudec: no vout present, spawning one" );
+
+ p_spudec->p_vout = vout_CreateThread( NULL );
+
+ /* Everything failed */
+ if( p_spudec->p_vout == NULL )
{
- intf_Msg( "vpar: no vout present, spawning one" );
- p_main->p_vout = vout_CreateThread( NULL );
+ intf_Msg( "spudec: can't open vout, aborting" );
+ vlc_mutex_unlock( &p_vout_bank->lock );
+ free( p_spudec );
+
+ return 0;
}
- p_spudec->p_vout = p_main->p_vout;
+ p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_spudec->p_vout;
+ p_vout_bank->i_count++;
+ }
+ else
+ {
+ /* Take the first video output FIXME: take the best one */
+ p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
}
+ vlc_mutex_unlock( &p_vout_bank->lock );
+
/* Spawn the spu decoder thread */
if ( vlc_thread_create(&p_spudec->thread_id, "spu decoder",
(vlc_thread_func_t)RunThread, (void *)p_spudec) )
{
intf_ErrMsg( "spudec error: can't spawn spu decoder thread" );
free( p_spudec );
- return( 0 );
+ return 0;
}
return( p_spudec->thread_id );
+++ /dev/null
-/*****************************************************************************
- * vdec_idct.h : types for the inverse discrete cosine transform
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_idct.h,v 1.4 2001/01/17 18:17:30 massiot Exp $
- *
- * Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
- * Christophe Massiot <massiot@via.ecp.fr>
- *
- * 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.
- *****************************************************************************/
-
-struct vdec_thread_s;
-
-typedef void ( *idct_init_t ) ( struct vdec_thread_s * );
-typedef void ( *f_idct_t ) ( struct vdec_thread_s *, dctelem_t*, int );
-typedef void ( *norm_scan_t ) ( u8 ppi_scan[2][64] );
* video_decoder.c : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_decoder.c,v 1.48 2001/04/06 09:15:48 sam Exp $
+ * $Id: video_decoder.c,v 1.49 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gaël Hendryckx <jimmy@via.ecp.fr>
#include "video_output.h"
#include "vdec_motion.h"
-#include "vdec_idct.h"
#include "video_decoder.h"
#include "vpar_blocks.h"
int vdec_InitThread( vdec_thread_t *p_vdec )
#endif
{
-#ifndef HAVE_MMX
- int i_dummy;
-#endif
-
intf_DbgMsg("vdec debug: initializing video decoder thread %p", p_vdec);
-#ifndef HAVE_MMX
- /* Init crop table */
- p_vdec->pi_crop = p_vdec->pi_crop_buf + (VDEC_CROPRANGE >> 1);
- for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ )
- {
- p_vdec->pi_crop[i_dummy] = 0;
- }
- for( ; i_dummy < 255; i_dummy ++ )
- {
- p_vdec->pi_crop[i_dummy] = i_dummy;
- }
- for( ; i_dummy < (VDEC_CROPRANGE >> 1) -1; i_dummy++ )
- {
- p_vdec->pi_crop[i_dummy] = 255;
- }
-#endif
+ p_vdec->pf_vdec_init = p_vdec->p_vpar->pf_vdec_init;
+ p_vdec->pf_decode_mb_c = p_vdec->p_vpar->pf_decode_mb_c;
+ p_vdec->pf_decode_mb_bw = p_vdec->p_vpar->pf_decode_mb_bw;
+
+ p_vdec->pf_vdec_init( p_vdec );
#ifdef VDEC_SMP
/* Re-nice ourself */
intf_DbgMsg("vdec debug: EndThread(%p)", p_vdec);
}
-/*****************************************************************************
- * AddBlock : add a block
- *****************************************************************************/
-#ifndef HAVE_MMX
-static __inline__ void AddBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
- yuv_data_t * p_data, int i_incr )
-{
- int i_x, i_y;
-
- for( i_y = 0; i_y < 8; i_y++ )
- {
- for( i_x = 0; i_x < 8; i_x++ )
- {
- *p_data = p_vdec->pi_crop[*p_data + *p_block++];
- p_data++;
- }
- p_data += i_incr;
- }
-}
-#else
-static __inline__ void AddBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
- yuv_data_t * p_data, int i_incr )
-{
- asm __volatile__ (
- "pxor %%mm7,%%mm7\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw (%2),%%mm2\n\t"
- "paddw 8(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 16(%2),%%mm2\n\t"
- "paddw 24(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 32(%2),%%mm2\n\t"
- "paddw 40(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 48(%2),%%mm2\n\t"
- "paddw 56(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 64(%2),%%mm2\n\t"
- "paddw 72(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 80(%2),%%mm2\n\t"
- "paddw 88(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 96(%2),%%mm2\n\t"
- "paddw 104(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq (%0),%%mm1\n\t"
- "movq %%mm1,%%mm2\n\t"
- "punpckhbw %%mm7,%%mm1\n\t"
- "punpcklbw %%mm7,%%mm2\n\t"
- "paddw 112(%2),%%mm2\n\t"
- "paddw 120(%2),%%mm1\n\t"
- "packuswb %%mm1,%%mm2\n\t"
- "movq %%mm2,(%0)\n\t"
-
- //"emms"
- : "=r" (p_data)
- : "0" (p_data), "r" (p_block), "r" (i_incr + 8) );
-}
-#endif
-
-
-/*****************************************************************************
- * CopyBlock : copy a block
- *****************************************************************************/
-#ifndef HAVE_MMX
-static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
- yuv_data_t * p_data, int i_incr )
-{
- int i_x, i_y;
-
- for( i_y = 0; i_y < 8; i_y++ )
- {
- for( i_x = 0; i_x < 8; i_x++ )
- {
- *p_data++ = p_vdec->pi_crop[*p_block++];
- }
- p_data += i_incr;
- }
-}
-#else
-static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
- yuv_data_t * p_data, int i_incr )
-{
- asm __volatile__ (
- "movq (%2),%%mm0\n\t"
- "packuswb 8(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 16(%2),%%mm0\n\t"
- "packuswb 24(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 32(%2),%%mm0\n\t"
- "packuswb 40(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 48(%2),%%mm0\n\t"
- "packuswb 56(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 64(%2),%%mm0\n\t"
- "packuswb 72(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 80(%2),%%mm0\n\t"
- "packuswb 88(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 96(%2),%%mm0\n\t"
- "packuswb 104(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
- "addl %3,%0\n\t"
-
- "movq 112(%2),%%mm0\n\t"
- "packuswb 120(%2),%%mm0\n\t"
- "movq %%mm0,(%0)\n\t"
-
- //"emms"
- : "=r" (p_data)
- : "0" (p_data), "r" (p_block), "r" (i_incr + 8) );
-}
-#endif
-
-
-/*****************************************************************************
- * vdec_DecodeMacroblock : decode a macroblock of a picture
- *****************************************************************************/
-#define DECODEBLOCKSC( OPBLOCK ) \
-{ \
- int i_b, i_mask; \
- \
- i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
- \
- /* luminance */ \
- for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
- { \
- if( p_mb->i_coded_block_pattern & i_mask ) \
- { \
- /* \
- * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
- */ \
- (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->pi_sparse_pos[i_b] ); \
- \
- /* \
- * Adding prediction and coefficient data (ISO/IEC 13818-2 \
- * section 7.6.8) \
- */ \
- OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
- } \
- } \
- \
- /* chrominance */ \
- for( i_b = 4; i_b < 4 + p_mb->i_chroma_nb_blocks; \
- i_b++, i_mask >>= 1 ) \
- { \
- if( p_mb->i_coded_block_pattern & i_mask ) \
- { \
- /* \
- * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
- */ \
- (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->pi_sparse_pos[i_b] ); \
- \
- /* \
- * Adding prediction and coefficient data (ISO/IEC 13818-2 \
- * section 7.6.8) \
- */ \
- OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->p_data[i_b], p_mb->i_addb_c_stride ); \
- } \
- } \
-}
-
-#define DECODEBLOCKSBW( OPBLOCK ) \
-{ \
- int i_b, i_mask; \
- \
- i_mask = 1 << (3 + p_mb->i_chroma_nb_blocks); \
- \
- /* luminance */ \
- for( i_b = 0; i_b < 4; i_b++, i_mask >>= 1 ) \
- { \
- if( p_mb->i_coded_block_pattern & i_mask ) \
- { \
- /* \
- * Inverse DCT (ISO/IEC 13818-2 section Annex A) \
- */ \
- (p_mb->pf_idct[i_b])( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->pi_sparse_pos[i_b] ); \
- \
- /* \
- * Adding prediction and coefficient data (ISO/IEC 13818-2 \
- * section 7.6.8) \
- */ \
- OPBLOCK( p_vdec, p_mb->ppi_blocks[i_b], \
- p_mb->p_data[i_b], p_mb->i_addb_l_stride ); \
- } \
- } \
-}
-
-void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
-{
- if( !(p_mb->i_mb_type & MB_INTRA) )
- {
- /*
- * Motion Compensation (ISO/IEC 13818-2 section 7.6)
- */
- if( p_mb->pf_motion == 0 )
- {
- intf_WarnMsg( 2, "pf_motion set to NULL" );
- }
- else
- {
- p_mb->pf_motion( p_mb );
- }
-
- DECODEBLOCKSC( AddBlock )
- }
- else
- {
- DECODEBLOCKSC( CopyBlock )
- }
-
- /*
- * Decoding is finished, release the macroblock and free
- * unneeded memory.
- */
- vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
-}
-
-void vdec_DecodeMacroblockBW ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
-{
- if( !(p_mb->i_mb_type & MB_INTRA) )
- {
- /*
- * Motion Compensation (ISO/IEC 13818-2 section 7.6)
- */
- if( p_mb->pf_motion == 0 )
- {
- intf_WarnMsg( 2, "pf_motion set to NULL" );
- }
- else
- {
- p_mb->pf_motion( p_mb );
- }
-
- DECODEBLOCKSBW( AddBlock )
- }
- else
- {
- DECODEBLOCKSBW( CopyBlock )
- }
-
- /*
- * Decoding is finished, release the macroblock and free
- * unneeded memory.
- */
- vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
-}
-
-
-
/*****************************************************************************
* RunThread: video decoder thread
*****************************************************************************
if( (p_mb = vpar_GetMacroblock( &p_vdec->p_vpar->vfifo )) != NULL )
{
- vdec_DecodeMacroblockC ( p_vdec, p_mb );
+ p_vdec->pf_decode_mb_c( p_vdec, p_mb );
}
}
EndThread( p_vdec );
p_vdec->b_run = 0;
}
+
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
+ * $Id: video_output.c,v 1.123 2001/05/06 04:32:02 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
static void SetPalette ( p_vout_thread_t p_vout, u16 *red,
u16 *green, u16 *blue, u16 *transp );
+/*****************************************************************************
+ * vout_InitBank: initialize the video output bank.
+ *****************************************************************************/
+void vout_InitBank ( void )
+{
+ p_vout_bank->i_count = 0;
+
+ vlc_mutex_init( &p_vout_bank->lock );
+}
+
+/*****************************************************************************
+ * vout_EndBank: empty the video output bank.
+ *****************************************************************************
+ * This function ends all unused video outputs and empties the bank in
+ * case of success.
+ *****************************************************************************/
+void vout_EndBank ( void )
+{
+ /* Ask all remaining video outputs to die */
+ while( p_vout_bank->i_count )
+ {
+ vout_DestroyThread(
+ p_vout_bank->pp_vout[ --p_vout_bank->i_count ], NULL );
+ }
+
+ vlc_mutex_destroy( &p_vout_bank->lock );
+}
+
/*****************************************************************************
* vout_CreateThread: creates a new video output thread
*****************************************************************************
* video_fifo.c : video FIFO management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_fifo.c,v 1.30 2001/04/06 09:15:48 sam Exp $
+ * $Id: video_fifo.c,v 1.31 2001/05/06 04:32:02 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
#include "video_decoder.h"
#include "vdec_motion.h"
-#include "../video_decoder/vdec_idct.h"
#include "vpar_blocks.h"
-#include "../video_decoder/vpar_headers.h"
-#include "../video_decoder/vpar_synchro.h"
-#include "../video_decoder/video_parser.h"
-#include "../video_decoder/video_fifo.h"
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
/*****************************************************************************
* vpar_InitFIFO : initialize the video FIFO
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.c,v 1.84 2001/05/01 15:12:22 sam Exp $
+ * $Id: video_parser.c,v 1.85 2001/05/06 04:32:03 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
#include "video_decoder.h"
#include "vdec_motion.h"
-#include "../video_decoder/vdec_idct.h"
#include "vpar_blocks.h"
-#include "../video_decoder/vpar_headers.h"
-#include "../video_decoder/vpar_synchro.h"
-#include "../video_decoder/video_parser.h"
-#include "../video_decoder/video_fifo.h"
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
/*
* Local prototypes
}
#define f p_vpar->p_idct_module->p_functions->idct.functions.idct
- p_vpar->pf_init = f.pf_init;
+ p_vpar->pf_idct_init = f.pf_idct_init;
p_vpar->pf_sparse_idct = f.pf_sparse_idct;
p_vpar->pf_idct = f.pf_idct;
p_vpar->pf_norm_scan = f.pf_norm_scan;
+ p_vpar->pf_vdec_init = f.pf_vdec_init;
+ p_vpar->pf_decode_mb_c = f.pf_decode_mb_c;
+ p_vpar->pf_decode_mb_bw = f.pf_decode_mb_bw;
#undef f
/* Spawn the video parser thread */
}
#else
/* Fake a video_decoder thread */
- if( (p_vpar->pp_vdec[0] = (vdec_thread_t *)malloc(sizeof( vdec_thread_t )))
- == NULL || vdec_InitThread( p_vpar->pp_vdec[0] ) )
+ p_vpar->pp_vdec[0] = (vdec_thread_t *)malloc(sizeof( vdec_thread_t ));
+
+ if( p_vpar->pp_vdec[0] == NULL )
{
return( 1 );
}
+
p_vpar->pp_vdec[0]->b_die = 0;
p_vpar->pp_vdec[0]->b_error = 0;
p_vpar->pp_vdec[0]->p_vpar = p_vpar;
+ if( vdec_InitThread( p_vpar->pp_vdec[0] ) )
+ {
+ return( 1 );
+ }
+
# if !defined(SYS_BEOS) && !defined(WIN32)
# if VDEC_NICE
/* Re-nice ourself */
* vpar_blocks.c : blocks parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_blocks.c,v 1.80 2001/04/28 03:36:25 sam Exp $
+ * $Id: vpar_blocks.c,v 1.81 2001/05/06 04:32:03 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
#include "video_decoder.h"
#include "vdec_motion.h"
-#include "../video_decoder/vdec_idct.h"
#include "vpar_blocks.h"
-#include "../video_decoder/vpar_headers.h"
-#include "../video_decoder/vpar_synchro.h"
-#include "../video_decoder/video_parser.h"
-#include "../video_decoder/video_fifo.h"
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
/*
* Welcome to vpar_blocks.c ! Here's where the heavy processor-critical parsing
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.85 2001/05/01 15:12:22 sam Exp $
+ * $Id: vpar_headers.c,v 1.86 2001/05/06 04:32:03 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stéphane Borel <stef@via.ecp.fr>
#include "video_decoder.h"
#include "vdec_motion.h"
-#include "../video_decoder/vdec_idct.h"
#include "vpar_blocks.h"
-#include "../video_decoder/vpar_headers.h"
-#include "../video_decoder/vpar_synchro.h"
-#include "../video_decoder/video_parser.h"
-#include "../video_decoder/video_fifo.h"
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
+#include "video_fifo.h"
#include "main.h" /* XXX REMOVE THIS */
ExtensionAndUserData( p_vpar );
/* XXX: The vout request and fifo opening will eventually be here */
- if( p_vpar->p_vout == NULL )
+
+ /* Spawn an audio output if there is none */
+ vlc_mutex_lock( &p_vout_bank->lock );
+
+ if( p_vout_bank->i_count == 0 )
{
- if( p_main->p_vout == NULL )
+ intf_Msg( "vpar: no vout present, spawning one" );
+
+ p_vpar->p_vout = vout_CreateThread( NULL );
+
+ /* Everything failed */
+ if( p_vpar->p_vout == NULL )
{
- intf_Msg( "vpar: no vout present, spawning one" );
- p_main->p_vout = vout_CreateThread( NULL );
+ intf_Msg( "vpar: can't open vout, aborting" );
+ vlc_mutex_unlock( &p_vout_bank->lock );
- /* Spawning another one for fun */
- //vout_CreateThread( NULL );
+ /* XXX ! XXX ! XXX ! what to do here ? */
+ return;
}
-
- p_vpar->p_vout = p_main->p_vout;
+
+ p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_vpar->p_vout;
+ p_vout_bank->i_count++;
}
+ else
+ {
+ /* Take the first video output FIXME: take the best one */
+ p_vpar->p_vout = p_vout_bank->pp_vout[ 0 ];
+ }
+
+ vlc_mutex_unlock( &p_vout_bank->lock );
}
/*****************************************************************************
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_synchro.c,v 1.88 2001/04/27 19:29:11 massiot Exp $
+ * $Id: vpar_synchro.c,v 1.89 2001/05/06 04:32:03 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
#include "video_decoder.h"
#include "vdec_motion.h"
-#include "../video_decoder/vdec_idct.h"
#include "vpar_blocks.h"
-#include "../video_decoder/vpar_headers.h"
-#include "../video_decoder/vpar_synchro.h"
-#include "../video_decoder/video_parser.h"
+#include "vpar_headers.h"
+#include "vpar_synchro.h"
+#include "video_parser.h"
#include "main.h"