@@ -97,20 +97,6 @@ static av_cold void uninit(AVFilterContext* ctx) {
97
97
}
98
98
}
99
99
100
- static int query_formats (AVFilterContext * ctx ) {
101
- const enum AVPixelFormat pix_fmts [] = {
102
- AV_PIX_FMT_BGRA ,
103
- AV_PIX_FMT_NONE ,
104
- };
105
-
106
- AVFilterFormats * fmts_list = ff_make_format_list (pix_fmts );
107
- if (!fmts_list ) {
108
- return AVERROR (ENOMEM );
109
- }
110
-
111
- return ff_set_common_formats (ctx , fmts_list );
112
- }
113
-
114
100
static void clear_image (AVFrame * out ) {
115
101
for (int i = 0 ; i < out -> height ; i ++ ) {
116
102
for (int j = 0 ; j < out -> width ; j ++ ) {
@@ -175,19 +161,17 @@ static int config_input(AVFilterLink* inlink) {
175
161
}
176
162
177
163
static const AVFilterPad inputs [] = {{
178
- .name = "default" ,
179
- .type = AVMEDIA_TYPE_VIDEO ,
180
- .filter_frame = filter_frame ,
181
- .config_props = config_input ,
182
- .needs_writable = 1 ,
183
- },
184
- {NULL }};
164
+ .name = "default" ,
165
+ .type = AVMEDIA_TYPE_VIDEO ,
166
+ .filter_frame = filter_frame ,
167
+ .config_props = config_input ,
168
+ .flags = AVFILTERPAD_FLAG_NEEDS_WRITABLE ,
169
+ }};
185
170
186
171
static const AVFilterPad outputs [] = {{
187
- .name = "default" ,
188
- .type = AVMEDIA_TYPE_VIDEO ,
189
- },
190
- {NULL }};
172
+ .name = "default" ,
173
+ .type = AVMEDIA_TYPE_VIDEO ,
174
+ }};
191
175
192
176
static const AVOption proxy_options [] = {
193
177
{"filter_path" ,
@@ -219,14 +203,14 @@ static const AVOption proxy_options[] = {
219
203
220
204
AVFILTER_DEFINE_CLASS (proxy );
221
205
222
- AVFilter ff_vf_proxy = {
206
+ const AVFilter ff_vf_proxy = {
223
207
.name = "proxy" ,
224
208
.description = NULL_IF_CONFIG_SMALL ("Video filter proxy." ),
225
209
.priv_size = sizeof (ProxyContext ),
226
210
.init = init ,
227
211
.uninit = uninit ,
228
- . query_formats = query_formats ,
229
- . inputs = inputs ,
230
- . outputs = outputs ,
212
+ FILTER_INPUTS ( inputs ) ,
213
+ FILTER_OUTPUTS ( outputs ) ,
214
+ FILTER_SINGLE_PIXFMT ( AV_PIX_FMT_BGRA ) ,
231
215
.priv_class = & proxy_class ,
232
216
};
0 commit comments