Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the new ffmpeg api #805

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,9 @@ if test "$use_external_ffmpeg" = "yes"; then
# old FFmpeg have this in libavcodec/opt.h instead:
AC_CHECK_HEADERS([libavutil/opt.h])

# new FFmpeg have math headers
AC_CHECK_HEADERS([libavutil/mathematics.h],,)

# We'll support the use of rgb2rgb.h if it exists.
AC_CHECK_HEADERS([libswscale/rgb2rgb.h],,)
AC_CHECK_HEADERS([ffmpeg/rgb2rgb.h],,)
Expand Down
10 changes: 9 additions & 1 deletion lib/DllAvFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern "C" {
#endif
/* for av_vsrc_buffer_add_frame */
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,8,0)
#include <libavfilter/avcodec.h>
#include <libavfilter/vsrc_buffer.h>
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter,
AVFrame *frame);
Expand Down Expand Up @@ -83,7 +83,11 @@ class DllAvFilterInterface
virtual int avfilter_poll_frame(AVFilterLink *link)=0;
virtual int avfilter_request_frame(AVFilterLink *link)=0;
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
#if LIBAVFILTER_VERSION_MICRO
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0;
#else
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)=0;
#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame)=0;
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
Expand Down Expand Up @@ -172,7 +176,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface
virtual int avfilter_poll_frame(AVFilterLink *link) { return ::avfilter_poll_frame(link); }
virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); }
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
#if LIBAVFILTER_VERSION_MICRO
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); }
#else
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, pts, pixel_aspect); }
#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame); }
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
Expand Down
3 changes: 3 additions & 0 deletions lib/DllAvUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ extern "C" {
#else
#include <ffmpeg/mem.h>
#endif
#if (defined HAVE_LIBAVUTIL_MATHEMATICS_H)
#include <libavutil/mathematics.h>
#endif
#else
#include "libavutil/avutil.h"
#include "libavutil/crc.h"
Expand Down
4 changes: 4 additions & 0 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,11 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame)
if (frame)
{
#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0)
#if LIBAVFILTER_VERSION_MICRO
result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0);
#else
result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, frame->pts, m_pCodecContext->sample_aspect_ratio);
#endif
#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0)
result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame);
#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0)
Expand Down