Commit 4144b604 authored by Laurent Aimar's avatar Laurent Aimar

* ./plugins/ac3_adec/* use _M to avoid conflict with libavcodec.a

* ./plugins/avi a light  avi demux
* ./plugins/ffmpeg a video decoder for divx v3 and opendivx
parent 76e16cfd
......@@ -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.54 2002/03/14 01:35:28 stef Exp $
* $Id: input_ext-dec.h,v 1.55 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -31,6 +31,8 @@
/* These ones might violate the norm : */
#define DVD_SPU_ES 0x82
#define LPCM_AUDIO_ES 0x83
#define MSMPEG4_VIDEO_ES 0x90
#define MPEG4_VIDEO_ES 0x91
#define UNKNOWN_ES 0xFF
/* Structures exported to the decoders */
......
......@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.27 2002/04/23 14:16:20 sam Exp $
* $Id: ac3_adec.c,v 1.28 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -214,7 +214,7 @@ static int InitThread( ac3dec_thread_t * p_ac3thread )
IMDCT->w_64 = vlc_memalign( 16, 64 * sizeof(complex_t),
&IMDCT->w_64_orig );
ac3_init( p_ac3thread->ac3_decoder );
_M( ac3_init )( p_ac3thread->ac3_decoder );
/*
* Initialize the output properties
......
......@@ -2,7 +2,7 @@
* ac3_decoder.c: core ac3 decoder
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_decoder.c,v 1.6 2001/12/30 07:09:54 sam Exp $
* $Id: ac3_decoder.c,v 1.7 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
......@@ -45,10 +45,10 @@
static const float cmixlev_lut[4] = { 0.707, 0.595, 0.500, 0.707 };
static const float smixlev_lut[4] = { 0.707, 0.500, 0.0 , 0.500 };
int ac3_init (ac3dec_t * p_ac3dec)
int _M( ac3_init )(ac3dec_t * p_ac3dec)
{
p_ac3dec->mantissa.lfsr_state = 1; /* dither_gen initialization */
imdct_init(p_ac3dec->imdct);
_M( imdct_init )(p_ac3dec->imdct) ;
return 0;
}
......
......@@ -2,7 +2,7 @@
* ac3_decoder.h : ac3 decoder interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder.h,v 1.3 2002/04/05 01:05:22 gbazin Exp $
* $Id: ac3_decoder.h,v 1.4 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Renaud Dartus <reno@videolan.org>
......@@ -35,7 +35,7 @@ typedef struct ac3_sync_info_s {
/**** ac3 decoder API - functions publically provided by the ac3 decoder ****/
int ac3_init (ac3dec_t * p_ac3dec);
int _M( ac3_init )(ac3dec_t * p_ac3dec);
int ac3_sync_frame (ac3dec_t * p_ac3dec, ac3_sync_info_t * p_sync_info);
int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer);
......
......@@ -2,7 +2,7 @@
* ac3_imdct.c: ac3 DCT
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_imdct.c,v 1.7 2001/12/30 07:09:54 sam Exp $
* $Id: ac3_imdct.c,v 1.8 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Aaron Holtzman <aholtzma@engr.uvic.ca>
......@@ -44,7 +44,7 @@
# define M_PI 3.14159265358979323846
#endif
void imdct_init(imdct_t * p_imdct)
void _M( imdct_init )(imdct_t * p_imdct)
{
int i;
float scale = 181.019;
......
......@@ -2,7 +2,7 @@
* ac3_internals.h: needed by the ac3 decoder
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: ac3_internal.h,v 1.1 2001/11/13 12:09:17 henri Exp $
* $Id: ac3_internal.h,v 1.2 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -40,7 +40,7 @@ void bit_allocate (ac3dec_t *);
int exponent_unpack (ac3dec_t *);
/* ac3_imdct.c */
void imdct_init (imdct_t * p_imdct);
void _M( imdct_init )(imdct_t * p_imdct);
void imdct (ac3dec_t * p_ac3dec, s16 * buffer);
/* ac3_mantissa.c */
......
avi_SOURCES =
avi_SOURCES = avi.c
This diff is collapsed.
/*****************************************************************************
* 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 $
* 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 MAX_PACKETS_IN_FIFO 10
/* flags for use in <dwFlags> in AVIFileHdr */
#define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
#define AVIF_MUSTUSEINDEX 0x00000020
#define AVIF_ISINTERLEAVED 0x00000100
#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames? */
#define AVIF_WASCAPTUREFILE 0x00010000
#define AVIF_COPYRIGHTED 0x00020000
/* Flags for index */
#define AVIIF_LIST 0x00000001L /* chunk is a 'LIST' */
#define AVIIF_KEYFRAME 0x00000010L /* this frame is a key frame.*/
#define AVIIF_NOTIME 0x00000100L /* this frame doesn't take any time */
#define AVIIF_COMPUSE 0x0FFF0000L /* these bits are for compressor use */
typedef struct bitmapinfoheader_s
{
u32 i_size; /* size of header */
u32 i_width;
u32 i_height;
u16 i_planes;
u16 i_bitcount;
u32 i_compression;
u32 i_sizeimage;
u32 i_xpelspermeter;
u32 i_ypelspermeter;
u32 i_clrused;
u32 i_clrimportant;
} bitmapinfoheader_t;
typedef struct waveformatex_s
{
u16 i_formattag;
u16 i_channels;
u32 i_samplespersec;
u32 i_avgbytespersec;
u16 i_blockalign;
u16 i_bitspersample;
u16 i_size; /* the extra size in bytes */
} waveformatex_t;
typedef struct MainAVIHeader_s
{
u32 i_microsecperframe;
u32 i_maxbytespersec;
u32 i_reserved1; /* dwPaddingGranularity; pad to multiples of this
size; normally 2K */
u32 i_flags;
u32 i_totalframes;
u32 i_initialframes;
u32 i_streams;
u32 i_suggestedbuffersize;
u32 i_width;
u32 i_height;
u32 i_scale;
u32 i_rate;
u32 i_start;
u32 i_length;
} MainAVIHeader_t;
typedef struct AVIStreamHeader_s
{
u32 i_type;
u32 i_handler;
u32 i_flags;
u32 i_reserved1; /* wPriority wLanguage */
u32 i_initialframes;
u32 i_scale;
u32 i_rate;
u32 i_start;
u32 i_length; /* In units above... */
u32 i_suggestedbuffersize;
u32 i_quality;
u32 i_samplesize;
} AVIStreamHeader_t;
typedef struct AVIIndexEntry_s
{
u32 i_id;
u32 i_flags;
u32 i_offset;
u32 i_length;
u32 i_lengthtotal;
} AVIIndexEntry_t;
typedef struct AVIStreamInfo_s
{
riffchunk_t *p_strl;
riffchunk_t *p_strh;
riffchunk_t *p_strf;
riffchunk_t *p_strd; /* not used */
AVIStreamHeader_t header;
u8 i_cat; /* AUDIO_ES, VIDEO_ES */
bitmapinfoheader_t video_format;
waveformatex_t audio_format;
es_descriptor_t *p_es;
int b_unselected; /* previously unselected */
AVIIndexEntry_t *p_index;
int i_idxnb;
int i_idxmax;
int i_idxpos;
off_t i_idxoffset; /* how many to add to index.i_pos */
} AVIStreamInfo_t;
typedef struct demux_data_avi_file_s
{
mtime_t i_date; /* date correspondant i_chunkread = 0 */
riffchunk_t *p_riff;
riffchunk_t *p_hdrl;
riffchunk_t *p_movi;
riffchunk_t *p_idx1;
/* Info extraites de avih */
MainAVIHeader_t avih;
/* les differents stream */
int i_streams;
AVIStreamInfo_t **pp_info;
/* absolument pas definitif */
} demux_data_avi_file_t;
/*****************************************************************************
* 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' )
/*****************************************************************************
* avi_file.c : AVI file Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: libLE.c,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.
*****************************************************************************/
/*
* Data reading functions
*/
static u16 __GetWordLittleEndianFromBuff( byte_t *p_buff )
{
u16 i;
i = (*p_buff) + ( *(p_buff + 1) <<8 );
return ( i );
}
static u32 __GetDoubleWordLittleEndianFromBuff( byte_t *p_buff )
{
u32 i;
i = (*p_buff) + ( *(p_buff + 1) <<8 ) + ( *(p_buff + 2) <<16 ) + ( *(p_buff + 3) <<24 );
return ( i );
}
static void __SetWordLittleEndianToBuff( byte_t *p_buff, u16 i)
{
*(p_buff) = (i & 0xFF);
*(p_buff + 1) = ( ( i >>8 ) & 0xFF);
return;
}
static void __SetDoubleWordLittleEndianToBuff( byte_t *p_buff, u32 i)
{
*(p_buff) = ( i & 0xFF );
*(p_buff + 1) = (( i >>8 ) & 0xFF);
*(p_buff + 2) = (( i >>16 ) & 0xFF);
*(p_buff + 3) = (( i >>24 ) & 0xFF);
return;
}
This diff is collapsed.
ffmpeg_SOURCES =
ffmpeg_SOURCES = ffmpeg.c
This diff is collapsed.
/*****************************************************************************
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.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.
*****************************************************************************/
/* Pour un flux video */
typedef struct bitmapinfoheader_s
{
u32 i_size; /* size of header */
u32 i_width;
u32 i_height;
u16 i_planes;
u16 i_bitcount;
u32 i_compression;
u32 i_sizeimage;
u32 i_xpelspermeter;
u32 i_ypelspermeter;
u32 i_clrused;
u32 i_clrimportant;
} bitmapinfoheader_t;
typedef struct videodec_thread_s
{
decoder_config_t *p_config;
decoder_fifo_t *p_fifo;
bitmapinfoheader_t format;
AVCodecContext context, *p_context;
AVCodec *p_codec;
vout_thread_t *p_vout;
int i_aspect;
u32 i_chroma;
char *psz_namecodec;
/* private */
data_packet_t *p_data;
byte_t *p_buff;
int i_data_size;
} videodec_thread_t;
......@@ -67,7 +67,7 @@ MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("libmad MPEG 1/2/3 audio decoder library") )
ADD_CAPABILITY( DECODER, 50 )
ADD_CAPABILITY( DECODER, 100 )
ADD_SHORTCUT( "mad" )
MODULE_INIT_STOP
......
......@@ -2,7 +2,7 @@
* mpeg_adec.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: mpeg_adec.c,v 1.22 2002/04/19 13:56:11 sam Exp $
* $Id: mpeg_adec.c,v 1.23 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -67,7 +67,7 @@ MODULE_CONFIG_STOP
MODULE_INIT_START
SET_DESCRIPTION( _("MPEG I/II layer 1/2 audio decoder") )
ADD_CAPABILITY( DECODER, 100 )
ADD_CAPABILITY( DECODER, 50 )
ADD_REQUIREMENT( FPU )
ADD_SHORTCUT( "builtin" )
MODULE_INIT_STOP
......
......@@ -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.81 2002/04/23 14:16:20 sam Exp $
* $Id: input_programs.c,v 1.82 2002/04/23 23:44:36 fenrir Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -617,6 +617,8 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
case AC3_AUDIO_ES:
case MPEG1_AUDIO_ES:
case MPEG2_AUDIO_ES:
case MPEG4_VIDEO_ES:
case MSMPEG4_VIDEO_ES:
case LPCM_AUDIO_ES:
if( p_main->b_audio )
{
......
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