X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fffmpeg%2Fffmpeg.c;h=e3cbfbd5f0a8400e05b17cc1d9afabeda7e1e04e;hb=c84e40d0a9048e364c2eeb61b416ae57bbb05080;hp=d7d756b85715214942ad8a805e97bef2e56cf6ec;hpb=e08927e56bf27d539a416437f0bb33230279e4f6;p=vlc diff --git a/modules/codec/ffmpeg/ffmpeg.c b/modules/codec/ffmpeg/ffmpeg.c index d7d756b857..e3cbfbd5f0 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.43 2003/06/15 22:32:06 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 @@ -58,621 +48,942 @@ # else # include # endif -#else -# include "postprocessing/postprocessing.h" #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 * ); +static char *enc_hq_list[] = { "rd", "bits", "simple" }; +static char *enc_hq_list_text[] = { N_("rd"), N_("bits"), N_("simple") }; /***************************************************************************** * 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 \ -"[: