Lines 26-32
Link Here
|
26 |
#include "DynamicDll.h" |
26 |
#include "DynamicDll.h" |
27 |
#include "DllAvCodec.h" |
27 |
#include "DllAvCodec.h" |
28 |
#include "DllAvFormat.h" |
28 |
#include "DllAvFormat.h" |
|
|
29 |
#if LIBAVFILTER_VERSION_MICRO >= 50 // not Libav |
29 |
#include "DllSwResample.h" |
30 |
#include "DllSwResample.h" |
|
|
31 |
#endif |
30 |
#include "utils/log.h" |
32 |
#include "utils/log.h" |
31 |
|
33 |
|
32 |
extern "C" { |
34 |
extern "C" { |
Lines 45-51
Link Here
|
45 |
#if (defined HAVE_LIBAVFILTER_AVFILTER_H) |
47 |
#if (defined HAVE_LIBAVFILTER_AVFILTER_H) |
46 |
#include <libavfilter/avfiltergraph.h> |
48 |
#include <libavfilter/avfiltergraph.h> |
47 |
#include <libavfilter/buffersink.h> |
49 |
#include <libavfilter/buffersink.h> |
48 |
#include <libavfilter/avcodec.h> |
50 |
#if LIBAVFILTER_VERSION_MICRO < 50 // Libav |
|
|
51 |
#include <libavfilter/vsrc_buffer.h> |
52 |
#else |
53 |
#include <libavfilter/avcodec.h> |
54 |
#endif |
49 |
#elif (defined HAVE_FFMPEG_AVFILTER_H) |
55 |
#elif (defined HAVE_FFMPEG_AVFILTER_H) |
50 |
#include <ffmpeg/avfiltergraph.h> |
56 |
#include <ffmpeg/avfiltergraph.h> |
51 |
#include <ffmpeg/buffersink.h> |
57 |
#include <ffmpeg/buffersink.h> |
Lines 75-81
Link Here
|
75 |
virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; |
81 |
virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; |
76 |
virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; |
82 |
virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; |
77 |
#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) |
83 |
#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) |
|
|
84 |
#if LIBAVFILTER_VERSION_MICRO < 50 // Libav |
85 |
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)=0; |
86 |
#else |
78 |
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; |
87 |
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; |
|
|
88 |
#endif |
79 |
#else |
89 |
#else |
80 |
virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; |
90 |
virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; |
81 |
#endif |
91 |
#endif |
Lines 135-141
Link Here
|
135 |
return ::avfilter_graph_config(graphctx, log_ctx); |
145 |
return ::avfilter_graph_config(graphctx, log_ctx); |
136 |
} |
146 |
} |
137 |
#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) |
147 |
#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) |
|
|
148 |
#if LIBAVFILTER_VERSION_MICRO < 50 // Libav |
149 |
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); } |
150 |
#else |
138 |
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } |
151 |
virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } |
|
|
152 |
#endif |
139 |
#else |
153 |
#else |
140 |
virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } |
154 |
virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } |
141 |
#endif |
155 |
#endif |
Lines 207-213
Link Here
|
207 |
|
221 |
|
208 |
/* dependencies of libavfilter */ |
222 |
/* dependencies of libavfilter */ |
209 |
DllAvUtil m_dllAvUtil; |
223 |
DllAvUtil m_dllAvUtil; |
|
|
224 |
#if LIBAVFILTER_VERSION_MICRO >= 50 // not Libav |
210 |
DllSwResample m_dllSwResample; |
225 |
DllSwResample m_dllSwResample; |
|
|
226 |
#endif |
211 |
DllAvFormat m_dllAvFormat; |
227 |
DllAvFormat m_dllAvFormat; |
212 |
|
228 |
|
213 |
public: |
229 |
public: |
Lines 255-262
Link Here
|
255 |
{ |
271 |
{ |
256 |
if (!m_dllAvUtil.Load()) |
272 |
if (!m_dllAvUtil.Load()) |
257 |
return false; |
273 |
return false; |
|
|
274 |
#if LIBAVFILTER_VERSION_MICRO >= 50 // not Libav |
258 |
if (!m_dllSwResample.Load()) |
275 |
if (!m_dllSwResample.Load()) |
259 |
return false; |
276 |
return false; |
|
|
277 |
#endif |
260 |
if (!m_dllAvFormat.Load()) |
278 |
if (!m_dllAvFormat.Load()) |
261 |
return false; |
279 |
return false; |
262 |
return DllDynamic::Load(); |
280 |
return DllDynamic::Load(); |