History

lavfi: replace filter_samples by filter_frame

Based on patch by Anton Khirnov Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer committed 13 years ago

Commit cd7febd1 parent 16af29a41 files · +134 −134Browse files

Unified · Split

41 files
  1. doc/filter_design.txt +10 −10
  2. libavfilter/af_aconvert.c +3 −3
  3. libavfilter/af_amerge.c +3 −3
  4. libavfilter/af_amix.c +3 −3
  5. libavfilter/af_aresample.c +4 −4
  6. libavfilter/af_asetnsamples.c +3 −3
  7. libavfilter/af_ashowinfo.c +3 −3
  8. libavfilter/af_astreamsync.c +4 −4
  9. libavfilter/af_asyncts.c +5 −5
  10. libavfilter/af_atempo.c +4 −4
  11. libavfilter/af_channelmap.c +3 −3
  12. libavfilter/af_channelsplit.c +3 −3
  13. libavfilter/af_earwax.c +3 −3
  14. libavfilter/af_join.c +3 −3
  15. libavfilter/af_pan.c +3 −3
  16. libavfilter/af_resample.c +6 −6
  17. libavfilter/af_silencedetect.c +3 −3
  18. libavfilter/af_volume.c +3 −3
  19. libavfilter/af_volumedetect.c +3 −3
  20. libavfilter/asink_anullsink.c +2 −2
  21. libavfilter/asrc_aevalsrc.c +1 −1
  22. libavfilter/asrc_anullsrc.c +1 −1
  23. libavfilter/asrc_flite.c +1 −1
  24. libavfilter/audio.c +11 −11
  25. libavfilter/audio.h +2 −2
  26. libavfilter/avf_concat.c +4 −4
  27. libavfilter/avf_showspectrum.c +2 −2
  28. libavfilter/avf_showwaves.c +2 −2
  29. libavfilter/avfilter.c +1 −1
  30. libavfilter/avfilter.h +4 −4
  31. libavfilter/buffersink.c +1 −1
  32. libavfilter/buffersrc.c +1 −1
  33. libavfilter/f_ebur128.c +3 −3
  34. libavfilter/f_sendcmd.c +2 −2
  35. libavfilter/f_setpts.c +2 −2
  36. libavfilter/f_settb.c +3 −3
  37. libavfilter/fifo.c +3 −3
  38. libavfilter/internal.h +1 −1
  39. libavfilter/sink_buffer.c +11 −11
  40. libavfilter/split.c +3 −3
  41. libavfilter/src_movie.c +1 −1
doc/filter_design.txt+10−10
@@ -52,7 +52,7 @@ Buffer references ownership and permissions · 51 unmodified lines
5252 point to only a part of a video buffer.
5353
5454 A reference is usually obtained as input to the start_frame or
55− filter_samples method or requested using the ff_get_video_buffer or
55+ filter_frame method or requested using the ff_get_video_buffer or
5656 ff_get_audio_buffer functions. A new reference on an existing buffer can
5757 be created with the avfilter_ref_buffer. A reference is destroyed using
5858 the avfilter_unref_bufferp function.
@@ -68,14 +68,14 @@ Buffer references ownership and permissions · 9 unmodified lines
6868
6969 Here are the (fairly obvious) rules for reference ownership:
7070
71− * A reference received by the start_frame or filter_samples method
71+ * A reference received by the start_frame or filter_frame method
7272 belong to the corresponding filter.
7373
7474 Special exception: for video references: the reference may be used
7575 internally for automatic copying and must not be destroyed before
7676 end_frame; it can be given away to ff_start_frame.
7777
78− * A reference passed to ff_start_frame or ff_filter_samples is given
78+ * A reference passed to ff_start_frame or ff_filter_frame is given
7979 away and must no longer be used.
8080
8181 * A reference created with avfilter_ref_buffer belongs to the code that
@@ -93,16 +93,16 @@ Buffer references ownership and permissions · 11 unmodified lines
9393 The AVFilterLink structure has a few AVFilterBufferRef fields. Here are
9494 the rules to handle them:
9595
96− * cur_buf is set before the start_frame and filter_samples methods to
96+ * cur_buf is set before the start_frame and filter_frame methods to
9797 the same reference given as argument to the methods and belongs to the
9898 destination filter of the link. If it has not been cleared after
99− end_frame or filter_samples, libavfilter will automatically destroy
99+ end_frame or filter_frame, libavfilter will automatically destroy
100100 the reference; therefore, any filter that needs to keep the reference
101101 for longer must set cur_buf to NULL.
102102
103103 * out_buf belongs to the source filter of the link and can be used to
104104 store a reference to the buffer that has been sent to the destination.
105− If it is not NULL after end_frame or filter_samples, libavfilter will
105+ If it is not NULL after end_frame or filter_frame, libavfilter will
106106 automatically destroy the reference.
107107
108108 If a video input pad does not have a start_frame method, the default
@@ -179,7 +179,7 @@ Buffer references ownership and permissions · 70 unmodified lines
179179 with the WRITE permission.
180180
181181 * Filters that intend to keep a reference after the filtering process
182− is finished (after end_frame or filter_samples returns) must have the
182+ is finished (after end_frame or filter_frame returns) must have the
183183 PRESERVE permission on it and remove the WRITE permission if they
184184 create a new reference to give it away.
185185
@@ -198,7 +198,7 @@ Frame scheduling · 12 unmodified lines
198198 Simple filters that output one frame for each input frame should not have
199199 to worry about it.
200200
201− start_frame / filter_samples
201+ start_frame / filter_frame
202202 ----------------------------
203203
204204 These methods are called when a frame is pushed to the filter's input.
@@ -233,7 +233,7 @@ Frame scheduling · 28 unmodified lines
233233
234234 This method is called when a frame is wanted on an output.
235235
236− For an input, it should directly call start_frame or filter_samples on
236+ For an input, it should directly call start_frame or filter_frame on
237237 the corresponding output.
238238
239239 For a filter, if there are queued frames already ready, one of these
@@ -266,4 +266,4 @@ Frame scheduling · 26 unmodified lines
266266
267267 Note that, except for filters that can have queued frames, request_frame
268268 does not push frames: it requests them to its input, and as a reaction,
269− the start_frame / filter_samples method will be called and do the work.
269+ the start_frame / filter_frame method will be called and do the work.
libavfilter/af_aconvert.c+3−3
@@ -135,7 +135,7 @@ static int config_output(AVFilterLink *outlink) · 134 unmodified lines
135135 return 0;
136136 }
137137
138−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
138+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
139139 {
140140 AConvertContext *aconvert = inlink->dst->priv;
141141 const int n = insamplesref->audio->nb_samples;
@@ -149,7 +149,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref · 7 unmodified lines
149149 avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
150150 outsamplesref->audio->channel_layout = outlink->channel_layout;
151151
152− ret = ff_filter_samples(outlink, outsamplesref);
152+ ret = ff_filter_frame(outlink, outsamplesref);
153153 avfilter_unref_buffer(insamplesref);
154154 return ret;
155155 }
@@ -164,7 +164,7 @@ AVFilter avfilter_af_aconvert = { · 8 unmodified lines
164164
165165 .inputs = (const AVFilterPad[]) {{ .name = "default",
166166 .type = AVMEDIA_TYPE_AUDIO,
167− .filter_samples = filter_samples,
167+ .filter_frame = filter_frame,
168168 .min_perms = AV_PERM_READ, },
169169 { .name = NULL}},
170170 .outputs = (const AVFilterPad[]) {{ .name = "default",
libavfilter/af_amerge.c+3−3
@@ -217,7 +217,7 @@ static inline void copy_samples(int nb_inputs, struct amerge_input in[], · 216 unmodified lines
217217 }
218218 }
219219
220−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
220+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
221221 {
222222 AVFilterContext *ctx = inlink->dst;
223223 AMergeContext *am = ctx->priv;
@@ -290,7 +290,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 66 unmodified lines
290290 }
291291 }
292292 }
293− return ff_filter_samples(ctx->outputs[0], outbuf);
293+ return ff_filter_frame(ctx->outputs[0], outbuf);
294294 }
295295
296296 static av_cold int init(AVFilterContext *ctx, const char *args)
@@ -313,7 +313,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 16 unmodified lines
313313 AVFilterPad pad = {
314314 .name = name,
315315 .type = AVMEDIA_TYPE_AUDIO,
316− .filter_samples = filter_samples,
316+ .filter_frame = filter_frame,
317317 .min_perms = AV_PERM_READ | AV_PERM_PRESERVE,
318318 };
319319 if (!name)
libavfilter/af_amix.c+3−3
@@ -309,7 +309,7 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) · 308 unmodified lines
309309 if (s->next_pts != AV_NOPTS_VALUE)
310310 s->next_pts += nb_samples;
311311
312− return ff_filter_samples(outlink, out_buf);
312+ return ff_filter_frame(outlink, out_buf);
313313 }
314314
315315 /**
@@ -450,7 +450,7 @@ static int request_frame(AVFilterLink *outlink) · 134 unmodified lines
450450 return output_frame(outlink, available_samples);
451451 }
452452
453−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
453+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
454454 {
455455 AVFilterContext *ctx = inlink->dst;
456456 MixContext *s = ctx->priv;
@@ -502,7 +502,7 @@ static int init(AVFilterContext *ctx, const char *args) · 45 unmodified lines
502502 snprintf(name, sizeof(name), "input%d", i);
503503 pad.type = AVMEDIA_TYPE_AUDIO;
504504 pad.name = av_strdup(name);
505− pad.filter_samples = filter_samples;
505+ pad.filter_frame = filter_frame;
506506
507507 ff_insert_inpad(ctx, i, &pad);
508508 }
libavfilter/af_aresample.c+4−4
@@ -170,7 +170,7 @@ static int config_output(AVFilterLink *outlink) · 169 unmodified lines
170170 return 0;
171171 }
172172
173−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
173+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamplesref)
174174 {
175175 AResampleContext *aresample = inlink->dst->priv;
176176 const int n_in = insamplesref->audio->nb_samples;
@@ -205,7 +205,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) · 28 unmodified lines
205205
206206 outsamplesref->audio->nb_samples = n_out;
207207
208− ret = ff_filter_samples(outlink, outsamplesref);
208+ ret = ff_filter_frame(outlink, outsamplesref);
209209 aresample->req_fullfilled= 1;
210210 avfilter_unref_buffer(insamplesref);
211211 return ret;
@@ -247,7 +247,7 @@ static int request_frame(AVFilterLink *outlink) · 35 unmodified lines
247247 outsamplesref->pts = ROUNDED_DIV(outsamplesref->pts, inlink->sample_rate);
248248 #endif
249249
250− ff_filter_samples(outlink, outsamplesref);
250+ ff_filter_frame(outlink, outsamplesref);
251251 return 0;
252252 }
253253 return ret;
@@ -263,7 +263,7 @@ AVFilter avfilter_af_aresample = { · 9 unmodified lines
263263
264264 .inputs = (const AVFilterPad[]) {{ .name = "default",
265265 .type = AVMEDIA_TYPE_AUDIO,
266− .filter_samples = filter_samples,
266+ .filter_frame = filter_frame,
267267 .min_perms = AV_PERM_READ, },
268268 { .name = NULL}},
269269 .outputs = (const AVFilterPad[]) {{ .name = "default",
libavfilter/af_asetnsamples.c+3−3
@@ -125,12 +125,12 @@ static int push_samples(AVFilterLink *outlink) · 124 unmodified lines
125125 if (asns->next_out_pts != AV_NOPTS_VALUE)
126126 asns->next_out_pts += nb_out_samples;
127127
128− ff_filter_samples(outlink, outsamples);
128+ ff_filter_frame(outlink, outsamples);
129129 asns->req_fullfilled = 1;
130130 return nb_out_samples;
131131 }
132132
133−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
133+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
134134 {
135135 AVFilterContext *ctx = inlink->dst;
136136 ASNSContext *asns = ctx->priv;
@@ -186,7 +186,7 @@ AVFilter avfilter_af_asetnsamples = { · 49 unmodified lines
186186 {
187187 .name = "default",
188188 .type = AVMEDIA_TYPE_AUDIO,
189− .filter_samples = filter_samples,
189+ .filter_frame = filter_frame,
190190 .min_perms = AV_PERM_READ|AV_PERM_WRITE
191191 },
192192 { .name = NULL }
libavfilter/af_ashowinfo.c+3−3
@@ -54,7 +54,7 @@ static void uninit(AVFilterContext *ctx) · 53 unmodified lines
5454 av_freep(&s->plane_checksums);
5555 }
5656
57−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
57+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
5858 {
5959 AVFilterContext *ctx = inlink->dst;
6060 AShowInfoContext *s = ctx->priv;
@@ -100,7 +100,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 39 unmodified lines
100100 av_log(ctx, AV_LOG_INFO, "]\n");
101101
102102 s->frame++;
103− return ff_filter_samples(inlink->dst->outputs[0], buf);
103+ return ff_filter_frame(inlink->dst->outputs[0], buf);
104104 }
105105
106106 static const AVFilterPad inputs[] = {
@@ -108,7 +108,7 @@ static const AVFilterPad inputs[] = { · 1 unmodified line
108108 .name = "default",
109109 .type = AVMEDIA_TYPE_AUDIO,
110110 .get_audio_buffer = ff_null_get_audio_buffer,
111− .filter_samples = filter_samples,
111+ .filter_frame = filter_frame,
112112 .min_perms = AV_PERM_READ,
113113 },
114114 { NULL },
libavfilter/af_astreamsync.c+4−4
@@ -122,7 +122,7 @@ static int send_out(AVFilterContext *ctx, int out_id) · 121 unmodified lines
122122 av_q2d(ctx->outputs[out_id]->time_base) * buf->pts;
123123 as->var_values[VAR_T1 + out_id] += buf->audio->nb_samples /
124124 (double)ctx->inputs[out_id]->sample_rate;
125− ret = ff_filter_samples(ctx->outputs[out_id], buf);
125+ ret = ff_filter_frame(ctx->outputs[out_id], buf);
126126 queue->nb--;
127127 queue->tail = (queue->tail + 1) % QUEUE_SIZE;
128128 if (as->req[out_id])
@@ -167,7 +167,7 @@ static int request_frame(AVFilterLink *outlink) · 38 unmodified lines
167167 return 0;
168168 }
169169
170−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
170+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
171171 {
172172 AVFilterContext *ctx = inlink->dst;
173173 AStreamSyncContext *as = ctx->priv;
@@ -191,11 +191,11 @@ AVFilter avfilter_af_astreamsync = { · 17 unmodified lines
191191 .inputs = (const AVFilterPad[]) {
192192 { .name = "in1",
193193 .type = AVMEDIA_TYPE_AUDIO,
194− .filter_samples = filter_samples,
194+ .filter_frame = filter_frame,
195195 .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, },
196196 { .name = "in2",
197197 .type = AVMEDIA_TYPE_AUDIO,
198− .filter_samples = filter_samples,
198+ .filter_frame = filter_frame,
199199 .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, },
200200 { .name = NULL }
201201 },
libavfilter/af_asyncts.c+5−5
@@ -39,7 +39,7 @@ typedef struct ASyncContext { · 38 unmodified lines
3939 float min_delta_sec;
4040 int max_comp;
4141
42− /* set by filter_samples() to signal an output frame to request_frame() */
42+ /* set by filter_frame() to signal an output frame to request_frame() */
4343 int got_output;
4444 } ASyncContext;
4545
@@ -135,7 +135,7 @@ static int request_frame(AVFilterLink *link) · 89 unmodified lines
135135 }
136136
137137 buf->pts = s->pts;
138− return ff_filter_samples(link, buf);
138+ return ff_filter_frame(link, buf);
139139 }
140140
141141 return ret;
@@ -155,7 +155,7 @@ static int64_t get_delay(ASyncContext *s) · 13 unmodified lines
155155 return avresample_available(s->avr) + avresample_get_delay(s->avr);
156156 }
157157
158−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
158+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
159159 {
160160 AVFilterContext *ctx = inlink->dst;
161161 ASyncContext *s = ctx->priv;
@@ -211,7 +211,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 49 unmodified lines
211211 av_samples_set_silence(buf_out->extended_data, out_size - delta,
212212 delta, nb_channels, buf->format);
213213 }
214− ret = ff_filter_samples(outlink, buf_out);
214+ ret = ff_filter_frame(outlink, buf_out);
215215 if (ret < 0)
216216 goto fail;
217217 s->got_output = 1;
@@ -237,7 +237,7 @@ static const AVFilterPad avfilter_af_asyncts_inputs[] = { · 19 unmodified lines
237237 {
238238 .name = "default",
239239 .type = AVMEDIA_TYPE_AUDIO,
240− .filter_samples = filter_samples
240+ .filter_frame = filter_frame
241241 },
242242 { NULL }
243243 };
libavfilter/af_atempo.c+4−4
@@ -138,7 +138,7 @@ typedef struct { · 137 unmodified lines
138138 RDFTContext *complex_to_real;
139139 FFTSample *correlation;
140140
141− // for managing AVFilterPad.request_frame and AVFilterPad.filter_samples
141+ // for managing AVFilterPad.request_frame and AVFilterPad.filter_frame
142142 int request_fulfilled;
143143 AVFilterBufferRef *dst_buffer;
144144 uint8_t *dst;
@@ -1033,7 +1033,7 @@ static void push_samples(ATempoContext *atempo, · 888 unmodified lines
10331033 (AVRational){ 1, outlink->sample_rate },
10341034 outlink->time_base);
10351035
1036− ff_filter_samples(outlink, atempo->dst_buffer);
1036+ ff_filter_frame(outlink, atempo->dst_buffer);
10371037 atempo->dst_buffer = NULL;
10381038 atempo->dst = NULL;
10391039 atempo->dst_end = NULL;
@@ -1041,7 +1041,7 @@ static void push_samples(ATempoContext *atempo, · 1 unmodified line
10411041 atempo->nsamples_out += n_out;
10421042 }
10431043
1044−static int filter_samples(AVFilterLink *inlink,
1044+static int filter_frame(AVFilterLink *inlink,
10451045 AVFilterBufferRef *src_buffer)
10461046 {
10471047 AVFilterContext *ctx = inlink->dst;
@@ -1148,7 +1148,7 @@ AVFilter avfilter_af_atempo = { · 100 unmodified lines
11481148 .inputs = (const AVFilterPad[]) {
11491149 { .name = "default",
11501150 .type = AVMEDIA_TYPE_AUDIO,
1151− .filter_samples = filter_samples,
1151+ .filter_frame = filter_frame,
11521152 .config_props = config_props,
11531153 .min_perms = AV_PERM_READ, },
11541154 { .name = NULL}
libavfilter/af_channelmap.c+3−3
@@ -312,7 +312,7 @@ static int channelmap_query_formats(AVFilterContext *ctx) · 311 unmodified lines
312312 return 0;
313313 }
314314
315−static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
315+static int channelmap_filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
316316 {
317317 AVFilterContext *ctx = inlink->dst;
318318 AVFilterLink *outlink = ctx->outputs[0];
@@ -354,7 +354,7 @@ static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *bu · 35 unmodified lines
354354 memcpy(buf->data, buf->extended_data,
355355 FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0]));
356356
357− return ff_filter_samples(outlink, buf);
357+ return ff_filter_frame(outlink, buf);
358358 }
359359
360360 static int channelmap_config_input(AVFilterLink *inlink)
@@ -389,7 +389,7 @@ static const AVFilterPad avfilter_af_channelmap_inputs[] = { · 28 unmodified lines
389389 .name = "default",
390390 .type = AVMEDIA_TYPE_AUDIO,
391391 .min_perms = AV_PERM_READ | AV_PERM_WRITE,
392− .filter_samples = channelmap_filter_samples,
392+ .filter_frame = channelmap_filter_frame,
393393 .config_props = channelmap_config_input
394394 },
395395 { NULL }
libavfilter/af_channelsplit.c+3−3
@@ -105,7 +105,7 @@ static int query_formats(AVFilterContext *ctx) · 104 unmodified lines
105105 return 0;
106106 }
107107
108−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
108+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
109109 {
110110 AVFilterContext *ctx = inlink->dst;
111111 int i, ret = 0;
@@ -122,7 +122,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 10 unmodified lines
122122 buf_out->audio->channel_layout =
123123 av_channel_layout_extract_channel(buf->audio->channel_layout, i);
124124
125− ret = ff_filter_samples(ctx->outputs[i], buf_out);
125+ ret = ff_filter_frame(ctx->outputs[i], buf_out);
126126 if (ret < 0)
127127 break;
128128 }
@@ -134,7 +134,7 @@ static const AVFilterPad avfilter_af_channelsplit_inputs[] = { · 5 unmodified lines
134134 {
135135 .name = "default",
136136 .type = AVMEDIA_TYPE_AUDIO,
137− .filter_samples = filter_samples,
137+ .filter_frame = filter_frame,
138138 },
139139 { NULL }
140140 };
libavfilter/af_earwax.c+3−3
@@ -120,7 +120,7 @@ static inline int16_t *scalarproduct(const int16_t *in, const int16_t *endin, in · 119 unmodified lines
120120 return out;
121121 }
122122
123−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
123+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
124124 {
125125 AVFilterLink *outlink = inlink->dst->outputs[0];
126126 int16_t *taps, *endin, *in, *out;
@@ -148,7 +148,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 21 unmodified lines
148148 // save part of input for next round
149149 memcpy(taps, endin, NUMTAPS * sizeof(*taps));
150150
151− ret = ff_filter_samples(outlink, outsamples);
151+ ret = ff_filter_frame(outlink, outsamples);
152152 avfilter_unref_buffer(insamples);
153153 return ret;
154154 }
@@ -160,7 +160,7 @@ AVFilter avfilter_af_earwax = { · 5 unmodified lines
160160 .priv_size = sizeof(EarwaxContext),
161161 .inputs = (const AVFilterPad[]) {{ .name = "default",
162162 .type = AVMEDIA_TYPE_AUDIO,
163− .filter_samples = filter_samples,
163+ .filter_frame = filter_frame,
164164 .config_props = config_input,
165165 .min_perms = AV_PERM_READ, },
166166 { .name = NULL}},
libavfilter/af_join.c+3−3
@@ -94,7 +94,7 @@ static const AVClass join_class = { · 93 unmodified lines
9494 .version = LIBAVUTIL_VERSION_INT,
9595 };
9696
97−static int filter_samples(AVFilterLink *link, AVFilterBufferRef *buf)
97+static int filter_frame(AVFilterLink *link, AVFilterBufferRef *buf)
9898 {
9999 AVFilterContext *ctx = link->dst;
100100 JoinContext *s = ctx->priv;
@@ -229,7 +229,7 @@ static int join_init(AVFilterContext *ctx, const char *args) · 128 unmodified lines
229229 snprintf(name, sizeof(name), "input%d", i);
230230 pad.type = AVMEDIA_TYPE_AUDIO;
231231 pad.name = av_strdup(name);
232− pad.filter_samples = filter_samples;
232+ pad.filter_frame = filter_frame;
233233
234234 pad.needs_fifo = 1;
235235
@@ -470,7 +470,7 @@ static int join_request_frame(AVFilterLink *outlink) · 234 unmodified lines
470470 priv->nb_in_buffers = ctx->nb_inputs;
471471 buf->buf->priv = priv;
472472
473− ret = ff_filter_samples(outlink, buf);
473+ ret = ff_filter_frame(outlink, buf);
474474
475475 memset(s->input_frames, 0, sizeof(*s->input_frames) * ctx->nb_inputs);
476476
libavfilter/af_pan.c+3−3
@@ -353,7 +353,7 @@ static int config_props(AVFilterLink *link) · 352 unmodified lines
353353 return 0;
354354 }
355355
356−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
356+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
357357 {
358358 int ret;
359359 int n = insamples->audio->nb_samples;
@@ -365,7 +365,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 5 unmodified lines
365365 avfilter_copy_buffer_ref_props(outsamples, insamples);
366366 outsamples->audio->channel_layout = outlink->channel_layout;
367367
368− ret = ff_filter_samples(outlink, outsamples);
368+ ret = ff_filter_frame(outlink, outsamples);
369369 avfilter_unref_buffer(insamples);
370370 return ret;
371371 }
@@ -388,7 +388,7 @@ AVFilter avfilter_af_pan = { · 16 unmodified lines
388388 { .name = "default",
389389 .type = AVMEDIA_TYPE_AUDIO,
390390 .config_props = config_props,
391− .filter_samples = filter_samples,
391+ .filter_frame = filter_frame,
392392 .min_perms = AV_PERM_READ, },
393393 { .name = NULL}
394394 },
libavfilter/af_resample.c+6−6
@@ -40,7 +40,7 @@ typedef struct ResampleContext { · 39 unmodified lines
4040
4141 int64_t next_pts;
4242
43− /* set by filter_samples() to signal an output frame to request_frame() */
43+ /* set by filter_frame() to signal an output frame to request_frame() */
4444 int got_output;
4545 } ResampleContext;
4646
@@ -162,12 +162,12 @@ static int request_frame(AVFilterLink *outlink) · 115 unmodified lines
162162 }
163163
164164 buf->pts = s->next_pts;
165− return ff_filter_samples(outlink, buf);
165+ return ff_filter_frame(outlink, buf);
166166 }
167167 return ret;
168168 }
169169
170−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
170+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
171171 {
172172 AVFilterContext *ctx = inlink->dst;
173173 ResampleContext *s = ctx->priv;
@@ -224,7 +224,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 50 unmodified lines
224224
225225 s->next_pts = buf_out->pts + buf_out->audio->nb_samples;
226226
227− ret = ff_filter_samples(outlink, buf_out);
227+ ret = ff_filter_frame(outlink, buf_out);
228228 s->got_output = 1;
229229 }
230230
@@ -232,7 +232,7 @@ fail: · 1 unmodified line
232232 avfilter_unref_buffer(buf);
233233 } else {
234234 buf->format = outlink->format;
235− ret = ff_filter_samples(outlink, buf);
235+ ret = ff_filter_frame(outlink, buf);
236236 s->got_output = 1;
237237 }
238238
@@ -243,7 +243,7 @@ static const AVFilterPad avfilter_af_resample_inputs[] = { · 4 unmodified lines
243243 {
244244 .name = "default",
245245 .type = AVMEDIA_TYPE_AUDIO,
246− .filter_samples = filter_samples,
246+ .filter_frame = filter_frame,
247247 .min_perms = AV_PERM_READ
248248 },
249249 { NULL }
libavfilter/af_silencedetect.c+3−3
@@ -84,7 +84,7 @@ static char *get_metadata_val(AVFilterBufferRef *insamples, const char *key) · 83 unmodified lines
8484 return e && e->value ? e->value : NULL;
8585 }
8686
87−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
87+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
8888 {
8989 int i;
9090 SilenceDetectContext *silence = inlink->dst->priv;
@@ -132,7 +132,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 41 unmodified lines
132132 }
133133 }
134134
135− return ff_filter_samples(inlink->dst->outputs[0], insamples);
135+ return ff_filter_frame(inlink->dst->outputs[0], insamples);
136136 }
137137
138138 static int query_formats(AVFilterContext *ctx)
@@ -173,7 +173,7 @@ AVFilter avfilter_af_silencedetect = { · 34 unmodified lines
173173 { .name = "default",
174174 .type = AVMEDIA_TYPE_AUDIO,
175175 .get_audio_buffer = ff_null_get_audio_buffer,
176− .filter_samples = filter_samples, },
176+ .filter_frame = filter_frame, },
177177 { .name = NULL }
178178 },
179179 .outputs = (const AVFilterPad[]) {
libavfilter/af_volume.c+3−3
@@ -110,7 +110,7 @@ static int query_formats(AVFilterContext *ctx) · 109 unmodified lines
110110 return 0;
111111 }
112112
113−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
113+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
114114 {
115115 VolumeContext *vol = inlink->dst->priv;
116116 AVFilterLink *outlink = inlink->dst->outputs[0];
@@ -169,7 +169,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 52 unmodified lines
169169 }
170170 }
171171 }
172− return ff_filter_samples(outlink, insamples);
172+ return ff_filter_frame(outlink, insamples);
173173 }
174174
175175 AVFilter avfilter_af_volume = {
@@ -181,7 +181,7 @@ AVFilter avfilter_af_volume = { · 5 unmodified lines
181181
182182 .inputs = (const AVFilterPad[]) {{ .name = "default",
183183 .type = AVMEDIA_TYPE_AUDIO,
184− .filter_samples = filter_samples,
184+ .filter_frame = filter_frame,
185185 .min_perms = AV_PERM_READ|AV_PERM_WRITE},
186186 { .name = NULL}},
187187
libavfilter/af_volumedetect.c+3−3
@@ -49,7 +49,7 @@ static int query_formats(AVFilterContext *ctx) · 48 unmodified lines
4949 return 0;
5050 }
5151
52−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samples)
52+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samples)
5353 {
5454 AVFilterContext *ctx = inlink->dst;
5555 VolDetectContext *vd = ctx->priv;
@@ -70,7 +70,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samples) · 14 unmodified lines
7070 vd->histogram[pcm[i] + 0x8000]++;
7171 }
7272
73− return ff_filter_samples(inlink->dst->outputs[0], samples);
73+ return ff_filter_frame(inlink->dst->outputs[0], samples);
7474 }
7575
7676 #define MAX_DB 91
@@ -143,7 +143,7 @@ AVFilter avfilter_af_volumedetect = { · 66 unmodified lines
143143 { .name = "default",
144144 .type = AVMEDIA_TYPE_AUDIO,
145145 .get_audio_buffer = ff_null_get_audio_buffer,
146− .filter_samples = filter_samples,
146+ .filter_frame = filter_frame,
147147 .min_perms = AV_PERM_READ, },
148148 { .name = NULL }
149149 },
libavfilter/asink_anullsink.c+2−2
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 #include "avfilter.h"
2323 #include "internal.h"
2424
25−static int null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
25+static int null_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref)
2626 {
2727 avfilter_unref_bufferp(&samplesref);
2828 return 0;
@@ -32,7 +32,7 @@ static const AVFilterPad avfilter_asink_anullsink_inputs[] = { · 3 unmodified lines
3232 {
3333 .name = "default",
3434 .type = AVMEDIA_TYPE_AUDIO,
35− .filter_samples = null_filter_samples,
35+ .filter_frame = null_filter_frame,
3636 },
3737 { NULL },
3838 };
libavfilter/asrc_aevalsrc.c+1−1
@@ -237,7 +237,7 @@ static int request_frame(AVFilterLink *outlink) · 236 unmodified lines
237237 samplesref->audio->sample_rate = eval->sample_rate;
238238 eval->pts += eval->nb_samples;
239239
240− ff_filter_samples(outlink, samplesref);
240+ ff_filter_frame(outlink, samplesref);
241241
242242 return 0;
243243 }
libavfilter/asrc_anullsrc.c+1−1
@@ -111,7 +111,7 @@ static int request_frame(AVFilterLink *outlink) · 110 unmodified lines
111111 samplesref->audio->channel_layout = null->channel_layout;
112112 samplesref->audio->sample_rate = outlink->sample_rate;
113113
114− ff_filter_samples(outlink, avfilter_ref_buffer(samplesref, ~0));
114+ ff_filter_frame(outlink, avfilter_ref_buffer(samplesref, ~0));
115115 avfilter_unref_buffer(samplesref);
116116
117117 null->pts += null->nb_samples;
libavfilter/asrc_flite.c+1−1
@@ -265,7 +265,7 @@ static int request_frame(AVFilterLink *outlink) · 264 unmodified lines
265265 flite->wave_samples += nb_samples * flite->wave->num_channels;
266266 flite->wave_nb_samples -= nb_samples;
267267
268− return ff_filter_samples(outlink, samplesref);
268+ return ff_filter_frame(outlink, samplesref);
269269 }
270270
271271 AVFilter avfilter_asrc_flite = {
libavfilter/audio.c+11−11
@@ -157,30 +157,30 @@ fail: · 156 unmodified lines
157157 return NULL;
158158 }
159159
160−static int default_filter_samples(AVFilterLink *link,
160+static int default_filter_frame(AVFilterLink *link,
161161 AVFilterBufferRef *samplesref)
162162 {
163− return ff_filter_samples(link->dst->outputs[0], samplesref);
163+ return ff_filter_frame(link->dst->outputs[0], samplesref);
164164 }
165165
166−int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref)
166+int ff_filter_frame_framed(AVFilterLink *link, AVFilterBufferRef *samplesref)
167167 {
168− int (*filter_samples)(AVFilterLink *, AVFilterBufferRef *);
168+ int (*filter_frame)(AVFilterLink *, AVFilterBufferRef *);
169169 AVFilterPad *src = link->srcpad;
170170 AVFilterPad *dst = link->dstpad;
171171 int64_t pts;
172172 AVFilterBufferRef *buf_out;
173173 int ret;
174174
175− FF_TPRINTF_START(NULL, filter_samples); ff_tlog_link(NULL, link, 1);
175+ FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1);
176176
177177 if (link->closed) {
178178 avfilter_unref_buffer(samplesref);
179179 return AVERROR_EOF;
180180 }
181181
182− if (!(filter_samples = dst->filter_samples))
183− filter_samples = default_filter_samples;
182+ if (!(filter_frame = dst->filter_frame))
183+ filter_frame = default_filter_frame;
184184
185185 av_assert1((samplesref->perms & src->min_perms) == src->min_perms);
186186 samplesref->perms &= ~ src->rej_perms;
@@ -213,12 +213,12 @@ int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref) · 26 unmodified lines
213213
214214 link->cur_buf = buf_out;
215215 pts = buf_out->pts;
216− ret = filter_samples(link, buf_out);
216+ ret = filter_frame(link, buf_out);
217217 ff_update_link_current_pts(link, pts);
218218 return ret;
219219 }
220220
221−int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
221+int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref)
222222 {
223223 int insamples = samplesref->audio->nb_samples, inpos = 0, nb_samples;
224224 AVFilterBufferRef *pbuf = link->partial_buf;
@@ -232,7 +232,7 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 7 unmodified lines
232232 if (!link->min_samples ||
233233 (!pbuf &&
234234 insamples >= link->min_samples && insamples <= link->max_samples)) {
235− return ff_filter_samples_framed(link, samplesref);
235+ return ff_filter_frame_framed(link, samplesref);
236236 }
237237 /* Handle framing (min_samples, max_samples) */
238238 while (insamples) {
@@ -259,7 +259,7 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 20 unmodified lines
259259 insamples -= nb_samples;
260260 pbuf->audio->nb_samples += nb_samples;
261261 if (pbuf->audio->nb_samples >= link->min_samples) {
262− ret = ff_filter_samples_framed(link, pbuf);
262+ ret = ff_filter_frame_framed(link, pbuf);
263263 pbuf = NULL;
264264 }
265265 }
libavfilter/audio.h+2−2
@@ -74,13 +74,13 @@ AVFilterBufferRef *ff_get_audio_buffer(AVFilterLink *link, int perms, · 73 unmodified lines
7474 * @return >= 0 on success, a negative AVERROR on error. The receiving filter
7575 * is responsible for unreferencing samplesref in case of error.
7676 */
77−int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
77+int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref);
7878
7979 /**
8080 * Send a buffer of audio samples to the next link, without checking
8181 * min_samples.
8282 */
83−int ff_filter_samples_framed(AVFilterLink *link,
83+int ff_filter_frame_framed(AVFilterLink *link,
8484 AVFilterBufferRef *samplesref);
8585
8686 #endif /* AVFILTER_AUDIO_H */
libavfilter/avf_concat.c+4−4
@@ -185,7 +185,7 @@ static void push_frame(AVFilterContext *ctx, unsigned in_no, · 184 unmodified lines
185185 ff_end_frame(outlink);
186186 break;
187187 case AVMEDIA_TYPE_AUDIO:
188− ff_filter_samples(outlink, buf);
188+ ff_filter_frame(outlink, buf);
189189 break;
190190 }
191191 }
@@ -244,7 +244,7 @@ static int end_frame(AVFilterLink *inlink) · 52 unmodified lines
244244 return 0;
245245 }
246246
247−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf)
247+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf)
248248 {
249249 process_frame(inlink, buf);
250250 return 0; /* enhancement: handle error return */
@@ -297,7 +297,7 @@ static void send_silence(AVFilterContext *ctx, unsigned in_no, unsigned out_no) · 46 unmodified lines
297297 av_samples_set_silence(buf->extended_data, 0, frame_nb_samples,
298298 nb_channels, outlink->format);
299299 buf->pts = base_pts + av_rescale_q(sent, rate_tb, outlink->time_base);
300− ff_filter_samples(outlink, buf);
300+ ff_filter_frame(outlink, buf);
301301 sent += frame_nb_samples;
302302 nb_samples -= frame_nb_samples;
303303 }
@@ -397,7 +397,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 93 unmodified lines
397397 pad.draw_slice = draw_slice;
398398 pad.end_frame = end_frame;
399399 } else {
400− pad.filter_samples = filter_samples;
400+ pad.filter_frame = filter_frame;
401401 }
402402 ff_insert_inpad(ctx, ctx->nb_inputs, &pad);
403403 }
libavfilter/avf_showspectrum.c+2−2
@@ -281,7 +281,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFilterBufferRef *insampl · 280 unmodified lines
281281 return add_samples;
282282 }
283283
284−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
284+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
285285 {
286286 AVFilterContext *ctx = inlink->dst;
287287 ShowSpectrumContext *showspectrum = ctx->priv;
@@ -310,7 +310,7 @@ AVFilter avfilter_avf_showspectrum = { · 22 unmodified lines
310310 {
311311 .name = "default",
312312 .type = AVMEDIA_TYPE_AUDIO,
313− .filter_samples = filter_samples,
313+ .filter_frame = filter_frame,
314314 .min_perms = AV_PERM_READ,
315315 },
316316 { .name = NULL }
libavfilter/avf_showwaves.c+2−2
@@ -179,7 +179,7 @@ static int request_frame(AVFilterLink *outlink) · 178 unmodified lines
179179
180180 #define MAX_INT16 ((1<<15) -1)
181181
182−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
182+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
183183 {
184184 AVFilterContext *ctx = inlink->dst;
185185 AVFilterLink *outlink = ctx->outputs[0];
@@ -240,7 +240,7 @@ AVFilter avfilter_avf_showwaves = { · 54 unmodified lines
240240 {
241241 .name = "default",
242242 .type = AVMEDIA_TYPE_AUDIO,
243− .filter_samples = filter_samples,
243+ .filter_frame = filter_frame,
244244 .min_perms = AV_PERM_READ,
245245 },
246246 { .name = NULL }
libavfilter/avfilter.c+1−1
@@ -343,7 +343,7 @@ int ff_request_frame(AVFilterLink *link) · 342 unmodified lines
343343 if (ret == AVERROR_EOF && link->partial_buf) {
344344 AVFilterBufferRef *pbuf = link->partial_buf;
345345 link->partial_buf = NULL;
346− ff_filter_samples_framed(link, pbuf);
346+ ff_filter_frame_framed(link, pbuf);
347347 return 0;
348348 }
349349 if (ret == AVERROR_EOF)
libavfilter/avfilter.h+4−4
@@ -339,7 +339,7 @@ struct AVFilterPad { · 338 unmodified lines
339339 * must ensure that samplesref is properly unreferenced on error if it
340340 * hasn't been passed on to another filter.
341341 */
342− int (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref);
342+ int (*filter_frame)(AVFilterLink *link, AVFilterBufferRef *samplesref);
343343
344344 /**
345345 * Frame poll callback. This returns the number of immediately available
@@ -678,7 +678,7 @@ struct AVFilterLink { · 332 unmodified lines
678678 int partial_buf_size;
679679
680680 /**
681− * Minimum number of samples to filter at once. If filter_samples() is
681+ * Minimum number of samples to filter at once. If filter_frame() is
682682 * called with fewer samples, it will accumulate them in partial_buf.
683683 * This field and the related ones must not be changed after filtering
684684 * has started.
@@ -687,7 +687,7 @@ struct AVFilterLink { · 2 unmodified lines
687687 int min_samples;
688688
689689 /**
690− * Maximum number of samples to filter at once. If filter_samples() is
690+ * Maximum number of samples to filter at once. If filter_frame() is
691691 * called with more samples, it will split them.
692692 */
693693 int max_samples;
@@ -703,7 +703,7 @@ struct AVFilterLink { · 9 unmodified lines
703703
704704 /**
705705 * True if the link is closed.
706− * If set, all attemps of start_frame, filter_samples or request_frame
706+ * If set, all attemps of start_frame, filter_frame or request_frame
707707 * will fail with AVERROR_EOF, and if necessary the reference will be
708708 * destroyed.
709709 * If request_frame returns AVERROR_EOF, this flag is set on the
libavfilter/buffersink.c+1−1
@@ -169,7 +169,7 @@ static const AVFilterPad avfilter_asink_abuffer_inputs[] = { · 168 unmodified lines
169169 {
170170 .name = "default",
171171 .type = AVMEDIA_TYPE_AUDIO,
172− .filter_samples = start_frame,
172+ .filter_frame = start_frame,
173173 .min_perms = AV_PERM_READ,
174174 .needs_fifo = 1
175175 },
libavfilter/buffersrc.c+1−1
@@ -379,7 +379,7 @@ static int request_frame(AVFilterLink *link) · 378 unmodified lines
379379 return ret;
380380 break;
381381 case AVMEDIA_TYPE_AUDIO:
382− ret = ff_filter_samples(link, buf);
382+ ret = ff_filter_frame(link, buf);
383383 break;
384384 default:
385385 avfilter_unref_bufferp(&buf);
libavfilter/f_ebur128.c+3−3
@@ -436,7 +436,7 @@ static int gate_update(struct integrator *integ, double power, · 435 unmodified lines
436436 return gate_hist_pos;
437437 }
438438
439−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
439+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
440440 {
441441 int i, ch;
442442 AVFilterContext *ctx = inlink->dst;
@@ -638,7 +638,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 195 unmodified lines
638638 }
639639 }
640640
641− return ff_filter_samples(ctx->outputs[ebur128->do_video], insamples);
641+ return ff_filter_frame(ctx->outputs[ebur128->do_video], insamples);
642642 }
643643
644644 static int query_formats(AVFilterContext *ctx)
@@ -740,7 +740,7 @@ AVFilter avfilter_af_ebur128 = { · 95 unmodified lines
740740 { .name = "default",
741741 .type = AVMEDIA_TYPE_AUDIO,
742742 .get_audio_buffer = ff_null_get_audio_buffer,
743− .filter_samples = filter_samples, },
743+ .filter_frame = filter_frame, },
744744 { .name = NULL }
745745 },
746746 .outputs = NULL,
libavfilter/f_sendcmd.c+2−2
@@ -511,7 +511,7 @@ end: · 510 unmodified lines
511511
512512 switch (inlink->type) {
513513 case AVMEDIA_TYPE_VIDEO: return ff_start_frame (inlink->dst->outputs[0], ref);
514− case AVMEDIA_TYPE_AUDIO: return ff_filter_samples(inlink->dst->outputs[0], ref);
514+ case AVMEDIA_TYPE_AUDIO: return ff_filter_frame(inlink->dst->outputs[0], ref);
515515 }
516516 return AVERROR(ENOSYS);
517517 }
@@ -562,7 +562,7 @@ AVFilter avfilter_af_asendcmd = { · 44 unmodified lines
562562 .name = "default",
563563 .type = AVMEDIA_TYPE_AUDIO,
564564 .get_audio_buffer = ff_null_get_audio_buffer,
565− .filter_samples = process_frame,
565+ .filter_frame = process_frame,
566566 },
567567 { .name = NULL }
568568 },
libavfilter/f_setpts.c+2−2
@@ -174,7 +174,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 173 unmodified lines
174174 setpts->var_values[VAR_N] += 1.0;
175175 if (setpts->type == AVMEDIA_TYPE_AUDIO) {
176176 setpts->var_values[VAR_NB_CONSUMED_SAMPLES] += inpicref->audio->nb_samples;
177− return ff_filter_samples(inlink->dst->outputs[0], outpicref);
177+ return ff_filter_frame(inlink->dst->outputs[0], outpicref);
178178 } else
179179 return ff_start_frame (inlink->dst->outputs[0], outpicref);
180180 }
@@ -201,7 +201,7 @@ AVFilter avfilter_af_asetpts = { · 20 unmodified lines
201201 .type = AVMEDIA_TYPE_AUDIO,
202202 .get_audio_buffer = ff_null_get_audio_buffer,
203203 .config_props = config_input,
204− .filter_samples = filter_frame,
204+ .filter_frame = filter_frame,
205205 },
206206 { .name = NULL }
207207 },
libavfilter/f_settb.c+3−3
@@ -120,7 +120,7 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 119 unmodified lines
120120 return ff_start_frame(outlink, picref);
121121 }
122122
123−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
123+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
124124 {
125125 AVFilterContext *ctx = inlink->dst;
126126 AVFilterLink *outlink = ctx->outputs[0];
@@ -133,7 +133,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) · 6 unmodified lines
133133 outlink->time_base.num, outlink->time_base.den, samplesref->pts);
134134 }
135135
136− return ff_filter_samples(outlink, samplesref);
136+ return ff_filter_frame(outlink, samplesref);
137137 }
138138
139139 #if CONFIG_SETTB_FILTER
@@ -181,7 +181,7 @@ AVFilter avfilter_af_asettb = { · 41 unmodified lines
181181 { .name = "default",
182182 .type = AVMEDIA_TYPE_AUDIO,
183183 .get_audio_buffer = ff_null_get_audio_buffer,
184− .filter_samples = filter_samples, },
184+ .filter_frame = filter_frame, },
185185 { .name = NULL }
186186 },
187187 .outputs = (const AVFilterPad[]) {
libavfilter/fifo.c+3−3
@@ -228,7 +228,7 @@ static int return_audio_frame(AVFilterContext *ctx) · 227 unmodified lines
228228 buf_out = s->buf_out;
229229 s->buf_out = NULL;
230230 }
231− return ff_filter_samples(link, buf_out);
231+ return ff_filter_frame(link, buf_out);
232232 }
233233
234234 static int request_frame(AVFilterLink *outlink)
@@ -257,7 +257,7 @@ static int request_frame(AVFilterLink *outlink) · 22 unmodified lines
257257 if (outlink->request_samples) {
258258 return return_audio_frame(outlink->src);
259259 } else {
260− ret = ff_filter_samples(outlink, fifo->root.next->buf);
260+ ret = ff_filter_frame(outlink, fifo->root.next->buf);
261261 queue_pop(fifo);
262262 }
263263 break;
@@ -308,7 +308,7 @@ static const AVFilterPad avfilter_af_afifo_inputs[] = { · 44 unmodified lines
308308 .name = "default",
309309 .type = AVMEDIA_TYPE_AUDIO,
310310 .get_audio_buffer = ff_null_get_audio_buffer,
311− .filter_samples = add_to_queue,
311+ .filter_frame = add_to_queue,
312312 .min_perms = AV_PERM_PRESERVE,
313313 },
314314 { NULL }
libavfilter/internal.h+1−1
@@ -147,7 +147,7 @@ struct AVFilterPad { · 146 unmodified lines
147147 * must ensure that samplesref is properly unreferenced on error if it
148148 * hasn't been passed on to another filter.
149149 */
150− int (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref);
150+ int (*filter_frame)(AVFilterLink *link, AVFilterBufferRef *samplesref);
151151
152152 /**
153153 * Frame poll callback. This returns the number of immediately available
libavfilter/sink_buffer.c+11−11
@@ -268,7 +268,7 @@ AVFilter avfilter_vsink_buffersink = { · 267 unmodified lines
268268 .outputs = (const AVFilterPad[]) {{ .name = NULL }},
269269 };
270270
271−static int filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
271+static int filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref)
272272 {
273273 end_frame(link);
274274 return 0;
@@ -338,7 +338,7 @@ AVFilter avfilter_asink_ffabuffersink = { · 63 unmodified lines
338338
339339 .inputs = (const AVFilterPad[]) {{ .name = "default",
340340 .type = AVMEDIA_TYPE_AUDIO,
341− .filter_samples = filter_samples,
341+ .filter_frame = filter_frame,
342342 .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, },
343343 { .name = NULL }},
344344 .outputs = (const AVFilterPad[]) {{ .name = NULL }},
@@ -354,7 +354,7 @@ AVFilter avfilter_asink_abuffersink = { · 9 unmodified lines
354354
355355 .inputs = (const AVFilterPad[]) {{ .name = "default",
356356 .type = AVMEDIA_TYPE_AUDIO,
357− .filter_samples = filter_samples,
357+ .filter_frame = filter_frame,
358358 .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, },
359359 { .name = NULL }},
360360 .outputs = (const AVFilterPad[]) {{ .name = NULL }},
@@ -372,13 +372,13 @@ int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf) · 11 unmodified lines
372372
373373 if (ctx->filter-> inputs[0].start_frame ==
374374 avfilter_vsink_buffer. inputs[0].start_frame ||
375− ctx->filter-> inputs[0].filter_samples ==
376− avfilter_asink_abuffer.inputs[0].filter_samples)
375+ ctx->filter-> inputs[0].filter_frame ==
376+ avfilter_asink_abuffer.inputs[0].filter_frame)
377377 return ff_buffersink_read_compat(ctx, buf);
378378 av_assert0(ctx->filter-> inputs[0].end_frame ==
379379 avfilter_vsink_ffbuffersink. inputs[0].end_frame ||
380− ctx->filter-> inputs[0].filter_samples ==
381− avfilter_asink_ffabuffersink.inputs[0].filter_samples);
380+ ctx->filter-> inputs[0].filter_frame ==
381+ avfilter_asink_ffabuffersink.inputs[0].filter_frame);
382382
383383 ret = av_buffersink_get_buffer_ref(ctx, &tbuf,
384384 buf ? 0 : AV_BUFFERSINK_FLAG_PEEK);
@@ -399,11 +399,11 @@ int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf, · 14 unmodified lines
399399 AVFilterLink *link = ctx->inputs[0];
400400 int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
401401
402− if (ctx->filter-> inputs[0].filter_samples ==
403− avfilter_asink_abuffer.inputs[0].filter_samples)
402+ if (ctx->filter-> inputs[0].filter_frame ==
403+ avfilter_asink_abuffer.inputs[0].filter_frame)
404404 return ff_buffersink_read_samples_compat(ctx, buf, nb_samples);
405− av_assert0(ctx->filter-> inputs[0].filter_samples ==
406− avfilter_asink_ffabuffersink.inputs[0].filter_samples);
405+ av_assert0(ctx->filter-> inputs[0].filter_frame ==
406+ avfilter_asink_ffabuffersink.inputs[0].filter_frame);
407407
408408 tbuf = ff_get_audio_buffer(link, AV_PERM_WRITE, nb_samples);
409409 if (!tbuf)
libavfilter/split.c+3−3
@@ -142,7 +142,7 @@ AVFilter avfilter_vf_split = { · 141 unmodified lines
142142 .outputs = NULL,
143143 };
144144
145−static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
145+static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
146146 {
147147 AVFilterContext *ctx = inlink->dst;
148148 int i, ret = 0;
@@ -155,7 +155,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) · 6 unmodified lines
155155 break;
156156 }
157157
158− ret = ff_filter_samples(inlink->dst->outputs[i], buf_out);
158+ ret = ff_filter_frame(inlink->dst->outputs[i], buf_out);
159159 if (ret < 0)
160160 break;
161161 }
@@ -168,7 +168,7 @@ static const AVFilterPad avfilter_af_asplit_inputs[] = { · 6 unmodified lines
168168 .name = "default",
169169 .type = AVMEDIA_TYPE_AUDIO,
170170 .get_audio_buffer = ff_null_get_audio_buffer,
171− .filter_samples = filter_samples
171+ .filter_frame = filter_frame
172172 },
173173 { NULL }
174174 };
libavfilter/src_movie.c+1−1
@@ -577,7 +577,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id) · 576 unmodified lines
577577 ff_end_frame(outlink);
578578 break;
579579 case AVMEDIA_TYPE_AUDIO:
580− ff_filter_samples(outlink, buf);
580+ ff_filter_frame(outlink, buf);
581581 break;
582582 }
583583

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t