X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fffmpeg%2Fffmpeg.c;h=739c4ab7fa21f6cec04374f11d39b1bb9f4f2350;hb=779340cfa2ce06d7226e037765807edd24942885;hp=000277cd2c63afdae32cba2a8dba5ec3f8f19883;hpb=457b8d3568df26e9e430eb01090bbc1225e8c459;p=vlc diff --git a/modules/codec/ffmpeg/ffmpeg.c b/modules/codec/ffmpeg/ffmpeg.c index 000277cd2c..739c4ab7fa 100644 --- a/modules/codec/ffmpeg/ffmpeg.c +++ b/modules/codec/ffmpeg/ffmpeg.c @@ -2,9 +2,10 @@ * ffmpeg.c: video decoder using ffmpeg library ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: ffmpeg.c,v 1.50 2003/09/20 01:36:57 hartman Exp $ + * $Id$ * * Authors: Laurent Aimar + * Gildas Bazin * * 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 @@ -24,32 +25,21 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* malloc(), free() */ - #include -#include -#include #include -#include - -#include - -#ifdef HAVE_SYS_TIMES_H -# include -#endif /* ffmpeg header */ +#define HAVE_MMX #ifdef HAVE_FFMPEG_AVCODEC_H # include #else # include #endif -#if LIBAVCODEC_BUILD < 4655 -# error You must have a libavcodec >= 4655 (get CVS) +#if LIBAVCODEC_BUILD < 4680 +# error You must have a libavcodec >= 4680 (get CVS) #endif - #include "ffmpeg.h" #ifdef LIBAVCODEC_PP @@ -60,588 +50,713 @@ # endif #endif -#include "video.h" // video ffmpeg specific -#include "audio.h" // audio ffmpeg specific - -/* - * Local prototypes - */ -int E_(OpenChroma) ( vlc_object_t * ); -static int OpenDecoder ( vlc_object_t * ); -static int RunDecoder ( decoder_fifo_t * ); - -static int InitThread ( generic_thread_t * ); -static void EndThread ( generic_thread_t * ); - +/***************************************************************************** + * decoder_sys_t: decoder descriptor + *****************************************************************************/ +struct decoder_sys_t +{ + /* Common part between video and audio decoder */ + int i_cat; + int i_codec_id; + char *psz_namecodec; -static int b_ffmpeginit = 0; + AVCodecContext *p_context; + AVCodec *p_codec; +}; -static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t, int *, int *, char ** ); +/**************************************************************************** + * Local prototypes + ****************************************************************************/ +static int OpenDecoder( vlc_object_t * ); +static void CloseDecoder( vlc_object_t * ); /***************************************************************************** * Module descriptor *****************************************************************************/ -#define DR_TEXT N_("Direct rendering") - -#define ERROR_TEXT N_("Error resilience") -#define ERROR_LONGTEXT N_( \ - "ffmpeg can make errors resiliences. \n" \ - "Nevertheless, with a buggy encoder (like ISO MPEG-4 encoder from M$) " \ - "this will produce a lot of errors.\n" \ - "Valid range is -1 to 99 (-1 disables all errors resiliences).") - -#define BUGS_TEXT N_("Workaround bugs") -#define BUGS_LONGTEXT N_( \ - "Try to fix some bugs\n" \ - "1 autodetect\n" \ - "2 old msmpeg4\n" \ - "4 xvid interlaced\n" \ - "8 ump4 \n" \ - "16 no padding\n" \ - "32 ac vlc\n" \ - "64 Qpel chroma") - -#define HURRYUP_TEXT N_("Hurry up") -#define HURRYUP_LONGTEXT N_( \ - "Allow the decoder to partially decode or skip frame(s) " \ - "when there is not enough time. It's useful with low CPU power " \ - "but it can produce distorted pictures.") - -#define TRUNC_TEXT N_("Truncated stream") -#define TRUNC_LONGTEXT N_("truncated stream -1:auto,0:disable,:1:enable") - -#define PP_Q_TEXT N_("Post processing quality") -#define PP_Q_LONGTEXT N_( \ - "Quality of post processing. Valid range is 0 to 6\n" \ - "Higher levels require considerable more CPU power, but produce " \ - "better looking pictures." ) - -#define LIBAVCODEC_PP_TEXT N_("Ffmpeg postproc filter chains") -/* FIXME (cut/past from ffmpeg */ -#define LIBAVCODEC_PP_LONGTEXT \ -"[: