From 4402d325726193ccc353861b17e5f88243da5a41 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 10:59:01 -0400 Subject: DllAvFilter.h: Do not map avfilter_open. It is deprecated in FFmpeg git master and unused in xbmc code. --- lib/DllAvFilter.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 0c38351a7a..7929503bf4 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -67,7 +67,6 @@ class DllAvFilterInterface { public: virtual ~DllAvFilterInterface() {} - virtual int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)=0; virtual void avfilter_free(AVFilterContext *filter)=0; virtual void avfilter_graph_free(AVFilterGraph **graph)=0; virtual int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)=0; @@ -98,11 +97,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface { public: virtual ~DllAvFilter() {} - virtual int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) - { - CSingleLock lock(DllAvCodec::m_critSection); - return ::avfilter_open(filter_ctx, filter, inst_name); - } virtual void avfilter_free(AVFilterContext *filter) { CSingleLock lock(DllAvCodec::m_critSection); @@ -170,7 +164,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface LOAD_SYMBOLS() - DEFINE_METHOD3(int, avfilter_open_dont_call, (AVFilterContext **p1, AVFilter *p2, const char *p3)) DEFINE_METHOD1(void, avfilter_free_dont_call, (AVFilterContext *p1)) DEFINE_METHOD1(void, avfilter_graph_free_dont_call, (AVFilterGraph **p1)) DEFINE_METHOD0(void, avfilter_register_all_dont_call) @@ -196,7 +189,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface DEFINE_FUNC_ALIGNED1(int , __cdecl, av_buffersink_poll_frame, AVFilterContext *); BEGIN_METHOD_RESOLVE() - RESOLVE_METHOD_RENAME(avfilter_open, avfilter_open_dont_call) RESOLVE_METHOD_RENAME(avfilter_free, avfilter_free_dont_call) RESOLVE_METHOD_RENAME(avfilter_graph_free, avfilter_graph_free_dont_call) RESOLVE_METHOD_RENAME(avfilter_register_all, avfilter_register_all_dont_call) @@ -225,11 +217,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface DllAvFormat m_dllAvFormat; public: - int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) - { - CSingleLock lock(DllAvCodec::m_critSection); - return avfilter_open_dont_call(filter_ctx, filter, inst_name); - } void avfilter_free(AVFilterContext *filter) { CSingleLock lock(DllAvCodec::m_critSection); -- cgit v1.2.3 From 0f6666340e189131a52407a77ab94c6d37967915 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 12:07:12 -0400 Subject: DllAvUtil.h: Add LIBAVUTIL_FROM* macros. --- lib/DllAvUtil.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index 937ba9ea4c..eaeb6d22f9 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -59,6 +59,13 @@ extern "C" { #endif } +#if LIBAVUTIL_VERSION_MICRO >= 100 + #define LIBAVUTIL_FROM_FFMPEG +#else + #define LIBAVUTIL_FROM_LIBAV +#endif + + #ifndef __GNUC__ #pragma warning(pop) #endif -- cgit v1.2.3 From e87f0cc16649d6770a6dff116f8865157e9e11b1 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 12:12:43 -0400 Subject: DllAvUtil.h: Map av_frame_free when applicable. --- lib/DllAvUtil.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index eaeb6d22f9..194fefdf3c 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -65,6 +65,10 @@ extern "C" { #define LIBAVUTIL_FROM_LIBAV #endif +#if (defined LIBAVUTIL_FROM_FFMPEG && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52,29,100)) || \ + (defined LIBAVUTIL_FROM_LIBAV && LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52,8,0)) +#define AVFRAME_IN_LAVU +#endif #ifndef __GNUC__ #pragma warning(pop) @@ -109,6 +113,9 @@ public: virtual int av_get_channel_layout_channel_index (uint64_t channel_layout, uint64_t channel) = 0; virtual int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, const uint8_t *buf, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0; virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) = 0; +#if defined(AVFRAME_IN_LAVU) + virtual void av_frame_free(AVFrame **frame)=0; +#endif }; #if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) @@ -157,6 +164,9 @@ public: { return ::av_samples_fill_arrays(audio_data, linesize, buf, nb_channels, nb_samples, AVSampleFormat sample_fmt, align); } virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) { return ::av_samples_copy(dst, src, dst_offset, src_offset, nb_samples, nb_channels, sample_fmt); } +#if defined(AVFRAME_IN_LAVU) + virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); } +#endif // DLL faking. virtual bool ResolveExports() { return true; } @@ -209,6 +219,9 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface DEFINE_METHOD2(int, av_get_channel_layout_channel_index, (uint64_t p1, uint64_t p2)) DEFINE_METHOD7(int, av_samples_fill_arrays, (uint8_t **p1, int *p2, const uint8_t *p3, int p4, int p5, enum AVSampleFormat p6, int p7)) DEFINE_METHOD7(int, av_samples_copy, (uint8_t **p1, uint8_t *const *p2, int p3, int p4, int p5, int p6, enum AVSampleFormat p7)) +#if defined(AVFRAME_IN_LAVU) + DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1)) +#endif public: BEGIN_METHOD_RESOLVE() @@ -244,6 +257,9 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface RESOLVE_METHOD(av_get_channel_layout_channel_index) RESOLVE_METHOD(av_samples_fill_arrays) RESOLVE_METHOD(av_samples_copy) +#if defined(AVFRAME_IN_LAVU) + RESOLVE_METHOD(av_frame_free) +#endif END_METHOD_RESOLVE() }; -- cgit v1.2.3 From f6b3af6b54b6d7da42a7ad5bd73313a6ec788161 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 12:22:55 -0400 Subject: DllAvUtil.h: Map av_frame_alloc when applicable. --- lib/DllAvUtil.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index 194fefdf3c..906c475832 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -115,6 +115,7 @@ public: virtual int av_samples_copy(uint8_t **dst, uint8_t *const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt) = 0; #if defined(AVFRAME_IN_LAVU) virtual void av_frame_free(AVFrame **frame)=0; + virtual AVFrame *av_frame_alloc(void)=0; #endif }; @@ -166,6 +167,7 @@ public: { return ::av_samples_copy(dst, src, dst_offset, src_offset, nb_samples, nb_channels, sample_fmt); } #if defined(AVFRAME_IN_LAVU) virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); } + virtual AVFrame *av_frame_alloc() { return ::av_frame_alloc(); } #endif // DLL faking. @@ -221,6 +223,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface DEFINE_METHOD7(int, av_samples_copy, (uint8_t **p1, uint8_t *const *p2, int p3, int p4, int p5, int p6, enum AVSampleFormat p7)) #if defined(AVFRAME_IN_LAVU) DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1)) + DEFINE_METHOD0(AVFrame *, av_frame_alloc) #endif public: @@ -259,6 +262,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface RESOLVE_METHOD(av_samples_copy) #if defined(AVFRAME_IN_LAVU) RESOLVE_METHOD(av_frame_free) + RESOLVE_METHOD(av_frame_alloc) #endif END_METHOD_RESOLVE() }; -- cgit v1.2.3 From ea1868df70889397ac1bc188eb0c48ac2ba7b21b Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 12:31:11 -0400 Subject: DllAvUtil.h: Map av_frame_unref when applicable. --- lib/DllAvUtil.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index 906c475832..a6b87f0ddc 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -116,6 +116,7 @@ public: #if defined(AVFRAME_IN_LAVU) virtual void av_frame_free(AVFrame **frame)=0; virtual AVFrame *av_frame_alloc(void)=0; + virtual void av_frame_unref(AVFrame *frame)=0; #endif }; @@ -168,6 +169,7 @@ public: #if defined(AVFRAME_IN_LAVU) virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); } virtual AVFrame *av_frame_alloc() { return ::av_frame_alloc(); } + virtual void av_frame_unref(AVFrame *frame) { return ::av_frame_unref(frame); } #endif // DLL faking. @@ -224,6 +226,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface #if defined(AVFRAME_IN_LAVU) DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1)) DEFINE_METHOD0(AVFrame *, av_frame_alloc) + DEFINE_METHOD1(void, av_frame_unref, (AVFrame *p1)) #endif public: @@ -263,6 +266,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface #if defined(AVFRAME_IN_LAVU) RESOLVE_METHOD(av_frame_free) RESOLVE_METHOD(av_frame_alloc) + RESOLVE_METHOD(av_frame_unref) #endif END_METHOD_RESOLVE() }; -- cgit v1.2.3 From ea3b8ccf7aa1cdef19890030341dedacdfd718e8 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 12:33:11 -0400 Subject: DllAvUtil.h: Map av_frame_move_ref when applicable. --- lib/DllAvUtil.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index a6b87f0ddc..3181f5beb5 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -117,6 +117,7 @@ public: virtual void av_frame_free(AVFrame **frame)=0; virtual AVFrame *av_frame_alloc(void)=0; virtual void av_frame_unref(AVFrame *frame)=0; + virtual void av_frame_move_ref(AVFrame *dst, AVFrame *src)=0; #endif }; @@ -170,6 +171,7 @@ public: virtual void av_frame_free(AVFrame **frame) { return ::av_frame_free(frame); } virtual AVFrame *av_frame_alloc() { return ::av_frame_alloc(); } virtual void av_frame_unref(AVFrame *frame) { return ::av_frame_unref(frame); } + virtual void av_frame_move_ref(AVFrame *dst, AVFrame *src) { return ::av_frame_move_ref(dst,src); } #endif // DLL faking. @@ -227,6 +229,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface DEFINE_METHOD1(void, av_frame_free, (AVFrame **p1)) DEFINE_METHOD0(AVFrame *, av_frame_alloc) DEFINE_METHOD1(void, av_frame_unref, (AVFrame *p1)) + DEFINE_METHOD2(void, av_frame_move_ref, (AVFrame *p1, AVFrame* p2)) #endif public: @@ -267,6 +270,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface RESOLVE_METHOD(av_frame_free) RESOLVE_METHOD(av_frame_alloc) RESOLVE_METHOD(av_frame_unref) + RESOLVE_METHOD(av_frame_move_ref) #endif END_METHOD_RESOLVE() }; -- cgit v1.2.3 From 156501303b0175a6cf65fb597528e0e50eaf4aeb Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 15:48:51 -0400 Subject: Switch to the avframe based API for libavfilter when it is available. The old API is deprecated and the new code is simpler and saves a memcopy. Also, use the AVFrame values instead of the codec context for DVDVideoCodecFFmpeg::GetPicture. --- lib/DllAvFilter.h | 36 ++++++++++++++++ .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 50 +++++++++++++++++++--- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.h | 4 ++ 3 files changed, 85 insertions(+), 5 deletions(-) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 7929503bf4..59f579a508 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -60,6 +60,10 @@ extern "C" { #define LIBAVFILTER_FROM_LIBAV #endif +#if ( defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) || \ + ( defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) +#define LIBAVFILTER_AVFRAME_BASED +#endif #include "threads/SingleLock.h" @@ -84,11 +88,19 @@ public: #else virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; #endif +#if !defined(LIBAVFILTER_AVFRAME_BASED) virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; +#endif virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0; +#if defined(LIBAVFILTER_AVFRAME_BASED) + virtual int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame) = 0; +#else virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0; +#endif virtual AVBufferSinkParams *av_buffersink_params_alloc()=0; +#if !defined(LIBAVFILTER_AVFRAME_BASED) virtual int av_buffersink_poll_frame(AVFilterContext *ctx)=0; +#endif }; #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) @@ -142,11 +154,19 @@ public: #else virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } #endif +#if !defined(LIBAVFILTER_AVFRAME_BASED) virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } +#endif virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } +#if defined(LIBAVFILTER_AVFRAME_BASED) + virtual int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame) { return ::av_buffersink_get_frame(ctx, frame); } +#else virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); } +#endif virtual AVBufferSinkParams *av_buffersink_params_alloc() { return ::av_buffersink_params_alloc(); } +#if !defined(LIBAVFILTER_AVFRAME_BASED) virtual int av_buffersink_poll_frame(AVFilterContext *ctx) { return ::av_buffersink_poll_frame(ctx); } +#endif // DLL faking. virtual bool ResolveExports() { return true; } virtual bool Load() { @@ -182,11 +202,19 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface #else DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) #endif +#if !defined(LIBAVFILTER_AVFRAME_BASED) DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) +#endif DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4)) +#if defined(LIBAVFILTER_AVFRAME_BASED) + DEFINE_FUNC_ALIGNED2(int , __cdecl, av_buffersink_get_frame, AVFilterContext *, AVFrame *); +#else DEFINE_FUNC_ALIGNED3(int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int); +#endif DEFINE_FUNC_ALIGNED0(AVBufferSinkParams*, __cdecl, av_buffersink_params_alloc); +#if !defined(LIBAVFILTER_AVFRAME_BASED) DEFINE_FUNC_ALIGNED1(int , __cdecl, av_buffersink_poll_frame, AVFilterContext *); +#endif BEGIN_METHOD_RESOLVE() RESOLVE_METHOD_RENAME(avfilter_free, avfilter_free_dont_call) @@ -204,11 +232,19 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface #else RESOLVE_METHOD(av_buffersrc_add_frame) #endif +#if !defined(LIBAVFILTER_AVFRAME_BASED) RESOLVE_METHOD(avfilter_unref_buffer) +#endif RESOLVE_METHOD(avfilter_link) +#if defined(LIBAVFILTER_AVFRAME_BASED) + RESOLVE_METHOD(av_buffersink_get_frame) +#else RESOLVE_METHOD(av_buffersink_get_buffer_ref) +#endif RESOLVE_METHOD(av_buffersink_params_alloc) +#if !defined(LIBAVFILTER_AVFRAME_BASED) RESOLVE_METHOD(av_buffersink_poll_frame) +#endif END_METHOD_RESOLVE() /* dependencies of libavfilter */ diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 5820dfebeb..5a1a47224c 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -147,7 +147,11 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() m_pFilterGraph = NULL; m_pFilterIn = NULL; m_pFilterOut = NULL; +#if defined(LIBAVFILTER_AVFRAME_BASED) + m_pFilterFrame = NULL; +#else m_pBufferRef = NULL; +#endif m_iPictureWidth = 0; m_iPictureHeight = 0; @@ -305,6 +309,11 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options m_pFrame = m_dllAvCodec.avcodec_alloc_frame(); if (!m_pFrame) return false; +#if defined(LIBAVFILTER_AVFRAME_BASED) + m_pFilterFrame = m_dllAvUtil.av_frame_alloc(); + if (!m_pFilterFrame) return false; +#endif + UpdateName(); return true; } @@ -314,6 +323,10 @@ void CDVDVideoCodecFFmpeg::Dispose() if (m_pFrame) m_dllAvUtil.av_free(m_pFrame); m_pFrame = NULL; +#if defined(LIBAVFILTER_AVFRAME_BASED) + m_dllAvUtil.av_frame_free(&m_pFilterFrame); +#endif + if (m_pCodecContext) { if (m_pCodecContext->codec) m_dllAvCodec.avcodec_close(m_pCodecContext); @@ -553,14 +566,16 @@ void CDVDVideoCodecFFmpeg::Reset() bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) { - pDvdVideoPicture->iWidth = m_pCodecContext->width; - pDvdVideoPicture->iHeight = m_pCodecContext->height; + pDvdVideoPicture->iWidth = m_pFrame->width; + pDvdVideoPicture->iHeight = m_pFrame->height; +#if !defined(LIBAVFILTER_AVFRAME_BASED) if(m_pBufferRef) { pDvdVideoPicture->iWidth = m_pBufferRef->video->w; pDvdVideoPicture->iHeight = m_pBufferRef->video->h; } +#endif /* crop of 10 pixels if demuxer asked it */ if(m_pCodecContext->coded_width && m_pCodecContext->coded_width < (int)pDvdVideoPicture->iWidth @@ -574,12 +589,14 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) double aspect_ratio; /* use variable in the frame */ - AVRational pixel_aspect = m_pCodecContext->sample_aspect_ratio; + AVRational pixel_aspect = m_pFrame->sample_aspect_ratio; +#if !defined(LIBAVFILTER_AVFRAME_BASED) if (m_pBufferRef) #if defined(LIBAVFILTER_FROM_FFMPEG) pixel_aspect = m_pBufferRef->video->sample_aspect_ratio; #else pixel_aspect = m_pBufferRef->video->pixel_aspect; +#endif #endif if (pixel_aspect.num == 0) @@ -675,10 +692,12 @@ bool CDVDVideoCodecFFmpeg::GetPicture(DVDVideoPicture* pDvdVideoPicture) pDvdVideoPicture->extended_format = 0; PixelFormat pix_fmt; +#if !defined(LIBAVFILTER_AVFRAME_BASED) if(m_pBufferRef) pix_fmt = (PixelFormat)m_pBufferRef->format; else - pix_fmt = m_pCodecContext->pix_fmt; +#endif + pix_fmt = (PixelFormat)m_pFrame->format; pDvdVideoPicture->format = CDVDCodecUtils::EFormatFromPixfmt(pix_fmt); return true; @@ -785,11 +804,13 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters, bool scale) void CDVDVideoCodecFFmpeg::FilterClose() { +#if !defined(LIBAVFILTER_AVFRAME_BASED) if(m_pBufferRef) { m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef); m_pBufferRef = NULL; } +#endif if (m_pFilterGraph) { @@ -803,7 +824,7 @@ void CDVDVideoCodecFFmpeg::FilterClose() int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) { - int result, frames; + int result; if (frame) { @@ -830,6 +851,24 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) } } +#if defined(LIBAVFILTER_AVFRAME_BASED) + result = m_dllAvFilter.av_buffersink_get_frame(m_pFilterOut, m_pFilterFrame); + + if(result == AVERROR(EAGAIN) || result == AVERROR_EOF) + return VC_BUFFER; + else if(result < 0) + { + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersink_get_frame"); + return VC_ERROR; + } + + m_dllAvUtil.av_frame_unref(m_pFrame); + m_dllAvUtil.av_frame_move_ref(m_pFrame, m_pFilterFrame); + + return VC_PICTURE; +#else + int frames; + if(m_pBufferRef) { m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef); @@ -870,6 +909,7 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) } return VC_BUFFER; +#endif } unsigned CDVDVideoCodecFFmpeg::GetConvergeCount() diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h index 28416e6fb8..c509339a91 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h @@ -99,7 +99,11 @@ protected: AVFilterGraph* m_pFilterGraph; AVFilterContext* m_pFilterIn; AVFilterContext* m_pFilterOut; +#if defined(LIBAVFILTER_AVFRAME_BASED) + AVFrame* m_pFilterFrame; +#else AVFilterBufferRef* m_pBufferRef; +#endif int m_iPictureWidth; int m_iPictureHeight; -- cgit v1.2.3 From 486a701e0f2f331cd50741eb4a01437f845d3c2d Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 15:56:18 -0400 Subject: DllAvFilter: Map avfilter_graph_parse_ptr when available. --- lib/DllAvFilter.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 59f579a508..c8582f6627 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -65,6 +65,10 @@ extern "C" { #define LIBAVFILTER_AVFRAME_BASED #endif +#if ( defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,78,100) ) +#define HAVE_AVFILTER_GRAPH_PARSE_PTR +#endif + #include "threads/SingleLock.h" class DllAvFilterInterface @@ -78,6 +82,9 @@ public: virtual AVFilterGraph *avfilter_graph_alloc(void)=0; virtual AVFilterInOut *avfilter_inout_alloc()=0; virtual void avfilter_inout_free(AVFilterInOut **inout)=0; +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + virtual int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; +#endif virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ @@ -137,6 +144,13 @@ public: CSingleLock lock(DllAvCodec::m_critSection); ::avfilter_inout_free(inout); } +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + virtual int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); + return ::avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx); + } +#endif virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) { CSingleLock lock(DllAvCodec::m_critSection); @@ -192,6 +206,9 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface DEFINE_METHOD0(AVFilterGraph*, avfilter_graph_alloc) DEFINE_METHOD0(AVFilterInOut*, avfilter_inout_alloc_dont_call) DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_ptr_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) +#endif DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ @@ -225,6 +242,9 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface RESOLVE_METHOD(avfilter_graph_alloc) RESOLVE_METHOD_RENAME(avfilter_inout_alloc, avfilter_inout_alloc_dont_call) RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + RESOLVE_METHOD_RENAME(avfilter_graph_parse_ptr, avfilter_graph_parse_ptr_dont_call) +#endif RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) @@ -273,6 +293,13 @@ public: CSingleLock lock(DllAvCodec::m_critSection); return avfilter_inout_alloc_dont_call(); } +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); + return avfilter_graph_parse_ptr_dont_call(graph, filters, inputs, outputs, log_ctx); + } +#endif int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) { CSingleLock lock(DllAvCodec::m_critSection); -- cgit v1.2.3 From b3e4dc7f94879651e25a4f3f70f5b80fbb91d4c8 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 16:41:38 -0400 Subject: Use avfilter_graph_parse_ptr when available (Fixes a deprecation warning with FFmpeg 2.0). Include the libav API for avfilter_graph_parse which should help porting to libav. --- lib/DllAvFilter.h | 37 ++++++++++++++++++---- .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 ++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index c8582f6627..0c2feb8dd0 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -66,7 +66,11 @@ extern "C" { #endif #if ( defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,78,100) ) -#define HAVE_AVFILTER_GRAPH_PARSE_PTR + #define HAVE_AVFILTER_GRAPH_PARSE_PTR +#elif defined(LIBAVFILTER_FROM_LIBAV) + #define AVFILTER_GRAPH_PARSE_TAKES_SINGLE_PTR_ARG +#else + #define AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG #endif #include "threads/SingleLock.h" @@ -84,8 +88,11 @@ public: virtual void avfilter_inout_free(AVFilterInOut **inout)=0; #if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) virtual int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; -#endif +#elif defined(AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG) virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; +#else + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut *inputs, AVFilterInOut *outputs, void *log_ctx)=0; +#endif virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ (defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) @@ -150,12 +157,19 @@ public: CSingleLock lock(DllAvCodec::m_critSection); return ::avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx); } -#endif +#elif defined(AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG) virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) { CSingleLock lock(DllAvCodec::m_critSection); return ::avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx); } +#else + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut *inputs, AVFilterInOut *outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); + return ::avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx); + } +#endif virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx) { return ::avfilter_graph_config(graphctx, log_ctx); @@ -208,8 +222,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) #if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_ptr_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) -#endif +#elif defined(AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG) DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) +#else + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut *, AVFilterInOut *, void *) +#endif DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ (defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) @@ -244,8 +261,9 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) #if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) RESOLVE_METHOD_RENAME(avfilter_graph_parse_ptr, avfilter_graph_parse_ptr_dont_call) -#endif +#else RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) +#endif RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) RESOLVE_METHOD(av_vsrc_buffer_add_frame) @@ -299,12 +317,19 @@ public: CSingleLock lock(DllAvCodec::m_critSection); return avfilter_graph_parse_ptr_dont_call(graph, filters, inputs, outputs, log_ctx); } -#endif +#elif defined(AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG) int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) { CSingleLock lock(DllAvCodec::m_critSection); return avfilter_graph_parse_dont_call(graph, filters, inputs, outputs, log_ctx); } +#else + int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut *inputs, AVFilterInOut *outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); + return avfilter_graph_parse_dont_call(graph, filters, inputs, outputs, log_ctx); + } +#endif void avfilter_inout_free(AVFilterInOut **inout) { CSingleLock lock(DllAvCodec::m_critSection); diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 5a1a47224c..6b6f9fa88b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -775,7 +775,13 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters, bool scale) inputs->pad_idx = 0; inputs->next = NULL; +#if defined(HAVE_AVFILTER_GRAPH_PARSE_PTR) + if ((result = m_dllAvFilter.avfilter_graph_parse_ptr(m_pFilterGraph, (const char*)m_filters.c_str(), &inputs, &outputs, NULL)) < 0) +#elif defined(AVFILTER_GRAPH_PARSE_TAKES_PTR_PTR_ARG) if ((result = m_dllAvFilter.avfilter_graph_parse(m_pFilterGraph, (const char*)m_filters.c_str(), &inputs, &outputs, NULL)) < 0) +#else + if ((result = m_dllAvFilter.avfilter_graph_parse(m_pFilterGraph, (const char*)m_filters.c_str(), inputs, outputs, NULL)) < 0) +#endif { CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_parse"); return result; -- cgit v1.2.3 From 38dcff6c01fdbac8d3db1bd1d18c5f2469463de2 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 17:08:28 -0400 Subject: Drop support for av_vsrc_buffer_add_frame: We are using the new API since libavfilter 3, which is available in FFmpeg 1.0 at least. libavfilter from libav will not work without the avframe based API anyway. --- lib/DllAvFilter.h | 16 +++------------- .../dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 6 ++---- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 0c2feb8dd0..75824bdada 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -97,10 +97,8 @@ public: #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ (defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame)=0; -#elif defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,72,105) - virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; #else - virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; + virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; #endif #if !defined(LIBAVFILTER_AVFRAME_BASED) virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; @@ -177,10 +175,8 @@ public: #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ (defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame) { return ::av_buffersrc_add_frame(buffer_filter, frame); } -#elif defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,72,105) - virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } #else - virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } + virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } #endif #if !defined(LIBAVFILTER_AVFRAME_BASED) virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } @@ -231,10 +227,8 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface #if (defined(LIBAVFILTER_FROM_LIBAV) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,5,0)) || \ (defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(3,43,100)) DEFINE_METHOD2(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2)) -#elif defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,72,105) - DEFINE_METHOD3(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) #else - DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) + DEFINE_METHOD3(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) #endif #if !defined(LIBAVFILTER_AVFRAME_BASED) DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) @@ -265,11 +259,7 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) #endif RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) -#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) - RESOLVE_METHOD(av_vsrc_buffer_add_frame) -#else RESOLVE_METHOD(av_buffersrc_add_frame) -#endif #if !defined(LIBAVFILTER_AVFRAME_BASED) RESOLVE_METHOD(avfilter_unref_buffer) #endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 6b6f9fa88b..12bad2719d 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -842,17 +842,15 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) // libav: commit 7e350379f87e7f74420b4813170fe808e2313911 (28 Nov 2012) // release v9 (5 January 2013) result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame); -#elif defined(LIBAVFILTER_FROM_FFMPEG) && LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,72,105) +#else // API changed in: // ffmpeg: commit 7bac2a78c2241df4bcc1665703bb71afd9a3e692 (28 Apr 2012) // release 0.11 (25 May 2012) result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame, 0); -#else - result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0); #endif if (result < 0) { - CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersrc_add_frame/av_vsrc_buffer_add_frame"); + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersrc_add_frame"); return VC_ERROR; } } -- cgit v1.2.3 From 6a12b25dd77052aa1de7381ad0a11e9721300447 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 17:11:13 -0400 Subject: DllAvFilter.h: Include libavfilter/avfilter.h since we are using functions from this header such as avfilter_get_by_name. --- lib/DllAvFilter.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 75824bdada..8dfa03436d 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -42,11 +42,13 @@ extern "C" { #endif #if (defined USE_EXTERNAL_FFMPEG) + #include #include #include #include #include #else + #include "libavfilter/avfilter.h" #include "libavfilter/avfiltergraph.h" #include "libavfilter/buffersink.h" #include "libavfilter/avcodec.h" -- cgit v1.2.3 From b03b7b7c18bcc08570889652541c9d3071e5edad Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 26 Jul 2013 17:13:40 -0400 Subject: DllAvFilter.h: Include libavfilter/avcodec.h only when necessary. We are not using it anymore when using the new avfilter APIs and it contains only deprecated functions. --- lib/DllAvFilter.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index 8dfa03436d..4d5aeda58b 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -45,13 +45,17 @@ extern "C" { #include #include #include +#if LIBAVFILTER_VERSION_MICRO >= 100 && LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,43,100) #include +#endif #include #else #include "libavfilter/avfilter.h" #include "libavfilter/avfiltergraph.h" #include "libavfilter/buffersink.h" +#if LIBAVFILTER_VERSION_MICRO >= 100 && LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,43,100) #include "libavfilter/avcodec.h" +#endif #include "libavfilter/buffersrc.h" #endif } -- cgit v1.2.3