Commit 71baa3cd authored by Laurent Aimar's avatar Laurent Aimar

* ffmpeg: now ffmpeg has a SVQ3 decoder, so use it :)

parent d40a1961
......@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.35 2003/05/07 15:44:59 fenrir Exp $
* $Id: ffmpeg.c,v 1.36 2003/05/09 23:23:45 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -503,6 +503,13 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
i_codec = CODEC_ID_SVQ1;
psz_name = "SVQ-1 (Sorenson Video v1)";
break;
#if LIBAVCODEC_BUILD >= 4666
case FOURCC_SVQ3:
i_cat = VIDEO_ES;
i_codec = CODEC_ID_SVQ3;
psz_name = "SVQ-3 (Sorenson Video v3)";
break;
#endif
case FOURCC_DIVX:
case FOURCC_divx:
......
......@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.17 2003/04/17 10:58:30 fenrir Exp $
* $Id: ffmpeg.h,v 1.18 2003/05/09 23:23:45 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
......@@ -137,8 +137,9 @@ int E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes );
#define FOURCC_I263 VLC_FOURCC('I','2','6','3')
#define FOURCC_i263 VLC_FOURCC('i','2','6','3')
/* Sorenson v1 */
/* Sorenson v1/3 */
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
#define FOURCC_SVQ3 VLC_FOURCC( 'S', 'V', 'Q', '3' )
/* mjpeg */
#define FOURCC_MJPG VLC_FOURCC( 'M', 'J', 'P', 'G' )
......
......@@ -2,7 +2,7 @@
* video.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.c,v 1.26 2003/05/07 15:44:59 fenrir Exp $
* $Id: video.c,v 1.27 2003/05/09 23:23:45 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
......@@ -194,6 +194,16 @@ static vout_thread_t *ffmpeg_CreateVout( vdec_thread_t *p_vdec,
* ffmpeg codec will be open, some memory allocated. But Vout is not yet
* open (done after the first decoded frame)
*****************************************************************************/
static inline void SetDWBE( void *data, uint32_t dw )
{
uint8_t *p = data;
p[0] = (dw >> 24 )&0xff;
p[1] = (dw >> 16 )&0xff;
p[2] = (dw >> 8 )&0xff;
p[3] = (dw )&0xff;
}
int E_( InitThread_Video )( vdec_thread_t *p_vdec )
{
int i_tmp;
......@@ -284,6 +294,20 @@ int E_( InitThread_Video )( vdec_thread_t *p_vdec )
(void *)&p_vdec->p_format[1],
i_size );
}
#if LIBAVCODEC_BUILD >= 4666
else if( p_vdec->i_codec_id == CODEC_ID_SVQ3 )
{
p_vdec->p_context->extradata_size = i_size + 28;
p_vdec->p_context->extradata = malloc( p_vdec->p_context->extradata_size );
memcpy ( &((char*)p_vdec->p_context->extradata)[ 0], "stsd", 4 );
SetDWBE( &((char*)p_vdec->p_context->extradata)[ 4], 0 ); /* version and flag */
SetDWBE( &((char*)p_vdec->p_context->extradata)[ 8], 0 ); /* entry count */
SetDWBE( &((char*)p_vdec->p_context->extradata)[12], 0 ); /* sample soun size FIXME */
memcpy ( &((char*)p_vdec->p_context->extradata)[16], "SVQ3", 4 );
memset ( &((char*)p_vdec->p_context->extradata)[20], 0, 8 ); /* reserved[6] and ref index(16b) */
memcpy ( &((char*)p_vdec->p_context->extradata)[28], &p_vdec->p_format[1], i_size );
}
#endif
else
{
p_vdec->p_context->extradata_size = i_size;
......
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