* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: ffmpeg.c,v 1.25 2003/02/20 01:52:46 sigmunau Exp $
+ * $Id: ffmpeg.c,v 1.26 2003/03/11 05:52:37 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* 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
"Quality of post processing\n"\
"Valid range is 0 to 6\n" \
"(Overridden by others setting)"
-
+
#define POSTPROCESSING_AQ_LONGTEXT \
"Post processing quality is selected upon time left " \
"but no more than requested quality\n" \
add_category_hint( N_("ffmpeg"), NULL, VLC_FALSE );
#if LIBAVCODEC_BUILD >= 4615
add_bool( "ffmpeg-dr", 0, NULL,
- "direct rendering",
+ "direct rendering",
"direct rendering", VLC_TRUE );
#endif
#if LIBAVCODEC_BUILD >= 4611
- add_integer ( "ffmpeg-error-resilience", -1, NULL,
+ add_integer ( "ffmpeg-error-resilience", -1, NULL,
"error resilience", ERROR_RESILIENCE_LONGTEXT, VLC_TRUE );
- add_integer ( "ffmpeg-workaround-bugs", 1, NULL,
+ add_integer ( "ffmpeg-workaround-bugs", 1, NULL,
"workaround bugs", WORKAROUND_BUGS_LONGTEXT, VLC_FALSE );
#endif
add_bool( "ffmpeg-hurry-up", 0, NULL, "hurry up", HURRY_UP_LONGTEXT, VLC_FALSE );
-
+
add_category_hint( N_("Post processing"), NULL, VLC_FALSE );
add_module( "ffmpeg-pp", "postprocessing",NULL, NULL,
- N_( "ffmpeg postprocessing module" ), NULL, VLC_FALSE );
+ N_( "ffmpeg postprocessing module" ), NULL, VLC_FALSE );
add_integer( "ffmpeg-pp-q", 0, NULL,
"post processing quality", POSTPROCESSING_Q_LONGTEXT, VLC_FALSE );
add_bool( "ffmpeg-pp-auto", 0, NULL,
"auto-level Post processing quality", POSTPROCESSING_AQ_LONGTEXT, VLC_FALSE );
- add_bool( "ffmpeg-db-yv", 0, NULL,
- "force vertical luminance deblocking",
+ add_bool( "ffmpeg-db-yv", 0, NULL,
+ "force vertical luminance deblocking",
"force vertical luminance deblocking (override other settings)", VLC_TRUE );
- add_bool( "ffmpeg-db-yh", 0, NULL,
+ add_bool( "ffmpeg-db-yh", 0, NULL,
"force horizontal luminance deblocking",
"force horizontal luminance deblocking (override other settings)", VLC_TRUE );
- add_bool( "ffmpeg-db-cv", 0, NULL,
+ add_bool( "ffmpeg-db-cv", 0, NULL,
"force vertical chrominance deblocking",
"force vertical chrominance deblocking (override other settings)", VLC_TRUE );
- add_bool( "ffmpeg-db-ch", 0, NULL,
+ add_bool( "ffmpeg-db-ch", 0, NULL,
"force horizontal chrominance deblocking",
"force horizontal chrominance deblocking (override other settings) ", VLC_TRUE );
add_bool( "ffmpeg-dr-y", 0, NULL,
add_bool( "ffmpeg-dr-c", 0, NULL,
"force chrominance deringing",
"force chrominance deringing (override other settings)", VLC_TRUE );
-
+
set_description( _("ffmpeg audio/video decoder((MS)MPEG4,SVQ1,H263,WMV,WMA)") );
set_capability( "decoder", 70 );
set_callbacks( OpenDecoder, NULL );
/*****************************************************************************
* OpenDecoder: probe the decoder and return score
*****************************************************************************
- * Tries to launch a decoder and return score so that the interface is able
+ * Tries to launch a decoder and return score so that the interface is able
* to chose.
*****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
DecoderError( p_fifo );
return( -1 );
}
-
+
while( (!p_decoder->p_fifo->b_die) && (!p_decoder->p_fifo->b_error) )
{
switch( p_decoder->i_cat )
{
return( -1 );
}
-
+
return( 0 );
-}
+}
/*****************************************************************************
*
/*****************************************************************************
* InitThread: initialize vdec output thread
*****************************************************************************
- * This function is called from decoder_Run and performs the second step
- * of the initialization. It returns 0 on success. Note that the thread's
+ * This function is called from decoder_Run and performs the second step
+ * of the initialization. It returns 0 on success. Note that the thread's
* flag are not modified inside this function.
*
* ffmpeg codec will be open, some memory allocated. But Vout is not yet
static int InitThread( generic_thread_t *p_decoder )
{
int i_result;
-
+
/* *** init ffmpeg library (libavcodec) *** */
if( !b_ffmpeginit )
{
&p_decoder->i_cat,
&p_decoder->i_codec_id,
&p_decoder->psz_namecodec );
-
+
/* *** ask ffmpeg for a decoder *** */
- if( !( p_decoder->p_codec =
+ if( !( p_decoder->p_codec =
avcodec_find_decoder( p_decoder->i_codec_id ) ) )
{
- msg_Err( p_decoder->p_fifo,
+ msg_Err( p_decoder->p_fifo,
"codec not found (%s)",
p_decoder->psz_namecodec );
return( -1 );
p_decoder->p_context = malloc( sizeof( AVCodecContext ) );
memset( p_decoder->p_context, 0, sizeof( AVCodecContext ) );
#endif
-
+
switch( p_decoder->i_cat )
{
case VIDEO_ES:
default:
i_result = -1;
}
-
+
p_decoder->pts = 0;
p_decoder->p_buffer = NULL;
p_decoder->i_buffer = 0;
*****************************************************************************/
static void EndThread( generic_thread_t *p_decoder )
{
-
+
if( !p_decoder )
{
return;
}
-
+
if( p_decoder->p_context != NULL)
{
FREE( p_decoder->p_context->extradata );
avcodec_close( p_decoder->p_context );
- msg_Dbg( p_decoder->p_fifo,
+ msg_Dbg( p_decoder->p_fifo,
"ffmpeg codec (%s) stopped",
p_decoder->psz_namecodec );
free( p_decoder->p_context );
E_( EndThread_Video )( (vdec_thread_t*)p_decoder );
break;
}
-
+
free( p_decoder );
}
*****************************************************************************/
int E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes )
-{
- int i_copy;
+{
+ int i_copy;
int i_count;
data_packet_t *p_data;
while( p_data != NULL && i_count < i_max )
{
- i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start,
+ i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start,
i_max - i_count );
if( i_copy > 0 )
psz_name = "MPEG-1/2 Video";
break;
#endif
-#if LIBAVCODEC_BUILD >= 4608
+#if LIBAVCODEC_BUILD >= 4608
case FOURCC_DIV1:
case FOURCC_div1:
case FOURCC_MPG4:
case FOURCC_AP41:
case FOURCC_3IV1:
i_cat = VIDEO_ES;
-#if LIBAVCODEC_BUILD >= 4608
+#if LIBAVCODEC_BUILD >= 4608
i_codec = CODEC_ID_MSMPEG4V3;
#else
i_codec = CODEC_ID_MSMPEG4;
break;
#if LIBAVCODEC_BUILD >= 4655
+ case FOURCC_MAC3:
+ i_cat = AUDIO_ES;
+ i_codec = CODEC_ID_MACE3;
+ psz_name = "MACE-3 audio";
+ break;
+ case FOURCC_MAC6:
+ i_cat = AUDIO_ES;
+ i_codec = CODEC_ID_MACE6;
+ psz_name = "MACE-6 audio";
+ break;
case FOURCC_dvau:
i_cat = AUDIO_ES;
i_codec = CODEC_ID_DVAUDIO;