Commit adda5957 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

libav*: create a new avcommon_compat.h file for backward compatibility

This patch includes necessary defines
parent 5107430d
...@@ -91,6 +91,7 @@ endif ...@@ -91,6 +91,7 @@ endif
### FFmpeg/libav ### ### FFmpeg/libav ###
libavcodec_plugin_la_SOURCES = \ libavcodec_plugin_la_SOURCES = \
avcodec/avcommon_compat.h \
avcodec/avcommon.h \ avcodec/avcommon.h \
avcodec/video.c \ avcodec/video.c \
avcodec/subtitle.c \ avcodec/subtitle.c \
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
*****************************************************************************/ *****************************************************************************/
#include "chroma.h" #include "chroma.h"
#include "avcommon.h"
/* VLC <-> avcodec tables */ /* VLC <-> avcodec tables */
int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat, int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
int *pi_ffmpeg_codec, const char **ppsz_name ); int *pi_ffmpeg_codec, const char **ppsz_name );
...@@ -275,11 +277,3 @@ int ffmpeg_OpenCodec( decoder_t *p_dec ); ...@@ -275,11 +277,3 @@ int ffmpeg_OpenCodec( decoder_t *p_dec );
# define HAVE_AVCODEC_MT # define HAVE_AVCODEC_MT
#endif #endif
/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
(LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) )
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef AVCOMMON_H
#define AVCOMMON_H 1
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
...@@ -31,6 +34,8 @@ ...@@ -31,6 +34,8 @@
#include <limits.h> #include <limits.h>
#include "avcommon_compat.h"
/* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg /* LIBAVUTIL_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version * a is the major version
* b and c the minor and micro versions of libav * b and c the minor and micro versions of libav
...@@ -72,10 +77,6 @@ static inline void vlc_init_avcodec(void) ...@@ -72,10 +77,6 @@ static inline void vlc_init_avcodec(void)
# include <libavutil/avutil.h> # include <libavutil/avutil.h>
# include <libavutil/dict.h> # include <libavutil/dict.h>
#if LIBAVUTIL_VERSION_MAJOR < 52 && !defined(AV_CPU_FLAG_MMXEXT)
# define AV_CPU_FLAG_MMXEXT AV_CPU_FLAG_MMX2
#endif
#define AV_OPTIONS_TEXT "Advanced options." #define AV_OPTIONS_TEXT "Advanced options."
#define AV_OPTIONS_LONGTEXT "Advanced options, in the form {opt=val,opt2=val2} ." #define AV_OPTIONS_LONGTEXT "Advanced options, in the form {opt=val,opt2=val2} ."
...@@ -94,3 +95,5 @@ static inline AVDictionary *vlc_av_get_options(const char *psz_opts) ...@@ -94,3 +95,5 @@ static inline AVDictionary *vlc_av_get_options(const char *psz_opts)
return options; return options;
} }
#endif #endif
#endif
This diff is collapsed.
...@@ -45,6 +45,7 @@ libavformat_plugin_la_SOURCES = avformat/demux.c \ ...@@ -45,6 +45,7 @@ libavformat_plugin_la_SOURCES = avformat/demux.c \
../codec/avcodec/chroma.c \ ../codec/avcodec/chroma.c \
../codec/avcodec/cpu.c \ ../codec/avcodec/cpu.c \
../codec/avcodec/avcommon.h \ ../codec/avcodec/avcommon.h \
../codec/avcodec/avcommon_compat.h \
vobsub.h \ vobsub.h \
avformat/avformat.c avformat/avformat.h avformat/avformat.c avformat/avformat.h
if ENABLE_SOUT if ENABLE_SOUT
......
...@@ -6,7 +6,8 @@ SOURCES_stream_out_duplicate = duplicate.c ...@@ -6,7 +6,8 @@ SOURCES_stream_out_duplicate = duplicate.c
SOURCES_stream_out_es = es.c SOURCES_stream_out_es = es.c
SOURCES_stream_out_display = display.c SOURCES_stream_out_display = display.c
SOURCES_stream_out_gather = gather.c SOURCES_stream_out_gather = gather.c
SOURCES_stream_out_switcher = switcher.c ../codec/avcodec/cpu.c SOURCES_stream_out_switcher = switcher.c ../codec/avcodec/cpu.c \
../codec/avcodec/avcommon_compat.h ../codec/avcodec/avcommon.h
SOURCES_stream_out_bridge = bridge.c SOURCES_stream_out_bridge = bridge.c
SOURCES_stream_out_mosaic_bridge = mosaic_bridge.c SOURCES_stream_out_mosaic_bridge = mosaic_bridge.c
SOURCES_stream_out_autodel = autodel.c SOURCES_stream_out_autodel = autodel.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment