@@ -74,7 +74,11 @@ class DllAvFilterInterface
74
74
virtual void avfilter_inout_free (AVFilterInOut **inout)=0;
75
75
virtual int avfilter_graph_parse (AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0;
76
76
virtual int avfilter_graph_config (AVFilterGraph *graphctx, void *log_ctx)=0;
77
+ #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0)
77
78
virtual int av_vsrc_buffer_add_frame (AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0;
79
+ #else
80
+ virtual int av_buffersrc_add_frame (AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0;
81
+ #endif
78
82
virtual void avfilter_unref_buffer (AVFilterBufferRef *ref)=0;
79
83
virtual int avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0;
80
84
virtual int av_buffersink_get_buffer_ref (AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0;
@@ -130,7 +134,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface
130
134
{
131
135
return ::avfilter_graph_config (graphctx, log_ctx);
132
136
}
137
+ #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0)
133
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); }
139
+ #else
140
+ virtual int av_buffersrc_add_frame (AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame (buffer_filter, frame, flags); }
141
+ #endif
134
142
virtual void avfilter_unref_buffer (AVFilterBufferRef *ref) { ::avfilter_unref_buffer (ref); }
135
143
virtual int avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link (src, srcpad, dst, dstpad); }
136
144
virtual int av_buffersink_get_buffer_ref (AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref (buffer_sink, bufref, flags); }
@@ -162,7 +170,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface
162
170
DEFINE_METHOD1 (void , avfilter_inout_free_dont_call, (AVFilterInOut **p1))
163
171
DEFINE_FUNC_ALIGNED5 (int , __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *)
164
172
DEFINE_FUNC_ALIGNED2 (int , __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *)
173
+ #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0)
165
174
DEFINE_METHOD3 (int , av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3))
175
+ #else
176
+ DEFINE_METHOD3 (int , av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3))
177
+ #endif
166
178
DEFINE_METHOD1 (void , avfilter_unref_buffer, (AVFilterBufferRef *p1))
167
179
DEFINE_METHOD4 (int , avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4))
168
180
DEFINE_FUNC_ALIGNED3 (int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int );
@@ -181,7 +193,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface
181
193
RESOLVE_METHOD_RENAME (avfilter_inout_free, avfilter_inout_free_dont_call)
182
194
RESOLVE_METHOD_RENAME (avfilter_graph_parse, avfilter_graph_parse_dont_call)
183
195
RESOLVE_METHOD_RENAME (avfilter_graph_config, avfilter_graph_config_dont_call)
196
+ #if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0)
184
197
RESOLVE_METHOD (av_vsrc_buffer_add_frame)
198
+ #else
199
+ RESOLVE_METHOD (av_buffersrc_add_frame)
200
+ #endif
185
201
RESOLVE_METHOD (avfilter_unref_buffer)
186
202
RESOLVE_METHOD (avfilter_link)
187
203
RESOLVE_METHOD (av_buffersink_get_buffer_ref)
0 commit comments