added support for external libavformat

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17355 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-01-09 19:35:44 +00:00
parent 0355c44922
commit ad978de549
8 changed files with 49 additions and 13 deletions

View File

@ -55,7 +55,7 @@ extern m_option_t x264encopts_conf[];
extern m_option_t nuvopts_conf[];
extern m_option_t mpegopts_conf[];
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
extern m_option_t lavfopts_conf[];
#endif
@ -177,7 +177,7 @@ m_option_t info_conf[]={
m_option_t of_conf[]={
{"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL},
{"mpeg", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_MPEG, NULL},
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
{"lavf", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_LAVF, NULL},
#endif
{"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL},
@ -185,7 +185,7 @@ m_option_t of_conf[]={
{"help", "\nAvailable output formats:\n"
" avi - Microsoft Audio/Video Interleaved\n"
" mpeg - MPEG-1/2 system stream format\n"
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
" lavf - FFmpeg libavformat muxers\n"
#endif
" rawvideo - (video only, one stream only) raw stream, no muxing\n"
@ -298,7 +298,7 @@ m_option_t mencoder_opts[]={
{"nuvopts", nuvopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
{"mpegopts", mpegopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
{"lavfopts", lavfopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
#endif

25
configure vendored
View File

@ -1460,6 +1460,7 @@ _amr_wb=auto
_libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
_libavcodecso=auto
_libavformat=auto
_libavformat_so=auto
_fame=auto
_mp1e=no
_mencoder=yes
@ -6060,6 +6061,19 @@ fi
echores "$_libavcodecso"
fi
if test "$_libavformat" != yes ; then
echocheck "FFmpeg libavformat (dynamic)"
if test "$_libavformat_so" = auto ; then
_libavformat_so=no
cat > $TMPC <<EOF
#include <ffmpeg/avformat.h>
int main(void) { av_alloc_format_context(); return 0; }
EOF
cc_check $_ld_lm -lavformat && _libavformat_so=yes
fi
echores "$_libavformat_so"
fi
_def_libavcodec='#undef USE_LIBAVCODEC'
_def_libavcodecso='#undef USE_LIBAVCODEC_SO'
_def_ffpostprocess='#undef FF_POSTPROCESS'
@ -6083,6 +6097,7 @@ else
fi
_def_libavformat='#undef USE_LIBAVFORMAT'
_def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
_def_libavformat_win32='#undef CONFIG_WIN32'
if test "$_libavformat" = yes ; then
_def_libavformat='#define USE_LIBAVFORMAT 1'
@ -6091,6 +6106,14 @@ if test "$_libavformat" = yes ; then
if win32 ; then
_def_libavformat_win32='#define CONFIG_WIN32 1'
fi
else
if test "$_libavformat_so" = yes ; then
_def_libavformat_so='#define USE_LIBAVFORMAT_SO 1'
_ld_libavformat='-lavformat'
if win32 ; then
_def_libavformat_win32='#define CONFIG_WIN32 1'
fi
fi
fi
echocheck "amr narrowband"
@ -7184,6 +7207,7 @@ CONFIG_LIBAVUTIL = $_libavutil
CONFIG_LIBAVCODEC = $_libavcodec
CONFIG_LIBAVCODECSO = $_libavcodecso
CONFIG_LIBAVFORMAT = $_libavformat
CONFIG_LIBAVFORMAT_SO = $_libavformat_so
ZORAN = $_zr
FAME = $_fame
FAME_LIB = $_ld_fame
@ -7576,6 +7600,7 @@ $_def_libavcodecso
/* ffmpeg's libavformat support (requires libavformat source) */
$_def_libavformat
$_def_libavformat_so
$_def_libavformat_win32
/* Use libavcodec's decoders */

View File

@ -26,7 +26,7 @@ extern int lavc_param_abitrate;
extern int lavc_param_atag;
extern int avcodec_inited;
static int compressed_frame_size = 0;
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
extern unsigned int codec_get_wav_tag(int id);
#endif
@ -167,7 +167,7 @@ int mpae_init_lavc(audio_encoder_t *encoder)
}
if(lavc_param_atag == 0)
{
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
lavc_param_atag = codec_get_wav_tag(lavc_acodec->id);
#else
lavc_param_atag = lavc_find_atag(lavc_param_acodec);

View File

@ -64,7 +64,6 @@ SRCS += demuxer.c \
demux_film.c \
demux_fli.c \
demux_gif.c \
demux_lavf.c \
demux_lmlm4.c \
demux_mf.c \
demux_mov.c \
@ -117,7 +116,12 @@ LIBAV_INC += -I../libavcodec
endif
ifeq ($(CONFIG_LIBAVFORMAT),yes)
LIBAV_INC += -I../libavformat
SRCS += muxer_lavf.c
SRCS += demux_lavf.c \
muxer_lavf.c
endif
ifeq ($(CONFIG_LIBAVFORMAT_SO),yes)
SRCS += demux_lavf.c \
muxer_lavf.c
endif
ifeq ($(MPLAYER_NETWORK),yes)

View File

@ -28,10 +28,12 @@
#include "demuxer.h"
#include "stheader.h"
#ifdef USE_LIBAVFORMAT
#ifdef USE_LIBAVFORMAT_SO
#include <ffmpeg/avformat.h>
#else
#include "avformat.h"
#include "avi.h"
#endif
#define PROBE_BUF_SIZE 2048
@ -451,4 +453,3 @@ demuxer_desc_t demuxer_desc_lavf = {
demux_lavf_control
};
#endif // USE_LIBAVFORMAT

View File

@ -62,7 +62,9 @@ extern demuxer_desc_t demuxer_desc_audio;
extern demuxer_desc_t demuxer_desc_xmms;
extern demuxer_desc_t demuxer_desc_mpeg_ty;
extern demuxer_desc_t demuxer_desc_rtp;
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
extern demuxer_desc_t demuxer_desc_lavf;
#endif
extern demuxer_desc_t demuxer_desc_aac;
demuxer_desc_t* demuxer_list[] = {
@ -119,7 +121,7 @@ demuxer_desc_t* demuxer_list[] = {
#ifdef STREAMING_LIVE555
&demuxer_desc_rtp,
#endif
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
&demuxer_desc_lavf,
#endif
&demuxer_desc_aac,

View File

@ -35,7 +35,7 @@ muxer_t *muxer_new_muxer(int type,FILE *f){
if(! muxer_init_muxer_rawaudio(muxer))
return NULL;
break;
#ifdef USE_LIBAVFORMAT
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
case MUXER_TYPE_LAVF:
if(! muxer_init_muxer_lavf(muxer))
return NULL;

View File

@ -17,7 +17,11 @@
#include "demuxer.h"
#include "stheader.h"
#include "m_option.h"
#ifdef USE_LIBAVFORMAT_SO
#include <ffmpeg/avformat.h>
#else
#include "avformat.h"
#endif
extern unsigned int codec_get_wav_tag(int id);
extern enum CodecID codec_get_bmp_id(unsigned int tag);