Commit 3ce3af29 authored by Laurent Aimar's avatar Laurent Aimar

ffmpeg: adapted to current cvs version. It should still compile with older

one (Please reports if it doesn't).
parent da014eb8
......@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.20 2002/11/28 16:32:29 fenrir Exp $
* $Id: ffmpeg.c,v 1.21 2002/12/10 10:22:04 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -508,6 +508,14 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
psz_name = "Motion JPEG B";
break;
#endif
case FOURCC_dvsl:
case FOURCC_dvsd:
case FOURCC_DVSD:
case FOURCC_dvhd:
i_cat = VIDEO_ES;
i_codec = CODEC_ID_DVVIDEO;
psz_name = "DV video";
break;
#if LIBAVCODEC_BUILD >= 4632
case FOURCC_WMA1:
......@@ -523,7 +531,6 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
psz_name ="Windows Media Audio 2";
break;
#endif
default:
i_cat = UNKNOWN_ES;
i_codec = CODEC_ID_NONE;
......
......@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.10 2002/11/28 16:32:29 fenrir Exp $
* $Id: ffmpeg.h,v 1.11 2002/12/10 10:22:04 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -138,6 +138,10 @@ int E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes );
#define FOURCC_WMV1 VLC_FOURCC('W','M','V','1')
#define FOURCC_WMV2 VLC_FOURCC('W','M','V','2')
#define FOURCC_dvsl VLC_FOURCC('d','v','s','l')
#define FOURCC_dvsd VLC_FOURCC('d','v','s','d')
#define FOURCC_DVSD VLC_FOURCC('D','V','S','D')
#define FOURCC_dvhd VLC_FOURCC('d','v','h','d')
/*****************************************************************************
* Audio codec fourcc
......
......@@ -2,7 +2,7 @@
* video.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.11 2002/12/06 16:34:05 sam Exp $
* $Id: video.c,v 1.12 2002/12/10 10:22:04 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -50,7 +50,7 @@
* Local prototypes
*****************************************************************************/
#if LIBAVCODEC_BUILD >= 4641
static void ffmpeg_CopyPicture( picture_t *, AVVideoFrame *, vdec_thread_t * );
static void ffmpeg_CopyPicture( picture_t *, AVFrame *, vdec_thread_t * );
#else
static void ffmpeg_CopyPicture( picture_t *, AVPicture *, vdec_thread_t * );
#endif
......@@ -58,8 +58,8 @@ static void ffmpeg_CopyPicture( picture_t *, AVPicture *, vdec_thread_t * );
static void ffmpeg_PostProcPicture( vdec_thread_t *, picture_t * );
#if LIBAVCODEC_BUILD >= 4641
static int ffmpeg_GetFrameBuf( struct AVCodecContext *, AVVideoFrame *);
static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVVideoFrame *);
static int ffmpeg_GetFrameBuf( struct AVCodecContext *, AVFrame *);
static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *, AVFrame *);
#endif
/*****************************************************************************
......@@ -152,7 +152,7 @@ static vout_thread_t *ffmpeg_CreateVout( vdec_thread_t *p_vdec,
*/
#if LIBAVCODEC_BUILD >= 4641
static void ffmpeg_ConvertPictureI410toI420( picture_t *p_pic,
AVVideoFrame *p_ff_pic,
AVFrame *p_ff_pic,
vdec_thread_t *p_vdec )
#else
static void ffmpeg_ConvertPictureI410toI420( picture_t *p_pic,
......@@ -272,7 +272,9 @@ static void ffmpeg_ConvertPictureI410toI420( picture_t *p_pic,
int E_( InitThread_Video )( vdec_thread_t *p_vdec )
{
int i_tmp;
#if LIBAVCODEC_BUILD >= 4641
#if LIBAVCODEC_BUILD >= 4645
p_vdec->p_ff_pic = avcodec_alloc_frame();
#elif LIBAVCODEC_BUILD >= 4641
p_vdec->p_ff_pic = avcodec_alloc_picture();
#else
p_vdec->p_ff_pic = &p_vdec->ff_pic;
......@@ -738,7 +740,7 @@ void E_( EndThread_Video )( vdec_thread_t *p_vdec )
*****************************************************************************/
#if LIBAVCODEC_BUILD >= 4641
static void ffmpeg_CopyPicture( picture_t *p_pic,
AVVideoFrame *p_ff_pic,
AVFrame *p_ff_pic,
vdec_thread_t *p_vdec )
#else
static void ffmpeg_CopyPicture( picture_t *p_pic,
......@@ -823,7 +825,7 @@ static void ffmpeg_PostProcPicture( vdec_thread_t *p_vdec, picture_t *p_pic )
*****************************************************************************/
static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
AVVideoFrame *p_ff_pic )
AVFrame *p_ff_pic )
{
vdec_thread_t *p_vdec = (vdec_thread_t *)p_context->opaque;
picture_t *p_pic;
......@@ -850,7 +852,9 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
p_vdec->p_context->draw_horiz_band= NULL;
p_ff_pic->opaque = (void*)p_pic;
#if LIBAVCODEC_BUILD >= 4645
p_ff_pic->type = FF_BUFFER_TYPE_USER;
#endif
p_ff_pic->data[0] = p_pic->p[0].p_pixels;
p_ff_pic->data[1] = p_pic->p[1].p_pixels;
p_ff_pic->data[2] = p_pic->p[2].p_pixels;
......@@ -872,7 +876,7 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
}
static void ffmpeg_ReleaseFrameBuf( struct AVCodecContext *p_context,
AVVideoFrame *p_ff_pic )
AVFrame *p_ff_pic )
{
vdec_thread_t *p_vdec = (vdec_thread_t *)p_context->opaque;
picture_t *p_pic;
......
......@@ -2,7 +2,7 @@
* video.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.h,v 1.5 2002/12/06 11:53:45 fenrir Exp $
* $Id: video.h,v 1.6 2002/12/10 10:22:04 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -20,12 +20,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#if LIBAVCODEC_BUILD >= 4641 && LIBAVCODEC_BUILD < 4645
# define AVFrame AVVideoFrame
#endif
typedef struct vdec_thread_s
{
DECODER_THREAD_COMMON
#if LIBAVCODEC_BUILD >= 4641
AVVideoFrame *p_ff_pic;
AVFrame *p_ff_pic;
#else
AVPicture ff_pic, *p_ff_pic;
#endif
......
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