Commit 7bb574fd authored by Gildas Bazin's avatar Gildas Bazin

* ALL: Introduction of a new api for decoders.
   The final aim of this new api is to make it possible to use the decoders from other modules like the transcoder for instance.
   Only a few decoders have been ported to the new api (a52, libmpeg2, dts, vorbis, theora) so the old api is still supported.

   Don't hold your breath, there is still much work to do before we reach this goal.

* modules/codec/a52.c, libmpeg2., dts.c, vorbis.c, theora.c:
   Converted to the new api.
   Merged the a52 and vorbis packetizers in their respective decoders (removes a lot of code duplication).
   New dts and theora packetizers (merged in their respective decoders).
parent 8fd7c421
dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.71 2003/08/31 15:55:56 titer Exp $
dnl $Id: configure.ac,v 1.72 2003/09/02 20:19:25 gbazin Exp $
AC_INIT(vlc,0.6.3-cvs)
......@@ -1000,7 +1000,7 @@ if test "${enable_sout}" != "no"
then
AX_ADD_PLUGINS([access_output_dummy access_output_udp access_output_file access_output_http])
AX_ADD_PLUGINS([mux_ts mux_ps mux_avi mux_mp4 mux_asf mux_dummy])
AX_ADD_PLUGINS([packetizer_mpegaudio packetizer_mpegvideo packetizer_a52])
AX_ADD_PLUGINS([packetizer_mpegaudio packetizer_mpegvideo])
AX_ADD_PLUGINS([packetizer_mpeg4video packetizer_mpeg4audio])
AX_ADD_PLUGINS([packetizer_copy])
......@@ -1934,11 +1934,7 @@ if test "${enable_vorbis}" != "no"
then
AC_CHECK_HEADERS(vorbis/codec.h, [
AX_ADD_PLUGINS([vorbis])
AX_ADD_LDFLAGS([vorbis],[-lvorbis -logg])
if test "${enable_sout}" != "no"; then
AX_ADD_PLUGINS([packetizer_vorbis])
AX_ADD_LDFLAGS([packetizer_vorbis],[-lvorbis -logg])
fi ],[])
AX_ADD_LDFLAGS([vorbis],[-lvorbis -logg]) ],[])
fi
dnl
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: input_ext-dec.h,v 1.79 2003/03/04 13:21:19 massiot Exp $
* $Id: input_ext-dec.h,v 1.80 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -110,8 +110,29 @@ struct decoder_fifo_t
void * p_waveformatex;
void * p_bitmapinfoheader;
decoder_t * p_dec;
};
/*****************************************************************************
* decoder_t
*****************************************************************************
* The decoder descriptor.
*****************************************************************************/
struct decoder_t
{
VLC_COMMON_MEMBERS
/* Module properties */
module_t * p_module;
module_t * p_module;
decoder_sys_t * p_sys;
int ( * pf_init ) ( decoder_t * );
int ( * pf_decode )( decoder_t *, block_t * );
int ( * pf_end ) ( decoder_t * );
/* Input properties */
decoder_fifo_t * p_fifo; /* stores the PES stream data */
/* Tmp field for old decoder api */
int ( * pf_run ) ( decoder_fifo_t * );
};
......
......@@ -2,7 +2,7 @@
* decoder.h: header for vlc decoders
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: decoder.h,v 1.1 2002/06/01 12:31:58 sam Exp $
* $Id: decoder.h,v 1.2 2003/09/02 20:19:25 gbazin Exp $
*
* 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
......@@ -34,6 +34,7 @@ extern "C" {
/*****************************************************************************
* Required internal headers
*****************************************************************************/
#include "vlc_block.h"
#include "stream_control.h"
#include "input_ext-dec.h"
......
......@@ -2,7 +2,7 @@
* input.h: input modules header for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: input.h,v 1.1 2002/06/01 12:31:58 sam Exp $
* $Id: input.h,v 1.2 2003/09/02 20:19:25 gbazin Exp $
*
* 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
......@@ -34,6 +34,7 @@ extern "C" {
/*****************************************************************************
* Required internal headers
*****************************************************************************/
#include "vlc_block.h"
#include "stream_control.h"
#include "input_ext-intf.h" /* input_thread_s */
#include "input_ext-dec.h" /* data_packet_s */
......
......@@ -2,7 +2,7 @@
* sout.h: video output header for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: sout.h,v 1.2 2003/05/20 16:20:33 zorglub Exp $
* $Id: sout.h,v 1.3 2003/09/02 20:19:25 gbazin Exp $
*
* 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
......@@ -34,6 +34,7 @@ extern "C" {
/*****************************************************************************
* Required internal headers
*****************************************************************************/
#include "vlc_block.h"
#include "stream_output.h"
# ifdef __cplusplus
......
/*****************************************************************************
* block.h
* vlc_block.h: Data blocks management functions
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: vlc_block.h,v 1.1 2003/08/23 22:49:50 fenrir Exp $
* $Id: vlc_block.h,v 1.2 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -21,9 +21,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _BLOCK_H
#define _BLOCK_H 1
#ifndef _VLC_BLOCK_H
#define _VLC_BLOCK_H 1
/*
* block
......@@ -108,4 +107,4 @@ VLC_EXPORT( block_t *, block_FifoGet, ( block_fifo_t * ) );
VLC_EXPORT( block_t *, block_FifoGetFrame, ( block_fifo_t * ) );
VLC_EXPORT( block_t *, block_FifoShow, ( block_fifo_t * ) );
#endif
#endif /* VLC_BLOCK_H */
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.75 2003/08/23 22:49:50 fenrir Exp $
* $Id: vlc_common.h,v 1.76 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -268,6 +268,8 @@ typedef struct slp_session_t slp_session_t;*/
/* Decoders */
typedef struct decoder_fifo_t decoder_fifo_t;
typedef struct decoder_t decoder_t;
typedef struct decoder_sys_t decoder_sys_t;
/* Misc */
typedef struct data_packet_t data_packet_t;
......
......@@ -2,7 +2,7 @@
* vlc_objects.h: vlc_object_t definition.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: vlc_objects.h,v 1.16 2003/02/23 19:07:02 fenrir Exp $
* $Id: vlc_objects.h,v 1.17 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -30,6 +30,8 @@
#define VLC_OBJECT_ITEM (-6)
#define VLC_OBJECT_INPUT (-7)
#define VLC_OBJECT_DECODER (-8)
/* tmp for backward compat */
#define VLC_OBJECT_DECODER_FIFO (-999)
#define VLC_OBJECT_VOUT (-9)
#define VLC_OBJECT_AOUT (-10)
#define VLC_OBJECT_SOUT (-11)
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* adpcm.c : adpcm variant audio decoder
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: adpcm.c,v 1.12 2003/08/17 23:02:51 fenrir Exp $
* $Id: adpcm.c,v 1.13 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -151,9 +151,9 @@ static int i_adaptation_coeff2[7] =
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
case VLC_FOURCC('i','m','a', '4'): /* IMA ADPCM */
case VLC_FOURCC('m','s',0x00,0x02): /* MS ADPCM */
......@@ -161,13 +161,12 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_FOURCC('m','s',0x00,0x61): /* Duck DK4 ADPCM */
case VLC_FOURCC('m','s',0x00,0x62): /* Duck DK3 ADPCM */
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
default:
return VLC_EGENERIC;
}
}
/*****************************************************************************
......@@ -874,5 +873,3 @@ static void DecodeAdpcmDk3( adec_thread_t *p_adec,
}
}
......@@ -2,7 +2,7 @@
* araw.c: Pseudo audio decoder; for raw pcm data
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: araw.c,v 1.16 2003/08/17 23:02:51 fenrir Exp $
* $Id: araw.c,v 1.17 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -80,9 +80,9 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
case VLC_FOURCC('a','r','a','w'): /* from wav/avi/asf file */
case VLC_FOURCC('t','w','o','s'): /* _signed_ big endian samples (mov)*/
......@@ -90,13 +90,12 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_FOURCC('a','l','a','w'):
case VLC_FOURCC('u','l','a','w'):
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
default:
return VLC_EGENERIC;
}
}
static int pi_channels_maps[6] =
......
......@@ -2,7 +2,7 @@
* cinepak.c: cinepak video decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: cinepak.c,v 1.11 2003/08/17 23:02:51 fenrir Exp $
* $Id: cinepak.c,v 1.12 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -70,13 +70,13 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
case VLC_FOURCC('c','v','i','d'):
case VLC_FOURCC('C','V','I','D'):
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......@@ -834,5 +834,3 @@ static void EndThread( videodec_thread_t *p_vdec )
free( p_vdec );
}
This diff is collapsed.
......@@ -2,7 +2,7 @@
* dv.c: a decoder for DV video
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: dv.c,v 1.4 2003/01/28 16:57:28 sam Exp $
* $Id: dv.c,v 1.5 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -57,14 +57,14 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder ( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('d','v','s','d') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('d','v','s','d') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......
......@@ -2,7 +2,7 @@
* decoder.c: AAC decoder using libfaad2
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: decoder.c,v 1.29 2003/08/24 23:22:02 gbazin Exp $
* $Id: decoder.c,v 1.30 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -65,14 +65,14 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('m','p','4','a') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('m','p','4','a') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......@@ -480,4 +480,3 @@ static void EndThread (adec_thread_t *p_adec)
free( p_adec );
}
......@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.48 2003/08/15 13:16:38 fenrir Exp $
* $Id: ffmpeg.c,v 1.49 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -189,15 +189,16 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*) p_this;
if( ffmpeg_GetFfmpegCodec( p_fifo->i_fourcc, NULL, NULL, NULL ) )
if( !ffmpeg_GetFfmpegCodec( p_dec->p_fifo->i_fourcc, NULL, NULL, NULL ) )
{
p_fifo->pf_run = RunDecoder;
return VLC_SUCCESS;
return VLC_EGENERIC;
}
return VLC_EGENERIC;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
typedef union decoder_thread_u
......@@ -208,7 +209,6 @@ typedef union decoder_thread_u
} decoder_thread_t;
/*****************************************************************************
* RunDecoder: this function is called just after the thread is created
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* flac.c: flac decoder module making use of libflac
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: flacdec.c,v 1.3 2003/08/17 13:56:26 gbazin Exp $
* $Id: flacdec.c,v 1.4 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
*
......@@ -114,14 +114,14 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('f','l','a','c') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('f','l','a','c') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.16 2003/06/10 23:01:40 massiot Exp $
* $Id: lpcm.c,v 1.17 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
......@@ -102,15 +102,15 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('l','p','c','m')
&& p_fifo->i_fourcc != VLC_FOURCC('l','p','c','b') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('l','p','c','m')
&& p_dec->p_fifo->i_fourcc != VLC_FOURCC('l','p','c','b') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......
......@@ -2,7 +2,7 @@
* mpeg_audio.c: parse MPEG audio sync info and packetize the stream
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: mpeg_audio.c,v 1.16 2003/06/25 00:40:41 fenrir Exp $
* $Id: mpeg_audio.c,v 1.17 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -94,14 +94,14 @@ vlc_module_end();
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'a') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'a') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......
......@@ -2,7 +2,7 @@
* quicktime.c: a quicktime decoder that uses the QT library/dll
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: quicktime.c,v 1.11 2003/08/17 23:02:51 fenrir Exp $
* $Id: quicktime.c,v 1.12 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir at via.ecp.fr>
* Derk-Jan Hartman <thedj at users.sf.net>
......@@ -273,9 +273,9 @@ static int GetPESData( uint8_t *p_buf, int i_max, pes_packet_t *p_pes )
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
case VLC_FOURCC('S','V','Q','3'): /* Sorenson v3 */
/* case VLC_FOURCC('S','V','Q','1'): Sorenson v1
......@@ -285,7 +285,7 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_FOURCC('r','l','e',' '): /* QuickTime animation (RLE) */
case VLC_FOURCC('r','p','z','a'): /* QuickTime Apple Video */
case VLC_FOURCC('a','z','p','r'): /* QuickTime animation (RLE) */
p_fifo->pf_run = RunDecoderVideo;
p_dec->pf_run = RunDecoderVideo;
return VLC_SUCCESS;
case VLC_FOURCC('m','p','4','a'): /* MPEG-4 audio */
......@@ -309,7 +309,7 @@ static int OpenDecoder( vlc_object_t *p_this )
case 0x6D730002: /* Microsoft ADPCM-ACM */
case 0x6D730011: /* DVI Intel IMAADPCM-ACM */
p_fifo->pf_run = RunDecoderAudio;
p_dec->pf_run = RunDecoderAudio;
return VLC_SUCCESS;
default:
return VLC_EGENERIC;
......
......@@ -2,7 +2,7 @@
* rawvideo.c: Pseudo audio decoder; for raw video data
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: rawvideo.c,v 1.5 2003/05/02 03:40:01 fenrir Exp $
* $Id: rawvideo.c,v 1.6 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -76,9 +76,9 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
/* Planar YUV */
case VLC_FOURCC('I','4','4','4'):
......@@ -99,13 +99,12 @@ static int OpenDecoder( vlc_object_t *p_this )
case VLC_FOURCC('R','V','1','6'):
case VLC_FOURCC('R','V','1','5'):
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
default:
return VLC_EGENERIC;
}
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* spudec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: spudec.c,v 1.24 2003/07/22 20:49:10 hartman Exp $
* $Id: spudec.c,v 1.25 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -59,15 +59,15 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('s','p','u',' ')
&& p_fifo->i_fourcc != VLC_FOURCC('s','p','u','b') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('s','p','u',' ')
&& p_dec->p_fifo->i_fourcc != VLC_FOURCC('s','p','u','b') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......@@ -230,4 +230,3 @@ static void EndThread( spudec_thread_t *p_spudec )
CloseBitstream( &p_spudec->bit_stream );
free( p_spudec );
}
......@@ -2,7 +2,7 @@
* subsdec.c : SPU decoder thread
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: subsdec.c,v 1.8 2003/08/27 12:24:52 sigmunau Exp $
* $Id: subsdec.c,v 1.9 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Samuel Hocevar <sam@zoy.org>
......@@ -95,14 +95,14 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('s','u','b','t') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('s','u','b','t') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
var_Create( p_this, "subsdec-align", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
#if defined(HAVE_ICONV)
......
......@@ -2,7 +2,7 @@
* tarkin.c: tarkin decoder module making use of libtarkin.
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: tarkin.c,v 1.4 2002/11/28 21:00:48 gbazin Exp $
* $Id: tarkin.c,v 1.5 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -103,14 +103,14 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('t','a','r','k') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('t','a','r','k') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* xvid.c: a decoder for libxvidcore, the Xvid video codec
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: xvid.c,v 1.5 2003/02/20 01:52:45 sigmunau Exp $
* $Id: xvid.c,v 1.6 2003/09/02 20:19:25 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -59,16 +59,16 @@ vlc_module_end();
*****************************************************************************/
static int OpenDecoder ( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC('x','v','i','d')
&& p_fifo->i_fourcc != VLC_FOURCC('X','V','I','D')
&& p_fifo->i_fourcc != VLC_FOURCC('D','I','V','X') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC('x','v','i','d')
&& p_dec->p_fifo->i_fourcc != VLC_FOURCC('X','V','I','D')
&& p_dec->p_fifo->i_fourcc != VLC_FOURCC('D','I','V','X') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = RunDecoder;
p_dec->pf_run = RunDecoder;
return VLC_SUCCESS;
}
......@@ -271,4 +271,3 @@ static int RunDecoder ( decoder_fifo_t *p_fifo )
return VLC_SUCCESS;
}
......@@ -2,7 +2,7 @@
* ogg.c : ogg stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ogg.c,v 1.31 2003/08/17 23:02:52 fenrir Exp $
* $Id: ogg.c,v 1.32 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -601,7 +601,7 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg)
i_keyframe_frequency_force >>= 1;
}
p_stream->f_rate = (float)i_fps_numerator /
p_stream->f_rate = ((float)i_fps_numerator) /
i_fps_denominator;
msg_Dbg( p_input,
"found theora header, bitrate: %i, rate: %f",
......
......@@ -2,7 +2,7 @@
* dec_dummy.c: dummy decoder plugin for vlc.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: decoder.c,v 1.5 2003/03/03 16:49:14 gbazin Exp $
* $Id: decoder.c,v 1.6 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -56,7 +56,7 @@ static int Run ( decoder_fifo_t * );
*****************************************************************************/
int E_(OpenDecoder) ( vlc_object_t *p_this )
{
((decoder_fifo_t*)p_this)->pf_run = Run;
((decoder_t*)p_this)->pf_run = Run;
return VLC_SUCCESS;
}
......
SOURCES_packetizer_copy = copy.c
SOURCES_packetizer_a52 = a52.c
SOURCES_packetizer_mpegaudio = mpegaudio.c
SOURCES_packetizer_mpegvideo = mpegvideo.c
SOURCES_packetizer_mpeg4video = mpeg4video.c
SOURCES_packetizer_mpeg4audio = mpeg4audio.c
SOURCES_packetizer_vorbis = vorbis.c
This diff is collapsed.
......@@ -2,7 +2,7 @@
* copy.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: copy.c,v 1.15 2003/08/11 20:19:45 fenrir Exp $
* $Id: copy.c,v 1.16 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -80,9 +80,9 @@ static void input_ShowPES( decoder_fifo_t *p_fifo, pes_packet_t **pp_pes );
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
p_fifo->pf_run = Run;
p_dec->pf_run = Run;
return VLC_SUCCESS;
}
......@@ -672,4 +672,3 @@ static void input_ShowPES( decoder_fifo_t *p_fifo, pes_packet_t **pp_pes )
*pp_pes = p_fifo->p_first;
vlc_mutex_unlock( &p_fifo->data_lock );
}
......@@ -2,7 +2,7 @@
* mpeg4audio.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpeg4audio.c,v 1.6 2003/05/03 02:09:41 fenrir Exp $
* $Id: mpeg4audio.c,v 1.7 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -100,11 +100,11 @@ vlc_module_end();
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
p_fifo->pf_run = Run;
p_dec->pf_run = Run;
if( p_fifo->i_fourcc == VLC_FOURCC( 'm', 'p', '4', 'a') )
if( p_dec->p_fifo->i_fourcc == VLC_FOURCC( 'm', 'p', '4', 'a') )
{
return( VLC_SUCCESS );
}
......@@ -363,4 +363,3 @@ static void EndThread ( packetizer_thread_t *p_pack)
}
free( p_pack );
}
......@@ -2,7 +2,7 @@
* mpeg4video.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpeg4video.c,v 1.12 2003/05/03 02:09:41 fenrir Exp $
* $Id: mpeg4video.c,v 1.13 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -104,11 +104,11 @@ vlc_module_end();
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
p_fifo->pf_run = Run;
p_dec->pf_run = Run;
switch( p_fifo->i_fourcc )
switch( p_dec->p_fifo->i_fourcc )
{
case VLC_FOURCC( 'm', '4', 's', '2'):
case VLC_FOURCC( 'M', '4', 'S', '2'):
......@@ -485,4 +485,3 @@ static void input_ShowPES( decoder_fifo_t *p_fifo, pes_packet_t **pp_pes )
*pp_pes = p_pes;
}
}
......@@ -2,7 +2,7 @@
* mpegaudio.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegaudio.c,v 1.7 2003/08/26 23:12:37 fenrir Exp $
* $Id: mpegaudio.c,v 1.8 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -110,14 +110,14 @@ static int mpegaudio_samplerate[2][4] = /* version 1 then 2 */
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'a') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'a') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = Run;
p_dec->pf_run = Run;
return VLC_SUCCESS;
}
......
......@@ -2,7 +2,7 @@
* mpegvideo.c
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: mpegvideo.c,v 1.18 2003/08/11 18:52:41 gbazin Exp $
* $Id: mpegvideo.c,v 1.19 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
......@@ -98,16 +98,16 @@ vlc_module_end();
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
decoder_fifo_t *p_fifo = (decoder_fifo_t*) p_this;
decoder_t *p_dec = (decoder_t*)p_this;
if( p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'v') &&
p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', '1') &&
p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', '2') )
if( p_dec->p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', 'v') &&
p_dec->p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', '1') &&
p_dec->p_fifo->i_fourcc != VLC_FOURCC( 'm', 'p', 'g', '2') )
{
return VLC_EGENERIC;
}
p_fifo->pf_run = Run;
p_dec->pf_run = Run;
return VLC_SUCCESS;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* objects.c: vlc_object_t handling
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: objects.c,v 1.37 2003/06/26 12:19:59 sam Exp $
* $Id: objects.c,v 1.38 2003/09/02 20:19:26 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -109,6 +109,10 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type )
psz_type = "input";
break;
case VLC_OBJECT_DECODER:
i_size = sizeof(decoder_t);
psz_type = "decoder";
break;
case VLC_OBJECT_DECODER_FIFO: /* tmp for backward compat */
i_size = sizeof(decoder_fifo_t);
psz_type = "decoder";
break;
......
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