mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 13:17:13 +00:00
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:
parent
0355c44922
commit
ad978de549
@ -55,7 +55,7 @@ extern m_option_t x264encopts_conf[];
|
|||||||
|
|
||||||
extern m_option_t nuvopts_conf[];
|
extern m_option_t nuvopts_conf[];
|
||||||
extern m_option_t mpegopts_conf[];
|
extern m_option_t mpegopts_conf[];
|
||||||
#ifdef USE_LIBAVFORMAT
|
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
|
||||||
extern m_option_t lavfopts_conf[];
|
extern m_option_t lavfopts_conf[];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ m_option_t info_conf[]={
|
|||||||
m_option_t of_conf[]={
|
m_option_t of_conf[]={
|
||||||
{"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL},
|
{"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},
|
{"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},
|
{"lavf", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_LAVF, NULL},
|
||||||
#endif
|
#endif
|
||||||
{"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL},
|
{"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"
|
{"help", "\nAvailable output formats:\n"
|
||||||
" avi - Microsoft Audio/Video Interleaved\n"
|
" avi - Microsoft Audio/Video Interleaved\n"
|
||||||
" mpeg - MPEG-1/2 system stream format\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"
|
" lavf - FFmpeg libavformat muxers\n"
|
||||||
#endif
|
#endif
|
||||||
" rawvideo - (video only, one stream only) raw stream, no muxing\n"
|
" 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},
|
{"nuvopts", nuvopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
|
||||||
{"mpegopts", mpegopts_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},
|
{"lavfopts", lavfopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
25
configure
vendored
25
configure
vendored
@ -1460,6 +1460,7 @@ _amr_wb=auto
|
|||||||
_libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
|
_libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
|
||||||
_libavcodecso=auto
|
_libavcodecso=auto
|
||||||
_libavformat=auto
|
_libavformat=auto
|
||||||
|
_libavformat_so=auto
|
||||||
_fame=auto
|
_fame=auto
|
||||||
_mp1e=no
|
_mp1e=no
|
||||||
_mencoder=yes
|
_mencoder=yes
|
||||||
@ -6060,6 +6061,19 @@ fi
|
|||||||
echores "$_libavcodecso"
|
echores "$_libavcodecso"
|
||||||
fi
|
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_libavcodec='#undef USE_LIBAVCODEC'
|
||||||
_def_libavcodecso='#undef USE_LIBAVCODEC_SO'
|
_def_libavcodecso='#undef USE_LIBAVCODEC_SO'
|
||||||
_def_ffpostprocess='#undef FF_POSTPROCESS'
|
_def_ffpostprocess='#undef FF_POSTPROCESS'
|
||||||
@ -6083,6 +6097,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
_def_libavformat='#undef USE_LIBAVFORMAT'
|
_def_libavformat='#undef USE_LIBAVFORMAT'
|
||||||
|
_def_libavformat_so='#undef USE_LIBAVFORMAT_SO'
|
||||||
_def_libavformat_win32='#undef CONFIG_WIN32'
|
_def_libavformat_win32='#undef CONFIG_WIN32'
|
||||||
if test "$_libavformat" = yes ; then
|
if test "$_libavformat" = yes ; then
|
||||||
_def_libavformat='#define USE_LIBAVFORMAT 1'
|
_def_libavformat='#define USE_LIBAVFORMAT 1'
|
||||||
@ -6091,6 +6106,14 @@ if test "$_libavformat" = yes ; then
|
|||||||
if win32 ; then
|
if win32 ; then
|
||||||
_def_libavformat_win32='#define CONFIG_WIN32 1'
|
_def_libavformat_win32='#define CONFIG_WIN32 1'
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
echocheck "amr narrowband"
|
echocheck "amr narrowband"
|
||||||
@ -7184,6 +7207,7 @@ CONFIG_LIBAVUTIL = $_libavutil
|
|||||||
CONFIG_LIBAVCODEC = $_libavcodec
|
CONFIG_LIBAVCODEC = $_libavcodec
|
||||||
CONFIG_LIBAVCODECSO = $_libavcodecso
|
CONFIG_LIBAVCODECSO = $_libavcodecso
|
||||||
CONFIG_LIBAVFORMAT = $_libavformat
|
CONFIG_LIBAVFORMAT = $_libavformat
|
||||||
|
CONFIG_LIBAVFORMAT_SO = $_libavformat_so
|
||||||
ZORAN = $_zr
|
ZORAN = $_zr
|
||||||
FAME = $_fame
|
FAME = $_fame
|
||||||
FAME_LIB = $_ld_fame
|
FAME_LIB = $_ld_fame
|
||||||
@ -7576,6 +7600,7 @@ $_def_libavcodecso
|
|||||||
|
|
||||||
/* ffmpeg's libavformat support (requires libavformat source) */
|
/* ffmpeg's libavformat support (requires libavformat source) */
|
||||||
$_def_libavformat
|
$_def_libavformat
|
||||||
|
$_def_libavformat_so
|
||||||
$_def_libavformat_win32
|
$_def_libavformat_win32
|
||||||
|
|
||||||
/* Use libavcodec's decoders */
|
/* Use libavcodec's decoders */
|
||||||
|
@ -26,7 +26,7 @@ extern int lavc_param_abitrate;
|
|||||||
extern int lavc_param_atag;
|
extern int lavc_param_atag;
|
||||||
extern int avcodec_inited;
|
extern int avcodec_inited;
|
||||||
static int compressed_frame_size = 0;
|
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);
|
extern unsigned int codec_get_wav_tag(int id);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ int mpae_init_lavc(audio_encoder_t *encoder)
|
|||||||
}
|
}
|
||||||
if(lavc_param_atag == 0)
|
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);
|
lavc_param_atag = codec_get_wav_tag(lavc_acodec->id);
|
||||||
#else
|
#else
|
||||||
lavc_param_atag = lavc_find_atag(lavc_param_acodec);
|
lavc_param_atag = lavc_find_atag(lavc_param_acodec);
|
||||||
|
@ -64,7 +64,6 @@ SRCS += demuxer.c \
|
|||||||
demux_film.c \
|
demux_film.c \
|
||||||
demux_fli.c \
|
demux_fli.c \
|
||||||
demux_gif.c \
|
demux_gif.c \
|
||||||
demux_lavf.c \
|
|
||||||
demux_lmlm4.c \
|
demux_lmlm4.c \
|
||||||
demux_mf.c \
|
demux_mf.c \
|
||||||
demux_mov.c \
|
demux_mov.c \
|
||||||
@ -117,7 +116,12 @@ LIBAV_INC += -I../libavcodec
|
|||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_LIBAVFORMAT),yes)
|
ifeq ($(CONFIG_LIBAVFORMAT),yes)
|
||||||
LIBAV_INC += -I../libavformat
|
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
|
endif
|
||||||
|
|
||||||
ifeq ($(MPLAYER_NETWORK),yes)
|
ifeq ($(MPLAYER_NETWORK),yes)
|
||||||
|
@ -28,10 +28,12 @@
|
|||||||
#include "demuxer.h"
|
#include "demuxer.h"
|
||||||
#include "stheader.h"
|
#include "stheader.h"
|
||||||
|
|
||||||
#ifdef USE_LIBAVFORMAT
|
#ifdef USE_LIBAVFORMAT_SO
|
||||||
|
#include <ffmpeg/avformat.h>
|
||||||
|
#else
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
#include "avi.h"
|
#include "avi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PROBE_BUF_SIZE 2048
|
#define PROBE_BUF_SIZE 2048
|
||||||
|
|
||||||
@ -451,4 +453,3 @@ demuxer_desc_t demuxer_desc_lavf = {
|
|||||||
demux_lavf_control
|
demux_lavf_control
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // USE_LIBAVFORMAT
|
|
||||||
|
@ -62,7 +62,9 @@ extern demuxer_desc_t demuxer_desc_audio;
|
|||||||
extern demuxer_desc_t demuxer_desc_xmms;
|
extern demuxer_desc_t demuxer_desc_xmms;
|
||||||
extern demuxer_desc_t demuxer_desc_mpeg_ty;
|
extern demuxer_desc_t demuxer_desc_mpeg_ty;
|
||||||
extern demuxer_desc_t demuxer_desc_rtp;
|
extern demuxer_desc_t demuxer_desc_rtp;
|
||||||
|
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
|
||||||
extern demuxer_desc_t demuxer_desc_lavf;
|
extern demuxer_desc_t demuxer_desc_lavf;
|
||||||
|
#endif
|
||||||
extern demuxer_desc_t demuxer_desc_aac;
|
extern demuxer_desc_t demuxer_desc_aac;
|
||||||
|
|
||||||
demuxer_desc_t* demuxer_list[] = {
|
demuxer_desc_t* demuxer_list[] = {
|
||||||
@ -119,7 +121,7 @@ demuxer_desc_t* demuxer_list[] = {
|
|||||||
#ifdef STREAMING_LIVE555
|
#ifdef STREAMING_LIVE555
|
||||||
&demuxer_desc_rtp,
|
&demuxer_desc_rtp,
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_LIBAVFORMAT
|
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
|
||||||
&demuxer_desc_lavf,
|
&demuxer_desc_lavf,
|
||||||
#endif
|
#endif
|
||||||
&demuxer_desc_aac,
|
&demuxer_desc_aac,
|
||||||
|
@ -35,7 +35,7 @@ muxer_t *muxer_new_muxer(int type,FILE *f){
|
|||||||
if(! muxer_init_muxer_rawaudio(muxer))
|
if(! muxer_init_muxer_rawaudio(muxer))
|
||||||
return NULL;
|
return NULL;
|
||||||
break;
|
break;
|
||||||
#ifdef USE_LIBAVFORMAT
|
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
|
||||||
case MUXER_TYPE_LAVF:
|
case MUXER_TYPE_LAVF:
|
||||||
if(! muxer_init_muxer_lavf(muxer))
|
if(! muxer_init_muxer_lavf(muxer))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -17,7 +17,11 @@
|
|||||||
#include "demuxer.h"
|
#include "demuxer.h"
|
||||||
#include "stheader.h"
|
#include "stheader.h"
|
||||||
#include "m_option.h"
|
#include "m_option.h"
|
||||||
|
#ifdef USE_LIBAVFORMAT_SO
|
||||||
|
#include <ffmpeg/avformat.h>
|
||||||
|
#else
|
||||||
#include "avformat.h"
|
#include "avformat.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern unsigned int codec_get_wav_tag(int id);
|
extern unsigned int codec_get_wav_tag(int id);
|
||||||
extern enum CodecID codec_get_bmp_id(unsigned int tag);
|
extern enum CodecID codec_get_bmp_id(unsigned int tag);
|
||||||
|
Loading…
Reference in New Issue
Block a user