Commit eb1ec4a4 authored by Sam Hocevar's avatar Sam Hocevar

* ./src/misc/modules_plugin.h: exported input_ClockManageRef for fenrir.

  * ./include/video.h: moved vout_CopyPicture out of the way, an inline
    function did not make sense here.
  * ./include/video.h: moved vout_ChromaCmp out of the way.
  * ./plugins/avi/fourcc.h, ./include/video.h: merged these two files into
    video.h.
  * ./include/os_specific.h: this file is now always included.
  * ./include/debug.h: removed this file which was almost useless, and moved
    ASSERT to common.h.
  * ./include/common.h: fixed vlc_memalign and changed its prototype to
    follow posix_memalign's.
parent ebf1f255
......@@ -4,6 +4,57 @@
HEAD
* ./src/misc/modules_plugin.h: exported input_ClockManageRef for fenrir.
* ./include/video.h: moved vout_CopyPicture out of the way, an inline
function did not make sense here.
* ./include/video.h: moved vout_ChromaCmp out of the way.
* ./plugins/avi/fourcc.h, ./include/video.h: merged these two files into
video.h.
* ./include/os_specific.h: this file is now always included.
* ./include/debug.h: removed this file which was almost useless, and moved
ASSERT to common.h.
* ./include/common.h: fixed vlc_memalign and changed its prototype to
follow posix_memalign's.
* ./configure.in: dropped usage of $withval and $enableval in favor of the
safer variants $with_foo and $enable_foo.
* ./plugins/avi/avi.c: will not segfault when no audio is found/supported.
* ./plugins/ffmpeg/ffmpeg.c: with empty frame(data_packet) it won't segfault.
* ./plugins/avi/avi.c: use KeyFrame to seek, so video will not be bad as
before.
* ./plugins/mpeg_system/mpeg_ts.c: moved Program Specific Information
decoder to the ts demux module.
* ./plugins/mpeg_system/Makefile: added a mpeg_ts_dvbpsi module tha uses
libdvbpsi to decode PSIs. It is used by default if the lib is found. It
shares much code with mpeg_ts.
* ./plugins/directx/vout_events.c: fixed typo. You have to double click on
the video window to switch to fullscreen.
* ./src/misc/configuration.c: on Win32 the config file is now stored under
the "Application Data" folder belonging to the user. (this works if at
least IE4 is installed, otherwise the old method is used to get the
config directory)
* ./configure.in: fixed MacOS X module linking problem.
* ./src/interface/main.c: we no longer segfault if argc == 0.
* ALL: renamed PLUGINS to __PLUGINS__ to avoid conflicts with libraries
defining it. Grmbl.
* ./src/input/input_ext-plugins.c: cosmetic change.
* ./plugins/ac3_adec/*: use of _M to avoid conflict with libavcodec.a.
* ./plugins/avi/*: a light AVI demux.
* ./plugins/ffmpeg/*: a video decoder for divx v3 and opendivx.
* ./plugins/win32/preferences.cpp: fixed a compilation bug
* ./plugins/avi, ./plugins/ffmpeg: created empty directories for fenrir's
upcoming work.
* ./plugins/spudec/spu_decoder.c: fixed the spu decoder to take the pitch
of the destination picture into account when rendering the subtitles
(Implemented only for the YUV modes).
* ./plugins/directx/vout_events.c: fixed the mouse autohidding feature in
the DirectX plugin (at least partially).
* ./plugins/directx/vout_directx.c: fixed the DirectX video output for
non-overlay modes. It was only working in RGB16 before.
* ./plugins/directx/vout_directx.c: DirectX video output plugin now uses
triple buffering for YUV overlay. This improves the video quality a lot
(no tearing) without affecting performance. (I knew double buffering
sucked but I just discovered why triple buffering is better: you don't
have to wait for the vsync to flip the buffers).
* ./plugins/spudec/spu_decoder.c, ./plugins/dvd/dvd_es.c: temporary fix
to avoid retrieving the spu palette from a network stream as if it was
a DVD.
......
......@@ -254,8 +254,8 @@ endif
# C compiler flags: plugins and builtins compilation
#
vlc_CFLAGS += -D__VLC__
plugins_CFLAGS += -D__PLUGIN__ -I../../include -I../../extras
builtins_CFLAGS += -D__BUILTIN__ -I../../include -I../../extras
plugins_CFLAGS += -D__VLC__ -D__PLUGIN__ -I../../include -I../../extras
builtins_CFLAGS += -D__VLC__ -D__BUILTIN__ -I../../include -I../../extras
#
# Linker flags: plugins and builtins linking
......
......@@ -1455,10 +1455,6 @@ SOURCE=..\..\include\darwin_specific.h
# End Source File
# Begin Source File
SOURCE=..\..\include\debug.h
# End Source File
# Begin Source File
SOURCE=.\defs.h
# End Source File
# Begin Source File
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.98 2002/04/25 02:10:33 jobi Exp $
* $Id: common.h,v 1.99 2002/04/25 21:52:42 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -378,13 +378,15 @@ struct intf_subscription_s;
/* Some systems have memalign() but no declaration for it */
void * memalign( size_t align, size_t size );
# define vlc_memalign(align,size,pp_orig) \
# define vlc_memalign(pp_orig,align,size) \
( *(pp_orig) = memalign( align, size ) )
#else /* We don't have any choice but to align manually */
# define vlc_memalign(align,size,pp_orig) \
(( *(pp_orig) = malloc( size + align - 1 )) ? \
(void *)( (((unsigned long)*(pp_orig)) + 15) & ~0xFUL ) : NULL )
# define vlc_memalign(pp_orig,align,size) \
(( *(pp_orig) = malloc( size + align - 1 )) \
? (void *)( (((unsigned long)*(pp_orig)) + (unsigned long)(align-1) ) \
% (unsigned long)align ) \
: NULL )
#endif
......@@ -500,6 +502,22 @@ typedef __int64 off_t;
# define N_(String) (String)
#endif
/*****************************************************************************
* Debug macros
*****************************************************************************/
/* ASSERT: this macro is used to test that a pointer is not nul. It inserts
* the needed code when the program is compiled with the debug option, but
* does nothing when not in debug mode. */
#ifdef DEBUG
# define ASSERT(p_Mem) \
if (!(p_Mem)) \
intf_ErrMsg("Void pointer error: " \
"%s line %d (variable %s at address %p)\n", \
__FILE__, __LINE__, #p_Mem, &p_Mem);
#else
# define ASSERT(p_Mem)
#endif
/*****************************************************************************
* Plug-in stuff
*****************************************************************************/
......@@ -615,6 +633,9 @@ typedef struct module_symbols_s
struct data_packet_s *,
struct es_descriptor_s *,
boolean_t ) );
void ( * input_ClockManageRef ) ( struct input_thread_s *,
struct pgrm_descriptor_s *,
mtime_t );
int ( * input_ClockManageControl ) ( struct input_thread_s *,
struct pgrm_descriptor_s *,
mtime_t );
......@@ -664,6 +685,7 @@ typedef struct module_symbols_s
struct picture_s *, mtime_t );
void ( * vout_PlacePicture ) ( struct vout_thread_s *, int, int,
int *, int *, int *, int * );
int ( * vout_ChromaCmp ) ( u32, u32 );
struct subpicture_s * (* vout_CreateSubPicture)
( struct vout_thread_s *, int, int );
......
/*****************************************************************************
* debug.h: vlc debug macros
* Stand alone file
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: debug.h,v 1.8 2001/03/21 13:42:33 sam Exp $
*
* Authors: Benoît Steiner <benny@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.
*****************************************************************************/
/*****************************************************************************
* Required headers:
* - <string.h>
* - intf_msg.h
*****************************************************************************/
/*****************************************************************************
* ASSERT
*****************************************************************************
* This macro is used to test that a pointer is not nul. It insert the needed
* code when the program is compiled with the debug option, but does nothing
* in release program.
*****************************************************************************/
#ifdef DEBUG
#define ASSERT(p_Mem) \
if (!(p_Mem)) \
intf_ErrMsg("Void pointer error: " \
"%s line %d (variable %s at address %p)\n", \
__FILE__, __LINE__, #p_Mem, &p_Mem);
#else
#define ASSERT(p_Mem)
#endif
/*****************************************************************************
* RZERO
*****************************************************************************
* This macro is used to initialise a variable to 0. It is very useful when
* used with the ASSERT macro. It also only insert the needed code when the
* program is compiled with the debug option.
*****************************************************************************/
#ifdef DEBUG
#define RZERO(r_Var) \
bzero(&(r_Var), sizeof((r_Var)));
#else
#define RZERO(r_Var)
#endif
/*****************************************************************************
* PZERO
*****************************************************************************
* This macro is used to initiase the memory pointed out by a pointer to 0.
* It has the same purpose than RZERO, but for pointers.
*****************************************************************************/
/* It is already defined on BSD */
#ifndef PZERO
#ifdef DEBUG
#define PZERO(p_Mem) \
bzero((p_Mem), sizeof(*(p_Mem)));
#else
#define PZERO(p_Mem)
#endif
#endif
/*****************************************************************************
* AZERO
*****************************************************************************
* This macro is used to initiase an array of variables to 0.
* It has the same purpose than RZERO or PZERO, but for array
*****************************************************************************/
#ifdef DEBUG
#define AZERO(p_Array, i_Size) \
bzero((p_Array), (i_Size)*sizeof(*(p_Array)));
#else
#define ZERO(p_Array, i_Size)
#endif
......@@ -3,7 +3,7 @@
* but exported to plug-ins
*****************************************************************************
* Copyright (C) 1999-2002 VideoLAN
* $Id: input_ext-plugins.h,v 1.23 2002/04/25 02:10:33 jobi Exp $
* $Id: input_ext-plugins.h,v 1.24 2002/04/25 21:52:42 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -100,6 +100,7 @@ void input_ClockManageRef( struct input_thread_s *,
mtime_t input_ClockGetTS( struct input_thread_s *,
struct pgrm_descriptor_s *, mtime_t );
#else
# define input_ClockManageRef p_symbols->input_ClockManageRef
# define input_ClockManageControl p_symbols->input_ClockManageControl
#endif
......
......@@ -2,7 +2,7 @@
* os_specific.h: OS specific features
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: os_specific.h,v 1.2 2002/04/24 00:36:24 sam Exp $
* $Id: os_specific.h,v 1.3 2002/04/25 21:52:42 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -22,19 +22,23 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifdef SYS_BEOS
# include "beos_specific.h"
#ifndef _NEED_OS_SPECIFIC_H
# define _NEED_OS_SPECIFIC_H 1
#endif
#ifdef SYS_DARWIN
#if defined( SYS_BEOS )
# include "beos_specific.h"
#elif defined( SYS_DARWIN )
# include "darwin_specific.h"
#endif
#ifdef WIN32
#elif defined( WIN32 )
# include "win32_specific.h"
#else
# undef _NEED_OS_SPECIFIC_H
#endif
#ifdef __cplusplus
# ifdef __cplusplus
extern "C" {
#endif
# endif
/*****************************************************************************
* main_sys_t: system specific descriptor
......@@ -42,19 +46,25 @@ extern "C" {
struct main_sys_s;
#ifndef __PLUGIN__
extern struct main_sys_s *p_main_sys;
extern struct main_sys_s *p_main_sys;
#else
# define p_main_sys (p_symbols->p_main_sys)
#endif
/*****************************************************************************
* Prototypes
*****************************************************************************/
void system_Init ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
void system_Configure ( void );
void system_End ( void );
#ifdef _NEED_OS_SPECIFIC_H
void system_Init ( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] );
void system_Configure ( void );
void system_End ( void );
#else
# define system_Init(...) {}
# define system_Configure(...) {}
# define system_End(...) {}
#endif
#ifdef __cplusplus
# ifdef __cplusplus
}
#endif
# endif
This diff is collapsed.
......@@ -5,7 +5,7 @@
* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.74 2002/04/24 00:36:24 sam Exp $
* $Id: video_output.h,v 1.75 2002/04/25 21:52:42 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -200,6 +200,8 @@ vout_fifo_t * vout_CreateFifo ( void );
void vout_DestroyFifo ( vout_fifo_t * );
void vout_FreeFifo ( vout_fifo_t * );
int vout_ChromaCmp ( u32, u32 );
picture_t * vout_CreatePicture ( vout_thread_t *,
boolean_t, boolean_t, boolean_t );
void vout_AllocatePicture( picture_t *, int, int, u32 );
......@@ -233,5 +235,6 @@ void vout_RenderSubPictures ( vout_thread_t *, picture_t *,
# define vout_LinkPicture p_symbols->vout_LinkPicture
# define vout_UnlinkPicture p_symbols->vout_UnlinkPicture
# define vout_PlacePicture p_symbols->vout_PlacePicture
# define vout_ChromaCmp p_symbols->vout_ChromaCmp
#endif
......@@ -2,7 +2,7 @@
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.7 2002/04/24 00:36:24 sam Exp $
* $Id: vlc.h,v 1.8 2002/04/25 21:52:42 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -26,7 +26,7 @@
/*****************************************************************************
* Required vlc headers
*****************************************************************************/
#if defined( __VLC__ ) || defined( __PLUGIN__ ) || defined( __BUILTIN__ )
#if defined( __VLC__ )
# include "defs.h"
# include "config.h"
......
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.7 2002/04/19 13:56:10 sam Exp $
* $Id: a52.c,v 1.8 2002/04/25 21:52:42 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -37,8 +37,6 @@
#include "stream_control.h"
#include "input_ext-dec.h"
#include "debug.h"
#include <a52dec/a52.h> /* liba52 header file */
#include "a52.h"
......
......@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.28 2002/04/23 23:44:36 fenrir Exp $
* $Id: ac3_adec.c,v 1.29 2002/04/25 21:52:42 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -120,7 +120,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
*/
p_ac3thread->p_fifo = p_ac3thread->p_config->p_decoder_fifo;
p_ac3thread->ac3_decoder =
vlc_memalign( 16, sizeof(ac3dec_t), &p_ac3thread->ac3_decoder_orig );
vlc_memalign( &p_ac3thread->ac3_decoder_orig, 16, sizeof(ac3dec_t) );
/*
* Choose the best downmix module
......@@ -153,7 +153,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
* Choose the best IMDCT module
*/
p_ac3thread->ac3_decoder->imdct =
vlc_memalign( 16, sizeof(imdct_t), &p_ac3thread->ac3_decoder->imdct_orig );
vlc_memalign( &p_ac3thread->ac3_decoder->imdct_orig, 16, sizeof(imdct_t) );
#define IMDCT p_ac3thread->ac3_decoder->imdct
psz_name = config_GetPszVariable( IMDCT_METHOD_VAR );
......@@ -180,39 +180,39 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
/* Initialize the ac3 decoder structures */
p_ac3thread->ac3_decoder->samples =
vlc_memalign( 16, 6 * 256 * sizeof(float),
&p_ac3thread->ac3_decoder->samples_orig );
IMDCT->buf = vlc_memalign( 16, N/4 * sizeof(complex_t),
&IMDCT->buf_orig );
IMDCT->delay = vlc_memalign( 16, 6 * 256 * sizeof(float),
&IMDCT->delay_orig );
IMDCT->delay1 = vlc_memalign( 16, 6 * 256 * sizeof(float),
&IMDCT->delay1_orig );
IMDCT->xcos1 = vlc_memalign( 16, N/4 * sizeof(float),
&IMDCT->xcos1_orig );
IMDCT->xsin1 = vlc_memalign( 16, N/4 * sizeof(float),
&IMDCT->xsin1_orig );
IMDCT->xcos2 = vlc_memalign( 16, N/8 * sizeof(float),
&IMDCT->xcos2_orig );
IMDCT->xsin2 = vlc_memalign( 16, N/8 * sizeof(float),
&IMDCT->xsin2_orig );
IMDCT->xcos_sin_sse = vlc_memalign( 16, 128 * 4 * sizeof(float),
&IMDCT->xcos_sin_sse_orig );
IMDCT->w_1 = vlc_memalign( 16, 1 * sizeof(complex_t),
&IMDCT->w_1_orig );
IMDCT->w_2 = vlc_memalign( 16, 2 * sizeof(complex_t),
&IMDCT->w_2_orig );
IMDCT->w_4 = vlc_memalign( 16, 4 * sizeof(complex_t),
&IMDCT->w_4_orig );
IMDCT->w_8 = vlc_memalign( 16, 8 * sizeof(complex_t),
&IMDCT->w_8_orig );
IMDCT->w_16 = vlc_memalign( 16, 16 * sizeof(complex_t),
&IMDCT->w_16_orig );
IMDCT->w_32 = vlc_memalign( 16, 32 * sizeof(complex_t),
&IMDCT->w_32_orig );
IMDCT->w_64 = vlc_memalign( 16, 64 * sizeof(complex_t),
&IMDCT->w_64_orig );
vlc_memalign( &p_ac3thread->ac3_decoder->samples_orig,
16, 6 * 256 * sizeof(float) );
IMDCT->buf = vlc_memalign( &IMDCT->buf_orig,
16, N/4 * sizeof(complex_t) );
IMDCT->delay = vlc_memalign( &IMDCT->delay_orig,
16, 6 * 256 * sizeof(float) );
IMDCT->delay1 = vlc_memalign( &IMDCT->delay1_orig,
16, 6 * 256 * sizeof(float) );
IMDCT->xcos1 = vlc_memalign( &IMDCT->xcos1_orig,
16, N/4 * sizeof(float) );
IMDCT->xsin1 = vlc_memalign( &IMDCT->xsin1_orig,
16, N/4 * sizeof(float) );
IMDCT->xcos2 = vlc_memalign( &IMDCT->xcos2_orig,
16, N/8 * sizeof(float) );
IMDCT->xsin2 = vlc_memalign( &IMDCT->xsin2_orig,
16, N/8 * sizeof(float) );
IMDCT->xcos_sin_sse = vlc_memalign( &IMDCT->xcos_sin_sse_orig,
16, 128 * 4 * sizeof(float) );
IMDCT->w_1 = vlc_memalign( &IMDCT->w_1_orig,
16, 1 * sizeof(complex_t) );
IMDCT->w_2 = vlc_memalign( &IMDCT->w_2_orig,
16, 2 * sizeof(complex_t) );
IMDCT->w_4 = vlc_memalign( &IMDCT->w_4_orig,
16, 4 * sizeof(complex_t) );
IMDCT->w_8 = vlc_memalign( &IMDCT->w_8_orig,
16, 8 * sizeof(complex_t) );
IMDCT->w_16 = vlc_memalign( &IMDCT->w_16_orig,
16, 16 * sizeof(complex_t) );
IMDCT->w_32 = vlc_memalign( &IMDCT->w_32_orig,
16, 32 * sizeof(complex_t) );
IMDCT->w_64 = vlc_memalign( &IMDCT->w_64_orig,
16, 64 * sizeof(complex_t) );
_M( ac3_init )( p_ac3thread->ac3_decoder );
......@@ -241,8 +241,8 @@ static int decoder_Run ( decoder_config_t * p_config )
boolean_t b_sync = 0;
/* Allocate the memory needed to store the thread's structure */
p_ac3thread = (ac3dec_thread_t *)vlc_memalign( 16,
sizeof(ac3dec_thread_t), &p_ac3thread_orig );
p_ac3thread = (ac3dec_thread_t *)vlc_memalign( &p_ac3thread_orig, 16,
sizeof(ac3dec_thread_t) );
if( p_ac3thread == NULL )
{
......
......@@ -2,7 +2,7 @@
* avi.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.c,v 1.3 2002/04/25 11:41:38 fenrir Exp $
* $Id: avi.c,v 1.4 2002/04/25 21:52:42 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -35,6 +35,8 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "video.h"
/*****************************************************************************
* Constants
*****************************************************************************/
......@@ -69,7 +71,6 @@ MODULE_DEACTIVATE_STOP
/*****************************************************************************
* Definition of structures and libraries for this plugins
*****************************************************************************/
#include "fourcc.h"
#include "libLE.c"
#include "libioRIFF.c"
#include "avi.h"
......
......@@ -2,7 +2,7 @@
* avi.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: avi.h,v 1.1 2002/04/23 23:44:36 fenrir Exp $
* $Id: avi.h,v 1.2 2002/04/25 21:52:42 sam Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -36,6 +36,13 @@
#define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */
#define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */
/* Sound formats */
#define WAVE_FORMAT_UNKNOWN 0x0000
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_MPEG 0x0050
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#define WAVE_FORMAT_AC3 0x2000
typedef struct bitmapinfoheader_s
{
u32 i_size; /* size of header */
......
/*****************************************************************************
* fourcc.h : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: fourcc.h,v 1.1 2002/04/23 23:44:36 fenrir Exp $
* Authors: Laurent Aimar <fenrir@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.
*****************************************************************************/
#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
( ((u32)ch0) | ( ((u32)ch1) << 8 ) | \
( ((u32)ch2) << 16 ) | ( ((u32)ch3) << 24 ) )
#define mmioTWOCC( ch0, ch1 ) \
( (u32)(ch0) | ( (u32)(ch1) << 8 ) )
#define WAVE_FORMAT_UNKNOWN 0x0000
#define WAVE_FORMAT_PCM 0x0001
#define WAVE_FORMAT_MPEG 0x0050
#define WAVE_FORMAT_MPEGLAYER3 0x0055
#define WAVE_FORMAT_AC3 0x2000
#define FOURCC_RIFF mmioFOURCC( 'R', 'I', 'F', 'F' )
#define FOURCC_LIST mmioFOURCC( 'L', 'I', 'S', 'T' )
#define FOURCC_JUNK mmioFOURCC( 'J', 'U', 'N', 'K' )
#define FOURCC_AVI mmioFOURCC( 'A', 'V', 'I', ' ' )
#define FOURCC_WAVE mmioFOURCC( 'W', 'A', 'V', 'E' )
#define FOURCC_avih mmioFOURCC( 'a', 'v', 'i', 'h' )
#define FOURCC_hdrl mmioFOURCC( 'h', 'd', 'r', 'l' )
#define FOURCC_movi mmioFOURCC( 'm', 'o', 'v', 'i' )
#define FOURCC_idx1 mmioFOURCC( 'i', 'd', 'x', '1' )
#define FOURCC_strl mmioFOURCC( 's', 't', 'r', 'l' )
#define FOURCC_strh mmioFOURCC( 's', 't', 'r', 'h' )
#define FOURCC_strf mmioFOURCC( 's', 't', 'r', 'f' )
#define FOURCC_strd mmioFOURCC( 's', 't', 'r', 'd' )
#define FOURCC_rec mmioFOURCC( 'r', 'e', 'c', ' ' )
#define FOURCC_auds mmioFOURCC( 'a', 'u', 'd', 's' )
#define FOURCC_vids mmioFOURCC( 'v', 'i', 'd', 's' )
#define TWOCC_wb mmioTWOCC( 'w', 'b' )
#define TWOCC_db mmioTWOCC( 'd', 'b' )
#define TWOCC_dc mmioTWOCC( 'd', 'c' )
#define TWOCC_pc mmioTWOCC( 'p', 'c' )
/* definition of mpeg4 (opendivx) codec */
#define FOURCC_DIVX mmioFOURCC( 'D', 'I', 'V', 'X' )
#define FOURCC_divx mmioFOURCC( 'd', 'i', 'v', 'x' )
#define FOURCC_DX50 mmioFOURCC( 'D', 'X', '5', '0' )
#define FOURCC_MP4S mmioFOURCC( 'M', 'P', '4', 'S' )
#define FOURCC_MPG4 mmioFOURCC( 'M', 'P', 'G', '4' )
#define FOURCC_mpg4 mmioFOURCC( 'm', 'p', 'g', '4' )
#define FOURCC_mp4v mmioFOURCC( 'm', 'p', '4', 'v' )
/* definition of msmepg (divx v3) codec */
#define FOURCC_DIV3 mmioFOURCC( 'D', 'I', 'V', '3' )
#define FOURCC_div3 mmioFOURCC( 'd', 'i', 'v', '3' )
#define FOURCC_DIV4 mmioFOURCC( 'D', 'I', 'V', '4' )
#define FOURCC_div4 mmioFOURCC( 'd', 'i', 'v', '4' )
#define FOURCC_DIV5 mmioFOURCC( 'D', 'I', 'V', '5' )
#define FOURCC_div5 mmioFOURCC( 'd', 'i', 'v', '5' )
#define FOURCC_DIV6 mmioFOURCC( 'D', 'I', 'V', '6' )
#define FOURCC_div6 mmioFOURCC( 'd', 'i', 'v', '6' )
#define FOURCC_3IV1 mmioFOURCC( '3', 'I', 'V', '1' )
#define FOURCC_AP41 mmioFOURCC( 'A', 'P', '4', '1' )
#define FOURCC_MP43 mmioFOURCC( 'M', 'P', '4', '3' )
#define FOURCC_mp43 mmioFOURCC( 'm', 'p', '4', '3' )
......@@ -2,7 +2,7 @@
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_dummy.c,v 1.21 2002/04/05 01:05:22 gbazin Exp $
* $Id: vout_dummy.c,v 1.22 2002/04/25 21:52:42 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -234,8 +234,8 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
case FOURCC_YV12:
/* Allocate the memory buffer */
p_pic->p_data = vlc_memalign( 16, i_width * i_height * 3 / 2,
&p_pic->p_data_orig );
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig,
16, i_width * i_height * 3 / 2 );
/* Y buffer */
p_pic->Y_PIXELS = p_pic->p_data;
......@@ -269,8 +269,8 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
case FOURCC_RV16:
/* Allocate the memory buffer */
p_pic->p_data = vlc_memalign( 16, i_width * i_height * 2,
&p_pic->p_data_orig );
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig,
16, i_width * i_height * 2 );
/* Fill important structures */
p_pic->p->p_pixels = p_pic->p_data;
......
......@@ -8,7 +8,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_access.c,v 1.14 2002/04/23 14:16:20 sam Exp $
* $Id: dvd_access.c,v 1.15 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -68,8 +68,6 @@
#include "dvd_summary.h"
#include "iso_lang.h"
#include "debug.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......
/* dvd_demux.c: DVD demux functions.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_demux.c,v 1.4 2002/03/18 19:14:52 sam Exp $
* $Id: dvd_demux.c,v 1.5 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -48,8 +48,6 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "debug.h"
/* how many packets DVDDemux will read in each loop */
#define DVD_READ_ONCE 64
......
/* dvd_es.c: functions to find and select ES
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_es.c,v 1.8 2002/04/23 20:58:23 sam Exp $
* $Id: dvd_es.c,v 1.9 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -59,8 +59,6 @@
#include "dvd_summary.h"
#include "iso_lang.h"
#include "debug.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
......
/* dvd_seek.c: functions to navigate through DVD.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_seek.c,v 1.4 2002/04/03 06:23:08 sam Exp $
* $Id: dvd_seek.c,v 1.5 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -58,8 +58,6 @@
#include "dvd_seek.h"
#include "dvd_ifo.h"
#include "debug.h"
#define title \
p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title
#define cell p_dvd->p_ifo->vts.cell_inf
......
......@@ -3,7 +3,7 @@
* found in .ifo.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_summary.c,v 1.16 2002/04/03 06:23:08 sam Exp $
* $Id: dvd_summary.c,v 1.17 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -57,8 +57,6 @@
#include "dvd_ifo.h"
#include "iso_lang.h"
#include "debug.h"
/*
* Local tools to decode some data in ifo
*/
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input_dvdread.c,v 1.36 2002/04/23 14:16:20 sam Exp $
* $Id: input_dvdread.c,v 1.37 2002/04/25 21:52:42 sam Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -76,8 +76,6 @@
#include "iso_lang.h"
#include "debug.h"
/* how many blocks DVDRead will read in each loop */
#define DVD_BLOCK_READ_ONCE 64
......
......@@ -640,8 +640,8 @@ static int QTNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
p_pic->p_sys->i_size = sizeof(PlanarPixmapInfoYUV420);
/* Allocate the memory buffer */
p_pic->p_data = vlc_memalign( 16, i_width * i_height * 3 / 2,
&p_pic->p_data_orig );
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig,
16, i_width * i_height * 3 / 2 );
/* Y buffer */
p_pic->Y_PIXELS = p_pic->p_data;
......
......@@ -33,8 +33,6 @@
#include "stream_control.h"
#include "input_ext-dec.h"
#include "debug.h"
/*****************************************************************************
* Libmad include files *
*****************************************************************************/
......
......@@ -31,8 +31,6 @@
#include "stream_control.h"
#include "input_ext-dec.h"
#include "debug.h"
/*****************************************************************************
* Libmad includes files
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* vpar_pool.c : management of the pool of decoder threads
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: vpar_pool.c,v 1.7 2002/04/05 01:05:22 gbazin Exp $
* $Id: vpar_pool.c,v 1.8 2002/04/25 21:52:42 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -89,8 +89,8 @@ void vpar_InitPool( vpar_thread_t * p_vpar )
for( j = 0; j < 12; j++ )
{
p_vpar->pool.mb.p_idcts[j].pi_block =
vlc_memalign( 16, 64 * sizeof(dctelem_t),
&p_vpar->pool.mb.p_idcts[j].pi_block_orig );
vlc_memalign( &p_vpar->pool.mb.p_idcts[j].pi_block_orig,
16, 64 * sizeof(dctelem_t) );
}
}
......@@ -168,8 +168,8 @@ void vpar_SpawnPool( vpar_thread_t * p_vpar )
for( j = 0; j < 12; j++ )
{
p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block =
vlc_memalign( 16, 64 * sizeof(dctelem_t),
&p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block_orig );
vlc_memalign( &p_vpar->pool.p_macroblocks[i].p_idcts[j].pi_block_orig,
16, 64 * sizeof(dctelem_t) );
}
p_vpar->pool.pp_vdec[i] = vdec_CreateThread( &p_vpar->pool );
......
......@@ -47,8 +47,6 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "debug.h"
#include "satellite_tools.h"
#define SATELLITE_READ_ONCE 3
......
......@@ -53,8 +53,6 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "debug.h"
#include "input_vcd.h"
#include "cdrom_tools.h"
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_programs.c,v 1.82 2002/04/23 23:44:36 fenrir Exp $
* $Id: input_programs.c,v 1.83 2002/04/25 21:52:42 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -35,8 +35,6 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "debug.h"
/*
* NOTICE : all of these functions expect you to have taken the lock on
* p_input->stream.lock
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: main.c,v 1.187 2002/04/24 00:36:24 sam Exp $
* $Id: main.c,v 1.188 2002/04/25 21:52:42 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -80,8 +80,6 @@
#include "video.h"
#include "video_output.h"
#include "debug.h"
/*****************************************************************************
* Configuration options for the main program. Each module will also separatly
* define its own configuration options.
......@@ -679,9 +677,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* System specific configuration
*/
#if defined( WIN32 )
system_Configure();
#endif
/* p_main inititalization. FIXME ? */
p_main->i_warning_level = config_GetIntVariable( "warning" );
......@@ -844,10 +840,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* System specific cleaning code
*/
#if defined( SYS_BEOS ) || defined( SYS_DARWIN ) || defined( WIN32 )
system_End();
#endif
/*
* Terminate messages interface and program
......
......@@ -2,7 +2,7 @@
* modules_plugin.h : Plugin management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_plugin.h,v 1.20 2002/04/25 02:10:33 jobi Exp $
* $Id: modules_plugin.h,v 1.21 2002/04/25 21:52:42 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -248,6 +248,7 @@ module_error( char *psz_buffer )
(p_symbols)->input_DemuxPS = input_DemuxPS; \
(p_symbols)->input_ReadTS = input_ReadTS; \
(p_symbols)->input_DemuxTS = input_DemuxTS; \
(p_symbols)->input_ClockManageRef = input_ClockManageRef; \
(p_symbols)->input_ClockManageControl = input_ClockManageControl; \
(p_symbols)->input_FDSeek = input_FDSeek; \
(p_symbols)->input_FDClose = input_FDClose; \
......@@ -283,6 +284,7 @@ module_error( char *psz_buffer )
(p_symbols)->vout_LinkPicture = vout_LinkPicture; \
(p_symbols)->vout_UnlinkPicture = vout_UnlinkPicture; \
(p_symbols)->vout_PlacePicture = vout_PlacePicture; \
(p_symbols)->vout_ChromaCmp = vout_ChromaCmp; \
(p_symbols)->UnalignedGetBits = UnalignedGetBits; \
(p_symbols)->UnalignedRemoveBits = UnalignedRemoveBits; \
(p_symbols)->UnalignedShowBits = UnalignedShowBits; \
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.172 2002/04/21 11:23:03 gbazin Exp $
* $Id: video_output.c,v 1.173 2002/04/25 21:52:42 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -265,6 +265,68 @@ void vout_DestroyThread( vout_thread_t *p_vout, int *pi_status )
}
}
/*****************************************************************************
* vout_ChromaCmp: compare two chroma values
*****************************************************************************
* This function returns 1 if the two fourcc values given as argument are
* the same format (eg. UYVY / UYNV) or almost the same format (eg. I420/YV12)
*****************************************************************************/
int vout_ChromaCmp( u32 i_chroma, u32 i_amorhc )
{
/* If they are the same, they are the same ! */
if( i_chroma == i_amorhc )
{
return 1;
}
/* Check for equivalence classes */
switch( i_chroma )
{
case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
switch( i_amorhc )
{
case FOURCC_I420:
case FOURCC_IYUV:
case FOURCC_YV12:
return 1;
default:
return 0;
}
case FOURCC_UYVY:
case FOURCC_UYNV:
case FOURCC_Y422:
switch( i_amorhc )
{
case FOURCC_UYVY:
case FOURCC_UYNV:
case FOURCC_Y422:
return 1;
default:
return 0;
}
case FOURCC_YUY2:
case FOURCC_YUNV:
switch( i_amorhc )
{
case FOURCC_YUY2:
case FOURCC_YUNV:
return 1;
default:
return 0;
}
default:
return 0;
}
}
/*****************************************************************************
* InitThread: initialize video output thread
*****************************************************************************
......
......@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.21 2002/04/15 23:04:08 massiot Exp $
* $Id: vout_pictures.c,v 1.22 2002/04/25 21:52:42 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -35,6 +35,11 @@
#include "video.h"
#include "video_output.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static void vout_CopyPicture( picture_t *p_src, picture_t *p_dest );
/*****************************************************************************
* vout_DisplayPicture: display a picture
*****************************************************************************
......@@ -517,7 +522,7 @@ void vout_AllocatePicture( picture_t *p_pic,
i_bytes += p_pic->p[ i_index ].i_lines * p_pic->p[ i_index ].i_pitch;
}
p_pic->p_data = vlc_memalign( 16, i_bytes, &p_pic->p_data_orig );
p_pic->p_data = vlc_memalign( &p_pic->p_data_orig, 16, i_bytes );
if( p_pic->p_data == NULL )
{
......@@ -536,3 +541,65 @@ void vout_AllocatePicture( picture_t *p_pic,
}
}
/* Following functions are local */
/*****************************************************************************
* vout_CopyPicture: copy a picture to another one
*****************************************************************************
* This function takes advantage of the image format, and reduces the
* number of calls to memcpy() to the minimum. Source and destination
* images must have same width, height, and chroma.
*****************************************************************************/
static void vout_CopyPicture( picture_t *p_src, picture_t *p_dest )
{
#if 0
int i;
for( i = 0; i < p_src->i_planes ; i++ )
{
if( p_src->p[i].i_pitch == p_dest->p[i].i_pitch )
{
if( p_src->p[i].b_margin )
{
/* If p_src->b_margin is set, p_dest->b_margin must be set */
if( p_dest->p[i].b_hidden )
{
/* There are margins, but they are hidden : perfect ! */
FAST_MEMCPY( p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
p_src->p[i].i_pitch * p_src->p[i].i_lines );
continue;
}
else
{
/* We can't directly copy the margin. Too bad. */
}
}
else
{
/* Same pitch, no margins : perfect ! */
FAST_MEMCPY( p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
p_src->p[i].i_pitch * p_src->p[i].i_lines );
continue;
}
}
else
{
/* Pitch values are different */
}
/* We need to proceed line by line */
{
u8 *p_in = p_src->p[i].p_pixels, *p_out = p_dest->p[i].p_pixels;
int i_line;
for( i_line = p_src->p[i].i_lines; i_line--; )
{
FAST_MEMCPY( p_out, p_in, p_src->p[i].i_visible_bytes );
p_in += p_src->p[i].i_pitch;
p_out += p_dest->p[i].i_pitch;
}
}
}
#endif
}
......@@ -2,7 +2,7 @@
* vout_subpictures.c : subpicture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vout_subpictures.c,v 1.12 2002/04/05 01:05:22 gbazin Exp $
* $Id: vout_subpictures.c,v 1.13 2002/04/25 21:52:42 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -139,7 +139,7 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
}
p_free_subpic->p_sys =
vlc_memalign( 16, i_size, &p_free_subpic->p_sys_orig );
vlc_memalign( &p_free_subpic->p_sys_orig, 16, i_size );
if( p_free_subpic->p_sys != NULL )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment