Based on patch by Anton Khirnov Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Unified · Split
| @@ -52,7 +52,7 @@ Buffer references ownership and permissions · 51 unmodified lines | |||
| 52 | point to only a part of a video buffer. | 52 | point to only a part of a video buffer. |
| 53 | 53 | ||
| 54 | A reference is usually obtained as input to the start_frame or | 54 | 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 |
| 56 | ff_get_audio_buffer functions. A new reference on an existing buffer can | 56 | ff_get_audio_buffer functions. A new reference on an existing buffer can |
| 57 | be created with the avfilter_ref_buffer. A reference is destroyed using | 57 | be created with the avfilter_ref_buffer. A reference is destroyed using |
| 58 | the avfilter_unref_bufferp function. | 58 | the avfilter_unref_bufferp function. |
| @@ -68,14 +68,14 @@ Buffer references ownership and permissions · 9 unmodified lines | |||
| 68 | 68 | ||
| 69 | Here are the (fairly obvious) rules for reference ownership: | 69 | Here are the (fairly obvious) rules for reference ownership: |
| 70 | 70 | ||
| 71 | * A reference received by the start_frame or filter_samples method | 71 | * A reference received by the start_frame or filter_frame method |
| 72 | belong to the corresponding filter. | 72 | belong to the corresponding filter. |
| 73 | 73 | ||
| 74 | Special exception: for video references: the reference may be used | 74 | Special exception: for video references: the reference may be used |
| 75 | internally for automatic copying and must not be destroyed before | 75 | internally for automatic copying and must not be destroyed before |
| 76 | end_frame; it can be given away to ff_start_frame. | 76 | end_frame; it can be given away to ff_start_frame. |
| 77 | 77 | ||
| 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 |
| 79 | away and must no longer be used. | 79 | away and must no longer be used. |
| 80 | 80 | ||
| 81 | * A reference created with avfilter_ref_buffer belongs to the code that | 81 | * A reference created with avfilter_ref_buffer belongs to the code that |
| @@ -93,16 +93,16 @@ Buffer references ownership and permissions · 11 unmodified lines | |||
| 93 | The AVFilterLink structure has a few AVFilterBufferRef fields. Here are | 93 | The AVFilterLink structure has a few AVFilterBufferRef fields. Here are |
| 94 | the rules to handle them: | 94 | the rules to handle them: |
| 95 | 95 | ||
| 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 |
| 97 | the same reference given as argument to the methods and belongs to the | 97 | the same reference given as argument to the methods and belongs to the |
| 98 | destination filter of the link. If it has not been cleared after | 98 | 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 |
| 100 | the reference; therefore, any filter that needs to keep the reference | 100 | the reference; therefore, any filter that needs to keep the reference |
| 101 | for longer must set cur_buf to NULL. | 101 | for longer must set cur_buf to NULL. |
| 102 | 102 | ||
| 103 | * out_buf belongs to the source filter of the link and can be used to | 103 | * out_buf belongs to the source filter of the link and can be used to |
| 104 | store a reference to the buffer that has been sent to the destination. | 104 | 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 |
| 106 | automatically destroy the reference. | 106 | automatically destroy the reference. |
| 107 | 107 | ||
| 108 | If a video input pad does not have a start_frame method, the default | 108 | 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 | |||
| 179 | with the WRITE permission. | 179 | with the WRITE permission. |
| 180 | 180 | ||
| 181 | * Filters that intend to keep a reference after the filtering process | 181 | * 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 |
| 183 | PRESERVE permission on it and remove the WRITE permission if they | 183 | PRESERVE permission on it and remove the WRITE permission if they |
| 184 | create a new reference to give it away. | 184 | create a new reference to give it away. |
| 185 | 185 | ||
| @@ -198,7 +198,7 @@ Frame scheduling · 12 unmodified lines | |||
| 198 | Simple filters that output one frame for each input frame should not have | 198 | Simple filters that output one frame for each input frame should not have |
| 199 | to worry about it. | 199 | to worry about it. |
| 200 | 200 | ||
| 201 | start_frame / filter_samples | 201 | start_frame / filter_frame |
| 202 | ---------------------------- | 202 | ---------------------------- |
| 203 | 203 | ||
| 204 | These methods are called when a frame is pushed to the filter's input. | 204 | These methods are called when a frame is pushed to the filter's input. |
| @@ -233,7 +233,7 @@ Frame scheduling · 28 unmodified lines | |||
| 233 | 233 | ||
| 234 | This method is called when a frame is wanted on an output. | 234 | This method is called when a frame is wanted on an output. |
| 235 | 235 | ||
| 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 |
| 237 | the corresponding output. | 237 | the corresponding output. |
| 238 | 238 | ||
| 239 | For a filter, if there are queued frames already ready, one of these | 239 | For a filter, if there are queued frames already ready, one of these |
| @@ -266,4 +266,4 @@ Frame scheduling · 26 unmodified lines | |||
| 266 | 266 | ||
| 267 | Note that, except for filters that can have queued frames, request_frame | 267 | Note that, except for filters that can have queued frames, request_frame |
| 268 | does not push frames: it requests them to its input, and as a reaction, | 268 | 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. |
| @@ -135,7 +135,7 @@ static int config_output(AVFilterLink *outlink) · 134 unmodified lines | |||
| 135 | return 0; | 135 | return 0; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) | 138 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) |
| 139 | { | 139 | { |
| 140 | AConvertContext *aconvert = inlink->dst->priv; | 140 | AConvertContext *aconvert = inlink->dst->priv; |
| 141 | const int n = insamplesref->audio->nb_samples; | 141 | const int n = insamplesref->audio->nb_samples; |
| @@ -149,7 +149,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref · 7 unmodified lines | |||
| 149 | avfilter_copy_buffer_ref_props(outsamplesref, insamplesref); | 149 | avfilter_copy_buffer_ref_props(outsamplesref, insamplesref); |
| 150 | outsamplesref->audio->channel_layout = outlink->channel_layout; | 150 | outsamplesref->audio->channel_layout = outlink->channel_layout; |
| 151 | 151 | ||
| 152 | ret = ff_filter_samples(outlink, outsamplesref); | 152 | ret = ff_filter_frame(outlink, outsamplesref); |
| 153 | avfilter_unref_buffer(insamplesref); | 153 | avfilter_unref_buffer(insamplesref); |
| 154 | return ret; | 154 | return ret; |
| 155 | } | 155 | } |
| @@ -164,7 +164,7 @@ AVFilter avfilter_af_aconvert = { · 8 unmodified lines | |||
| 164 | 164 | ||
| 165 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 165 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 166 | .type = AVMEDIA_TYPE_AUDIO, | 166 | .type = AVMEDIA_TYPE_AUDIO, |
| 167 | .filter_samples = filter_samples, | 167 | .filter_frame = filter_frame, |
| 168 | .min_perms = AV_PERM_READ, }, | 168 | .min_perms = AV_PERM_READ, }, |
| 169 | { .name = NULL}}, | 169 | { .name = NULL}}, |
| 170 | .outputs = (const AVFilterPad[]) {{ .name = "default", | 170 | .outputs = (const AVFilterPad[]) {{ .name = "default", |
| @@ -217,7 +217,7 @@ static inline void copy_samples(int nb_inputs, struct amerge_input in[], · 216 unmodified lines | |||
| 217 | } | 217 | } |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 220 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 221 | { | 221 | { |
| 222 | AVFilterContext *ctx = inlink->dst; | 222 | AVFilterContext *ctx = inlink->dst; |
| 223 | AMergeContext *am = ctx->priv; | 223 | AMergeContext *am = ctx->priv; |
| @@ -290,7 +290,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 66 unmodified lines | |||
| 290 | } | 290 | } |
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| 293 | return ff_filter_samples(ctx->outputs[0], outbuf); | 293 | return ff_filter_frame(ctx->outputs[0], outbuf); |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | static av_cold int init(AVFilterContext *ctx, const char *args) | 296 | 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 | |||
| 313 | AVFilterPad pad = { | 313 | AVFilterPad pad = { |
| 314 | .name = name, | 314 | .name = name, |
| 315 | .type = AVMEDIA_TYPE_AUDIO, | 315 | .type = AVMEDIA_TYPE_AUDIO, |
| 316 | .filter_samples = filter_samples, | 316 | .filter_frame = filter_frame, |
| 317 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, | 317 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, |
| 318 | }; | 318 | }; |
| 319 | if (!name) | 319 | if (!name) |
| @@ -309,7 +309,7 @@ static int output_frame(AVFilterLink *outlink, int nb_samples) · 308 unmodified lines | |||
| 309 | if (s->next_pts != AV_NOPTS_VALUE) | 309 | if (s->next_pts != AV_NOPTS_VALUE) |
| 310 | s->next_pts += nb_samples; | 310 | s->next_pts += nb_samples; |
| 311 | 311 | ||
| 312 | return ff_filter_samples(outlink, out_buf); | 312 | return ff_filter_frame(outlink, out_buf); |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | /** | 315 | /** |
| @@ -450,7 +450,7 @@ static int request_frame(AVFilterLink *outlink) · 134 unmodified lines | |||
| 450 | return output_frame(outlink, available_samples); | 450 | return output_frame(outlink, available_samples); |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 453 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 454 | { | 454 | { |
| 455 | AVFilterContext *ctx = inlink->dst; | 455 | AVFilterContext *ctx = inlink->dst; |
| 456 | MixContext *s = ctx->priv; | 456 | MixContext *s = ctx->priv; |
| @@ -502,7 +502,7 @@ static int init(AVFilterContext *ctx, const char *args) · 45 unmodified lines | |||
| 502 | snprintf(name, sizeof(name), "input%d", i); | 502 | snprintf(name, sizeof(name), "input%d", i); |
| 503 | pad.type = AVMEDIA_TYPE_AUDIO; | 503 | pad.type = AVMEDIA_TYPE_AUDIO; |
| 504 | pad.name = av_strdup(name); | 504 | pad.name = av_strdup(name); |
| 505 | pad.filter_samples = filter_samples; | 505 | pad.filter_frame = filter_frame; |
| 506 | 506 | ||
| 507 | ff_insert_inpad(ctx, i, &pad); | 507 | ff_insert_inpad(ctx, i, &pad); |
| 508 | } | 508 | } |
| @@ -170,7 +170,7 @@ static int config_output(AVFilterLink *outlink) · 169 unmodified lines | |||
| 170 | return 0; | 170 | return 0; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) | 173 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) |
| 174 | { | 174 | { |
| 175 | AResampleContext *aresample = inlink->dst->priv; | 175 | AResampleContext *aresample = inlink->dst->priv; |
| 176 | const int n_in = insamplesref->audio->nb_samples; | 176 | const int n_in = insamplesref->audio->nb_samples; |
| @@ -205,7 +205,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) · 28 unmodified lines | |||
| 205 | 205 | ||
| 206 | outsamplesref->audio->nb_samples = n_out; | 206 | outsamplesref->audio->nb_samples = n_out; |
| 207 | 207 | ||
| 208 | ret = ff_filter_samples(outlink, outsamplesref); | 208 | ret = ff_filter_frame(outlink, outsamplesref); |
| 209 | aresample->req_fullfilled= 1; | 209 | aresample->req_fullfilled= 1; |
| 210 | avfilter_unref_buffer(insamplesref); | 210 | avfilter_unref_buffer(insamplesref); |
| 211 | return ret; | 211 | return ret; |
| @@ -247,7 +247,7 @@ static int request_frame(AVFilterLink *outlink) · 35 unmodified lines | |||
| 247 | outsamplesref->pts = ROUNDED_DIV(outsamplesref->pts, inlink->sample_rate); | 247 | outsamplesref->pts = ROUNDED_DIV(outsamplesref->pts, inlink->sample_rate); |
| 248 | #endif | 248 | #endif |
| 249 | 249 | ||
| 250 | ff_filter_samples(outlink, outsamplesref); | 250 | ff_filter_frame(outlink, outsamplesref); |
| 251 | return 0; | 251 | return 0; |
| 252 | } | 252 | } |
| 253 | return ret; | 253 | return ret; |
| @@ -263,7 +263,7 @@ AVFilter avfilter_af_aresample = { · 9 unmodified lines | |||
| 263 | 263 | ||
| 264 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 264 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 265 | .type = AVMEDIA_TYPE_AUDIO, | 265 | .type = AVMEDIA_TYPE_AUDIO, |
| 266 | .filter_samples = filter_samples, | 266 | .filter_frame = filter_frame, |
| 267 | .min_perms = AV_PERM_READ, }, | 267 | .min_perms = AV_PERM_READ, }, |
| 268 | { .name = NULL}}, | 268 | { .name = NULL}}, |
| 269 | .outputs = (const AVFilterPad[]) {{ .name = "default", | 269 | .outputs = (const AVFilterPad[]) {{ .name = "default", |
| @@ -125,12 +125,12 @@ static int push_samples(AVFilterLink *outlink) · 124 unmodified lines | |||
| 125 | if (asns->next_out_pts != AV_NOPTS_VALUE) | 125 | if (asns->next_out_pts != AV_NOPTS_VALUE) |
| 126 | asns->next_out_pts += nb_out_samples; | 126 | asns->next_out_pts += nb_out_samples; |
| 127 | 127 | ||
| 128 | ff_filter_samples(outlink, outsamples); | 128 | ff_filter_frame(outlink, outsamples); |
| 129 | asns->req_fullfilled = 1; | 129 | asns->req_fullfilled = 1; |
| 130 | return nb_out_samples; | 130 | return nb_out_samples; |
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 133 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 134 | { | 134 | { |
| 135 | AVFilterContext *ctx = inlink->dst; | 135 | AVFilterContext *ctx = inlink->dst; |
| 136 | ASNSContext *asns = ctx->priv; | 136 | ASNSContext *asns = ctx->priv; |
| @@ -186,7 +186,7 @@ AVFilter avfilter_af_asetnsamples = { · 49 unmodified lines | |||
| 186 | { | 186 | { |
| 187 | .name = "default", | 187 | .name = "default", |
| 188 | .type = AVMEDIA_TYPE_AUDIO, | 188 | .type = AVMEDIA_TYPE_AUDIO, |
| 189 | .filter_samples = filter_samples, | 189 | .filter_frame = filter_frame, |
| 190 | .min_perms = AV_PERM_READ|AV_PERM_WRITE | 190 | .min_perms = AV_PERM_READ|AV_PERM_WRITE |
| 191 | }, | 191 | }, |
| 192 | { .name = NULL } | 192 | { .name = NULL } |
| @@ -54,7 +54,7 @@ static void uninit(AVFilterContext *ctx) · 53 unmodified lines | |||
| 54 | av_freep(&s->plane_checksums); | 54 | av_freep(&s->plane_checksums); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 57 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 58 | { | 58 | { |
| 59 | AVFilterContext *ctx = inlink->dst; | 59 | AVFilterContext *ctx = inlink->dst; |
| 60 | AShowInfoContext *s = ctx->priv; | 60 | AShowInfoContext *s = ctx->priv; |
| @@ -100,7 +100,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 39 unmodified lines | |||
| 100 | av_log(ctx, AV_LOG_INFO, "]\n"); | 100 | av_log(ctx, AV_LOG_INFO, "]\n"); |
| 101 | 101 | ||
| 102 | s->frame++; | 102 | s->frame++; |
| 103 | return ff_filter_samples(inlink->dst->outputs[0], buf); | 103 | return ff_filter_frame(inlink->dst->outputs[0], buf); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | static const AVFilterPad inputs[] = { | 106 | static const AVFilterPad inputs[] = { |
| @@ -108,7 +108,7 @@ static const AVFilterPad inputs[] = { · 1 unmodified line | |||
| 108 | .name = "default", | 108 | .name = "default", |
| 109 | .type = AVMEDIA_TYPE_AUDIO, | 109 | .type = AVMEDIA_TYPE_AUDIO, |
| 110 | .get_audio_buffer = ff_null_get_audio_buffer, | 110 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 111 | .filter_samples = filter_samples, | 111 | .filter_frame = filter_frame, |
| 112 | .min_perms = AV_PERM_READ, | 112 | .min_perms = AV_PERM_READ, |
| 113 | }, | 113 | }, |
| 114 | { NULL }, | 114 | { NULL }, |
| @@ -122,7 +122,7 @@ static int send_out(AVFilterContext *ctx, int out_id) · 121 unmodified lines | |||
| 122 | av_q2d(ctx->outputs[out_id]->time_base) * buf->pts; | 122 | av_q2d(ctx->outputs[out_id]->time_base) * buf->pts; |
| 123 | as->var_values[VAR_T1 + out_id] += buf->audio->nb_samples / | 123 | as->var_values[VAR_T1 + out_id] += buf->audio->nb_samples / |
| 124 | (double)ctx->inputs[out_id]->sample_rate; | 124 | (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); |
| 126 | queue->nb--; | 126 | queue->nb--; |
| 127 | queue->tail = (queue->tail + 1) % QUEUE_SIZE; | 127 | queue->tail = (queue->tail + 1) % QUEUE_SIZE; |
| 128 | if (as->req[out_id]) | 128 | if (as->req[out_id]) |
| @@ -167,7 +167,7 @@ static int request_frame(AVFilterLink *outlink) · 38 unmodified lines | |||
| 167 | return 0; | 167 | return 0; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 170 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 171 | { | 171 | { |
| 172 | AVFilterContext *ctx = inlink->dst; | 172 | AVFilterContext *ctx = inlink->dst; |
| 173 | AStreamSyncContext *as = ctx->priv; | 173 | AStreamSyncContext *as = ctx->priv; |
| @@ -191,11 +191,11 @@ AVFilter avfilter_af_astreamsync = { · 17 unmodified lines | |||
| 191 | .inputs = (const AVFilterPad[]) { | 191 | .inputs = (const AVFilterPad[]) { |
| 192 | { .name = "in1", | 192 | { .name = "in1", |
| 193 | .type = AVMEDIA_TYPE_AUDIO, | 193 | .type = AVMEDIA_TYPE_AUDIO, |
| 194 | .filter_samples = filter_samples, | 194 | .filter_frame = filter_frame, |
| 195 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, | 195 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, |
| 196 | { .name = "in2", | 196 | { .name = "in2", |
| 197 | .type = AVMEDIA_TYPE_AUDIO, | 197 | .type = AVMEDIA_TYPE_AUDIO, |
| 198 | .filter_samples = filter_samples, | 198 | .filter_frame = filter_frame, |
| 199 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, | 199 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, |
| 200 | { .name = NULL } | 200 | { .name = NULL } |
| 201 | }, | 201 | }, |
| @@ -39,7 +39,7 @@ typedef struct ASyncContext { · 38 unmodified lines | |||
| 39 | float min_delta_sec; | 39 | float min_delta_sec; |
| 40 | int max_comp; | 40 | int max_comp; |
| 41 | 41 | ||
| 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() */ |
| 43 | int got_output; | 43 | int got_output; |
| 44 | } ASyncContext; | 44 | } ASyncContext; |
| 45 | 45 | ||
| @@ -135,7 +135,7 @@ static int request_frame(AVFilterLink *link) · 89 unmodified lines | |||
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | buf->pts = s->pts; | 137 | buf->pts = s->pts; |
| 138 | return ff_filter_samples(link, buf); | 138 | return ff_filter_frame(link, buf); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | return ret; | 141 | return ret; |
| @@ -155,7 +155,7 @@ static int64_t get_delay(ASyncContext *s) · 13 unmodified lines | |||
| 155 | return avresample_available(s->avr) + avresample_get_delay(s->avr); | 155 | return avresample_available(s->avr) + avresample_get_delay(s->avr); |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 158 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 159 | { | 159 | { |
| 160 | AVFilterContext *ctx = inlink->dst; | 160 | AVFilterContext *ctx = inlink->dst; |
| 161 | ASyncContext *s = ctx->priv; | 161 | ASyncContext *s = ctx->priv; |
| @@ -211,7 +211,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 49 unmodified lines | |||
| 211 | av_samples_set_silence(buf_out->extended_data, out_size - delta, | 211 | av_samples_set_silence(buf_out->extended_data, out_size - delta, |
| 212 | delta, nb_channels, buf->format); | 212 | delta, nb_channels, buf->format); |
| 213 | } | 213 | } |
| 214 | ret = ff_filter_samples(outlink, buf_out); | 214 | ret = ff_filter_frame(outlink, buf_out); |
| 215 | if (ret < 0) | 215 | if (ret < 0) |
| 216 | goto fail; | 216 | goto fail; |
| 217 | s->got_output = 1; | 217 | s->got_output = 1; |
| @@ -237,7 +237,7 @@ static const AVFilterPad avfilter_af_asyncts_inputs[] = { · 19 unmodified lines | |||
| 237 | { | 237 | { |
| 238 | .name = "default", | 238 | .name = "default", |
| 239 | .type = AVMEDIA_TYPE_AUDIO, | 239 | .type = AVMEDIA_TYPE_AUDIO, |
| 240 | .filter_samples = filter_samples | 240 | .filter_frame = filter_frame |
| 241 | }, | 241 | }, |
| 242 | { NULL } | 242 | { NULL } |
| 243 | }; | 243 | }; |
| @@ -138,7 +138,7 @@ typedef struct { · 137 unmodified lines | |||
| 138 | RDFTContext *complex_to_real; | 138 | RDFTContext *complex_to_real; |
| 139 | FFTSample *correlation; | 139 | FFTSample *correlation; |
| 140 | 140 | ||
| 141 | // for managing AVFilterPad.request_frame and AVFilterPad.filter_samples | 141 | // for managing AVFilterPad.request_frame and AVFilterPad.filter_frame |
| 142 | int request_fulfilled; | 142 | int request_fulfilled; |
| 143 | AVFilterBufferRef *dst_buffer; | 143 | AVFilterBufferRef *dst_buffer; |
| 144 | uint8_t *dst; | 144 | uint8_t *dst; |
| @@ -1033,7 +1033,7 @@ static void push_samples(ATempoContext *atempo, · 888 unmodified lines | |||
| 1033 | (AVRational){ 1, outlink->sample_rate }, | 1033 | (AVRational){ 1, outlink->sample_rate }, |
| 1034 | outlink->time_base); | 1034 | outlink->time_base); |
| 1035 | 1035 | ||
| 1036 | ff_filter_samples(outlink, atempo->dst_buffer); | 1036 | ff_filter_frame(outlink, atempo->dst_buffer); |
| 1037 | atempo->dst_buffer = NULL; | 1037 | atempo->dst_buffer = NULL; |
| 1038 | atempo->dst = NULL; | 1038 | atempo->dst = NULL; |
| 1039 | atempo->dst_end = NULL; | 1039 | atempo->dst_end = NULL; |
| @@ -1041,7 +1041,7 @@ static void push_samples(ATempoContext *atempo, · 1 unmodified line | |||
| 1041 | atempo->nsamples_out += n_out; | 1041 | atempo->nsamples_out += n_out; |
| 1042 | } | 1042 | } |
| 1043 | 1043 | ||
| 1044 | static int filter_samples(AVFilterLink *inlink, | 1044 | static int filter_frame(AVFilterLink *inlink, |
| 1045 | AVFilterBufferRef *src_buffer) | 1045 | AVFilterBufferRef *src_buffer) |
| 1046 | { | 1046 | { |
| 1047 | AVFilterContext *ctx = inlink->dst; | 1047 | AVFilterContext *ctx = inlink->dst; |
| @@ -1148,7 +1148,7 @@ AVFilter avfilter_af_atempo = { · 100 unmodified lines | |||
| 1148 | .inputs = (const AVFilterPad[]) { | 1148 | .inputs = (const AVFilterPad[]) { |
| 1149 | { .name = "default", | 1149 | { .name = "default", |
| 1150 | .type = AVMEDIA_TYPE_AUDIO, | 1150 | .type = AVMEDIA_TYPE_AUDIO, |
| 1151 | .filter_samples = filter_samples, | 1151 | .filter_frame = filter_frame, |
| 1152 | .config_props = config_props, | 1152 | .config_props = config_props, |
| 1153 | .min_perms = AV_PERM_READ, }, | 1153 | .min_perms = AV_PERM_READ, }, |
| 1154 | { .name = NULL} | 1154 | { .name = NULL} |
| @@ -312,7 +312,7 @@ static int channelmap_query_formats(AVFilterContext *ctx) · 311 unmodified lines | |||
| 312 | return 0; | 312 | return 0; |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 315 | static int channelmap_filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 316 | { | 316 | { |
| 317 | AVFilterContext *ctx = inlink->dst; | 317 | AVFilterContext *ctx = inlink->dst; |
| 318 | AVFilterLink *outlink = ctx->outputs[0]; | 318 | AVFilterLink *outlink = ctx->outputs[0]; |
| @@ -354,7 +354,7 @@ static int channelmap_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *bu · 35 unmodified lines | |||
| 354 | memcpy(buf->data, buf->extended_data, | 354 | memcpy(buf->data, buf->extended_data, |
| 355 | FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0])); | 355 | FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0])); |
| 356 | 356 | ||
| 357 | return ff_filter_samples(outlink, buf); | 357 | return ff_filter_frame(outlink, buf); |
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | static int channelmap_config_input(AVFilterLink *inlink) | 360 | static int channelmap_config_input(AVFilterLink *inlink) |
| @@ -389,7 +389,7 @@ static const AVFilterPad avfilter_af_channelmap_inputs[] = { · 28 unmodified lines | |||
| 389 | .name = "default", | 389 | .name = "default", |
| 390 | .type = AVMEDIA_TYPE_AUDIO, | 390 | .type = AVMEDIA_TYPE_AUDIO, |
| 391 | .min_perms = AV_PERM_READ | AV_PERM_WRITE, | 391 | .min_perms = AV_PERM_READ | AV_PERM_WRITE, |
| 392 | .filter_samples = channelmap_filter_samples, | 392 | .filter_frame = channelmap_filter_frame, |
| 393 | .config_props = channelmap_config_input | 393 | .config_props = channelmap_config_input |
| 394 | }, | 394 | }, |
| 395 | { NULL } | 395 | { NULL } |
| @@ -105,7 +105,7 @@ static int query_formats(AVFilterContext *ctx) · 104 unmodified lines | |||
| 105 | return 0; | 105 | return 0; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 108 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 109 | { | 109 | { |
| 110 | AVFilterContext *ctx = inlink->dst; | 110 | AVFilterContext *ctx = inlink->dst; |
| 111 | int i, ret = 0; | 111 | int i, ret = 0; |
| @@ -122,7 +122,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 10 unmodified lines | |||
| 122 | buf_out->audio->channel_layout = | 122 | buf_out->audio->channel_layout = |
| 123 | av_channel_layout_extract_channel(buf->audio->channel_layout, i); | 123 | av_channel_layout_extract_channel(buf->audio->channel_layout, i); |
| 124 | 124 | ||
| 125 | ret = ff_filter_samples(ctx->outputs[i], buf_out); | 125 | ret = ff_filter_frame(ctx->outputs[i], buf_out); |
| 126 | if (ret < 0) | 126 | if (ret < 0) |
| 127 | break; | 127 | break; |
| 128 | } | 128 | } |
| @@ -134,7 +134,7 @@ static const AVFilterPad avfilter_af_channelsplit_inputs[] = { · 5 unmodified lines | |||
| 134 | { | 134 | { |
| 135 | .name = "default", | 135 | .name = "default", |
| 136 | .type = AVMEDIA_TYPE_AUDIO, | 136 | .type = AVMEDIA_TYPE_AUDIO, |
| 137 | .filter_samples = filter_samples, | 137 | .filter_frame = filter_frame, |
| 138 | }, | 138 | }, |
| 139 | { NULL } | 139 | { NULL } |
| 140 | }; | 140 | }; |
| @@ -120,7 +120,7 @@ static inline int16_t *scalarproduct(const int16_t *in, const int16_t *endin, in · 119 unmodified lines | |||
| 120 | return out; | 120 | return out; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 123 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 124 | { | 124 | { |
| 125 | AVFilterLink *outlink = inlink->dst->outputs[0]; | 125 | AVFilterLink *outlink = inlink->dst->outputs[0]; |
| 126 | int16_t *taps, *endin, *in, *out; | 126 | int16_t *taps, *endin, *in, *out; |
| @@ -148,7 +148,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 21 unmodified lines | |||
| 148 | // save part of input for next round | 148 | // save part of input for next round |
| 149 | memcpy(taps, endin, NUMTAPS * sizeof(*taps)); | 149 | memcpy(taps, endin, NUMTAPS * sizeof(*taps)); |
| 150 | 150 | ||
| 151 | ret = ff_filter_samples(outlink, outsamples); | 151 | ret = ff_filter_frame(outlink, outsamples); |
| 152 | avfilter_unref_buffer(insamples); | 152 | avfilter_unref_buffer(insamples); |
| 153 | return ret; | 153 | return ret; |
| 154 | } | 154 | } |
| @@ -160,7 +160,7 @@ AVFilter avfilter_af_earwax = { · 5 unmodified lines | |||
| 160 | .priv_size = sizeof(EarwaxContext), | 160 | .priv_size = sizeof(EarwaxContext), |
| 161 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 161 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 162 | .type = AVMEDIA_TYPE_AUDIO, | 162 | .type = AVMEDIA_TYPE_AUDIO, |
| 163 | .filter_samples = filter_samples, | 163 | .filter_frame = filter_frame, |
| 164 | .config_props = config_input, | 164 | .config_props = config_input, |
| 165 | .min_perms = AV_PERM_READ, }, | 165 | .min_perms = AV_PERM_READ, }, |
| 166 | { .name = NULL}}, | 166 | { .name = NULL}}, |
| @@ -94,7 +94,7 @@ static const AVClass join_class = { · 93 unmodified lines | |||
| 94 | .version = LIBAVUTIL_VERSION_INT, | 94 | .version = LIBAVUTIL_VERSION_INT, |
| 95 | }; | 95 | }; |
| 96 | 96 | ||
| 97 | static int filter_samples(AVFilterLink *link, AVFilterBufferRef *buf) | 97 | static int filter_frame(AVFilterLink *link, AVFilterBufferRef *buf) |
| 98 | { | 98 | { |
| 99 | AVFilterContext *ctx = link->dst; | 99 | AVFilterContext *ctx = link->dst; |
| 100 | JoinContext *s = ctx->priv; | 100 | JoinContext *s = ctx->priv; |
| @@ -229,7 +229,7 @@ static int join_init(AVFilterContext *ctx, const char *args) · 128 unmodified lines | |||
| 229 | snprintf(name, sizeof(name), "input%d", i); | 229 | snprintf(name, sizeof(name), "input%d", i); |
| 230 | pad.type = AVMEDIA_TYPE_AUDIO; | 230 | pad.type = AVMEDIA_TYPE_AUDIO; |
| 231 | pad.name = av_strdup(name); | 231 | pad.name = av_strdup(name); |
| 232 | pad.filter_samples = filter_samples; | 232 | pad.filter_frame = filter_frame; |
| 233 | 233 | ||
| 234 | pad.needs_fifo = 1; | 234 | pad.needs_fifo = 1; |
| 235 | 235 | ||
| @@ -470,7 +470,7 @@ static int join_request_frame(AVFilterLink *outlink) · 234 unmodified lines | |||
| 470 | priv->nb_in_buffers = ctx->nb_inputs; | 470 | priv->nb_in_buffers = ctx->nb_inputs; |
| 471 | buf->buf->priv = priv; | 471 | buf->buf->priv = priv; |
| 472 | 472 | ||
| 473 | ret = ff_filter_samples(outlink, buf); | 473 | ret = ff_filter_frame(outlink, buf); |
| 474 | 474 | ||
| 475 | memset(s->input_frames, 0, sizeof(*s->input_frames) * ctx->nb_inputs); | 475 | memset(s->input_frames, 0, sizeof(*s->input_frames) * ctx->nb_inputs); |
| 476 | 476 | ||
| @@ -353,7 +353,7 @@ static int config_props(AVFilterLink *link) · 352 unmodified lines | |||
| 353 | return 0; | 353 | return 0; |
| 354 | } | 354 | } |
| 355 | 355 | ||
| 356 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 356 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 357 | { | 357 | { |
| 358 | int ret; | 358 | int ret; |
| 359 | int n = insamples->audio->nb_samples; | 359 | int n = insamples->audio->nb_samples; |
| @@ -365,7 +365,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 5 unmodified lines | |||
| 365 | avfilter_copy_buffer_ref_props(outsamples, insamples); | 365 | avfilter_copy_buffer_ref_props(outsamples, insamples); |
| 366 | outsamples->audio->channel_layout = outlink->channel_layout; | 366 | outsamples->audio->channel_layout = outlink->channel_layout; |
| 367 | 367 | ||
| 368 | ret = ff_filter_samples(outlink, outsamples); | 368 | ret = ff_filter_frame(outlink, outsamples); |
| 369 | avfilter_unref_buffer(insamples); | 369 | avfilter_unref_buffer(insamples); |
| 370 | return ret; | 370 | return ret; |
| 371 | } | 371 | } |
| @@ -388,7 +388,7 @@ AVFilter avfilter_af_pan = { · 16 unmodified lines | |||
| 388 | { .name = "default", | 388 | { .name = "default", |
| 389 | .type = AVMEDIA_TYPE_AUDIO, | 389 | .type = AVMEDIA_TYPE_AUDIO, |
| 390 | .config_props = config_props, | 390 | .config_props = config_props, |
| 391 | .filter_samples = filter_samples, | 391 | .filter_frame = filter_frame, |
| 392 | .min_perms = AV_PERM_READ, }, | 392 | .min_perms = AV_PERM_READ, }, |
| 393 | { .name = NULL} | 393 | { .name = NULL} |
| 394 | }, | 394 | }, |
| @@ -40,7 +40,7 @@ typedef struct ResampleContext { · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | int64_t next_pts; | 41 | int64_t next_pts; |
| 42 | 42 | ||
| 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() */ |
| 44 | int got_output; | 44 | int got_output; |
| 45 | } ResampleContext; | 45 | } ResampleContext; |
| 46 | 46 | ||
| @@ -162,12 +162,12 @@ static int request_frame(AVFilterLink *outlink) · 115 unmodified lines | |||
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | buf->pts = s->next_pts; | 164 | buf->pts = s->next_pts; |
| 165 | return ff_filter_samples(outlink, buf); | 165 | return ff_filter_frame(outlink, buf); |
| 166 | } | 166 | } |
| 167 | return ret; | 167 | return ret; |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 170 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 171 | { | 171 | { |
| 172 | AVFilterContext *ctx = inlink->dst; | 172 | AVFilterContext *ctx = inlink->dst; |
| 173 | ResampleContext *s = ctx->priv; | 173 | ResampleContext *s = ctx->priv; |
| @@ -224,7 +224,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) · 50 unmodified lines | |||
| 224 | 224 | ||
| 225 | s->next_pts = buf_out->pts + buf_out->audio->nb_samples; | 225 | s->next_pts = buf_out->pts + buf_out->audio->nb_samples; |
| 226 | 226 | ||
| 227 | ret = ff_filter_samples(outlink, buf_out); | 227 | ret = ff_filter_frame(outlink, buf_out); |
| 228 | s->got_output = 1; | 228 | s->got_output = 1; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| @@ -232,7 +232,7 @@ fail: · 1 unmodified line | |||
| 232 | avfilter_unref_buffer(buf); | 232 | avfilter_unref_buffer(buf); |
| 233 | } else { | 233 | } else { |
| 234 | buf->format = outlink->format; | 234 | buf->format = outlink->format; |
| 235 | ret = ff_filter_samples(outlink, buf); | 235 | ret = ff_filter_frame(outlink, buf); |
| 236 | s->got_output = 1; | 236 | s->got_output = 1; |
| 237 | } | 237 | } |
| 238 | 238 | ||
| @@ -243,7 +243,7 @@ static const AVFilterPad avfilter_af_resample_inputs[] = { · 4 unmodified lines | |||
| 243 | { | 243 | { |
| 244 | .name = "default", | 244 | .name = "default", |
| 245 | .type = AVMEDIA_TYPE_AUDIO, | 245 | .type = AVMEDIA_TYPE_AUDIO, |
| 246 | .filter_samples = filter_samples, | 246 | .filter_frame = filter_frame, |
| 247 | .min_perms = AV_PERM_READ | 247 | .min_perms = AV_PERM_READ |
| 248 | }, | 248 | }, |
| 249 | { NULL } | 249 | { NULL } |
| @@ -84,7 +84,7 @@ static char *get_metadata_val(AVFilterBufferRef *insamples, const char *key) · 83 unmodified lines | |||
| 84 | return e && e->value ? e->value : NULL; | 84 | return e && e->value ? e->value : NULL; |
| 85 | } | 85 | } |
| 86 | 86 | ||
| 87 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 87 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 88 | { | 88 | { |
| 89 | int i; | 89 | int i; |
| 90 | SilenceDetectContext *silence = inlink->dst->priv; | 90 | SilenceDetectContext *silence = inlink->dst->priv; |
| @@ -132,7 +132,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 41 unmodified lines | |||
| 132 | } | 132 | } |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | return ff_filter_samples(inlink->dst->outputs[0], insamples); | 135 | return ff_filter_frame(inlink->dst->outputs[0], insamples); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static int query_formats(AVFilterContext *ctx) | 138 | static int query_formats(AVFilterContext *ctx) |
| @@ -173,7 +173,7 @@ AVFilter avfilter_af_silencedetect = { · 34 unmodified lines | |||
| 173 | { .name = "default", | 173 | { .name = "default", |
| 174 | .type = AVMEDIA_TYPE_AUDIO, | 174 | .type = AVMEDIA_TYPE_AUDIO, |
| 175 | .get_audio_buffer = ff_null_get_audio_buffer, | 175 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 176 | .filter_samples = filter_samples, }, | 176 | .filter_frame = filter_frame, }, |
| 177 | { .name = NULL } | 177 | { .name = NULL } |
| 178 | }, | 178 | }, |
| 179 | .outputs = (const AVFilterPad[]) { | 179 | .outputs = (const AVFilterPad[]) { |
| @@ -110,7 +110,7 @@ static int query_formats(AVFilterContext *ctx) · 109 unmodified lines | |||
| 110 | return 0; | 110 | return 0; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 113 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 114 | { | 114 | { |
| 115 | VolumeContext *vol = inlink->dst->priv; | 115 | VolumeContext *vol = inlink->dst->priv; |
| 116 | AVFilterLink *outlink = inlink->dst->outputs[0]; | 116 | AVFilterLink *outlink = inlink->dst->outputs[0]; |
| @@ -169,7 +169,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 52 unmodified lines | |||
| 169 | } | 169 | } |
| 170 | } | 170 | } |
| 171 | } | 171 | } |
| 172 | return ff_filter_samples(outlink, insamples); | 172 | return ff_filter_frame(outlink, insamples); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | AVFilter avfilter_af_volume = { | 175 | AVFilter avfilter_af_volume = { |
| @@ -181,7 +181,7 @@ AVFilter avfilter_af_volume = { · 5 unmodified lines | |||
| 181 | 181 | ||
| 182 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 182 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 183 | .type = AVMEDIA_TYPE_AUDIO, | 183 | .type = AVMEDIA_TYPE_AUDIO, |
| 184 | .filter_samples = filter_samples, | 184 | .filter_frame = filter_frame, |
| 185 | .min_perms = AV_PERM_READ|AV_PERM_WRITE}, | 185 | .min_perms = AV_PERM_READ|AV_PERM_WRITE}, |
| 186 | { .name = NULL}}, | 186 | { .name = NULL}}, |
| 187 | 187 | ||
| @@ -49,7 +49,7 @@ static int query_formats(AVFilterContext *ctx) · 48 unmodified lines | |||
| 49 | return 0; | 49 | return 0; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samples) | 52 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samples) |
| 53 | { | 53 | { |
| 54 | AVFilterContext *ctx = inlink->dst; | 54 | AVFilterContext *ctx = inlink->dst; |
| 55 | VolDetectContext *vd = ctx->priv; | 55 | VolDetectContext *vd = ctx->priv; |
| @@ -70,7 +70,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samples) · 14 unmodified lines | |||
| 70 | vd->histogram[pcm[i] + 0x8000]++; | 70 | vd->histogram[pcm[i] + 0x8000]++; |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | return ff_filter_samples(inlink->dst->outputs[0], samples); | 73 | return ff_filter_frame(inlink->dst->outputs[0], samples); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | #define MAX_DB 91 | 76 | #define MAX_DB 91 |
| @@ -143,7 +143,7 @@ AVFilter avfilter_af_volumedetect = { · 66 unmodified lines | |||
| 143 | { .name = "default", | 143 | { .name = "default", |
| 144 | .type = AVMEDIA_TYPE_AUDIO, | 144 | .type = AVMEDIA_TYPE_AUDIO, |
| 145 | .get_audio_buffer = ff_null_get_audio_buffer, | 145 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 146 | .filter_samples = filter_samples, | 146 | .filter_frame = filter_frame, |
| 147 | .min_perms = AV_PERM_READ, }, | 147 | .min_perms = AV_PERM_READ, }, |
| 148 | { .name = NULL } | 148 | { .name = NULL } |
| 149 | }, | 149 | }, |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include "avfilter.h" | 22 | #include "avfilter.h" |
| 23 | #include "internal.h" | 23 | #include "internal.h" |
| 24 | 24 | ||
| 25 | static int null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) | 25 | static int null_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref) |
| 26 | { | 26 | { |
| 27 | avfilter_unref_bufferp(&samplesref); | 27 | avfilter_unref_bufferp(&samplesref); |
| 28 | return 0; | 28 | return 0; |
| @@ -32,7 +32,7 @@ static const AVFilterPad avfilter_asink_anullsink_inputs[] = { · 3 unmodified lines | |||
| 32 | { | 32 | { |
| 33 | .name = "default", | 33 | .name = "default", |
| 34 | .type = AVMEDIA_TYPE_AUDIO, | 34 | .type = AVMEDIA_TYPE_AUDIO, |
| 35 | .filter_samples = null_filter_samples, | 35 | .filter_frame = null_filter_frame, |
| 36 | }, | 36 | }, |
| 37 | { NULL }, | 37 | { NULL }, |
| 38 | }; | 38 | }; |
| @@ -237,7 +237,7 @@ static int request_frame(AVFilterLink *outlink) · 236 unmodified lines | |||
| 237 | samplesref->audio->sample_rate = eval->sample_rate; | 237 | samplesref->audio->sample_rate = eval->sample_rate; |
| 238 | eval->pts += eval->nb_samples; | 238 | eval->pts += eval->nb_samples; |
| 239 | 239 | ||
| 240 | ff_filter_samples(outlink, samplesref); | 240 | ff_filter_frame(outlink, samplesref); |
| 241 | 241 | ||
| 242 | return 0; | 242 | return 0; |
| 243 | } | 243 | } |
| @@ -111,7 +111,7 @@ static int request_frame(AVFilterLink *outlink) · 110 unmodified lines | |||
| 111 | samplesref->audio->channel_layout = null->channel_layout; | 111 | samplesref->audio->channel_layout = null->channel_layout; |
| 112 | samplesref->audio->sample_rate = outlink->sample_rate; | 112 | samplesref->audio->sample_rate = outlink->sample_rate; |
| 113 | 113 | ||
| 114 | ff_filter_samples(outlink, avfilter_ref_buffer(samplesref, ~0)); | 114 | ff_filter_frame(outlink, avfilter_ref_buffer(samplesref, ~0)); |
| 115 | avfilter_unref_buffer(samplesref); | 115 | avfilter_unref_buffer(samplesref); |
| 116 | 116 | ||
| 117 | null->pts += null->nb_samples; | 117 | null->pts += null->nb_samples; |
| @@ -265,7 +265,7 @@ static int request_frame(AVFilterLink *outlink) · 264 unmodified lines | |||
| 265 | flite->wave_samples += nb_samples * flite->wave->num_channels; | 265 | flite->wave_samples += nb_samples * flite->wave->num_channels; |
| 266 | flite->wave_nb_samples -= nb_samples; | 266 | flite->wave_nb_samples -= nb_samples; |
| 267 | 267 | ||
| 268 | return ff_filter_samples(outlink, samplesref); | 268 | return ff_filter_frame(outlink, samplesref); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | AVFilter avfilter_asrc_flite = { | 271 | AVFilter avfilter_asrc_flite = { |
| @@ -157,30 +157,30 @@ fail: · 156 unmodified lines | |||
| 157 | return NULL; | 157 | return NULL; |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static int default_filter_samples(AVFilterLink *link, | 160 | static int default_filter_frame(AVFilterLink *link, |
| 161 | AVFilterBufferRef *samplesref) | 161 | AVFilterBufferRef *samplesref) |
| 162 | { | 162 | { |
| 163 | return ff_filter_samples(link->dst->outputs[0], samplesref); | 163 | return ff_filter_frame(link->dst->outputs[0], samplesref); |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref) | 166 | int ff_filter_frame_framed(AVFilterLink *link, AVFilterBufferRef *samplesref) |
| 167 | { | 167 | { |
| 168 | int (*filter_samples)(AVFilterLink *, AVFilterBufferRef *); | 168 | int (*filter_frame)(AVFilterLink *, AVFilterBufferRef *); |
| 169 | AVFilterPad *src = link->srcpad; | 169 | AVFilterPad *src = link->srcpad; |
| 170 | AVFilterPad *dst = link->dstpad; | 170 | AVFilterPad *dst = link->dstpad; |
| 171 | int64_t pts; | 171 | int64_t pts; |
| 172 | AVFilterBufferRef *buf_out; | 172 | AVFilterBufferRef *buf_out; |
| 173 | int ret; | 173 | int ret; |
| 174 | 174 | ||
| 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); |
| 176 | 176 | ||
| 177 | if (link->closed) { | 177 | if (link->closed) { |
| 178 | avfilter_unref_buffer(samplesref); | 178 | avfilter_unref_buffer(samplesref); |
| 179 | return AVERROR_EOF; | 179 | return AVERROR_EOF; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | if (!(filter_samples = dst->filter_samples)) | 182 | if (!(filter_frame = dst->filter_frame)) |
| 183 | filter_samples = default_filter_samples; | 183 | filter_frame = default_filter_frame; |
| 184 | 184 | ||
| 185 | av_assert1((samplesref->perms & src->min_perms) == src->min_perms); | 185 | av_assert1((samplesref->perms & src->min_perms) == src->min_perms); |
| 186 | samplesref->perms &= ~ src->rej_perms; | 186 | samplesref->perms &= ~ src->rej_perms; |
| @@ -213,12 +213,12 @@ int ff_filter_samples_framed(AVFilterLink *link, AVFilterBufferRef *samplesref) · 26 unmodified lines | |||
| 213 | 213 | ||
| 214 | link->cur_buf = buf_out; | 214 | link->cur_buf = buf_out; |
| 215 | pts = buf_out->pts; | 215 | pts = buf_out->pts; |
| 216 | ret = filter_samples(link, buf_out); | 216 | ret = filter_frame(link, buf_out); |
| 217 | ff_update_link_current_pts(link, pts); | 217 | ff_update_link_current_pts(link, pts); |
| 218 | return ret; | 218 | return ret; |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) | 221 | int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref) |
| 222 | { | 222 | { |
| 223 | int insamples = samplesref->audio->nb_samples, inpos = 0, nb_samples; | 223 | int insamples = samplesref->audio->nb_samples, inpos = 0, nb_samples; |
| 224 | AVFilterBufferRef *pbuf = link->partial_buf; | 224 | AVFilterBufferRef *pbuf = link->partial_buf; |
| @@ -232,7 +232,7 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 7 unmodified lines | |||
| 232 | if (!link->min_samples || | 232 | if (!link->min_samples || |
| 233 | (!pbuf && | 233 | (!pbuf && |
| 234 | insamples >= link->min_samples && insamples <= link->max_samples)) { | 234 | insamples >= link->min_samples && insamples <= link->max_samples)) { |
| 235 | return ff_filter_samples_framed(link, samplesref); | 235 | return ff_filter_frame_framed(link, samplesref); |
| 236 | } | 236 | } |
| 237 | /* Handle framing (min_samples, max_samples) */ | 237 | /* Handle framing (min_samples, max_samples) */ |
| 238 | while (insamples) { | 238 | while (insamples) { |
| @@ -259,7 +259,7 @@ int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) · 20 unmodified lines | |||
| 259 | insamples -= nb_samples; | 259 | insamples -= nb_samples; |
| 260 | pbuf->audio->nb_samples += nb_samples; | 260 | pbuf->audio->nb_samples += nb_samples; |
| 261 | if (pbuf->audio->nb_samples >= link->min_samples) { | 261 | if (pbuf->audio->nb_samples >= link->min_samples) { |
| 262 | ret = ff_filter_samples_framed(link, pbuf); | 262 | ret = ff_filter_frame_framed(link, pbuf); |
| 263 | pbuf = NULL; | 263 | pbuf = NULL; |
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| @@ -74,13 +74,13 @@ AVFilterBufferRef *ff_get_audio_buffer(AVFilterLink *link, int perms, · 73 unmodified lines | |||
| 74 | * @return >= 0 on success, a negative AVERROR on error. The receiving filter | 74 | * @return >= 0 on success, a negative AVERROR on error. The receiving filter |
| 75 | * is responsible for unreferencing samplesref in case of error. | 75 | * is responsible for unreferencing samplesref in case of error. |
| 76 | */ | 76 | */ |
| 77 | int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref); | 77 | int ff_filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref); |
| 78 | 78 | ||
| 79 | /** | 79 | /** |
| 80 | * Send a buffer of audio samples to the next link, without checking | 80 | * Send a buffer of audio samples to the next link, without checking |
| 81 | * min_samples. | 81 | * min_samples. |
| 82 | */ | 82 | */ |
| 83 | int ff_filter_samples_framed(AVFilterLink *link, | 83 | int ff_filter_frame_framed(AVFilterLink *link, |
| 84 | AVFilterBufferRef *samplesref); | 84 | AVFilterBufferRef *samplesref); |
| 85 | 85 | ||
| 86 | #endif /* AVFILTER_AUDIO_H */ | 86 | #endif /* AVFILTER_AUDIO_H */ |
| @@ -185,7 +185,7 @@ static void push_frame(AVFilterContext *ctx, unsigned in_no, · 184 unmodified lines | |||
| 185 | ff_end_frame(outlink); | 185 | ff_end_frame(outlink); |
| 186 | break; | 186 | break; |
| 187 | case AVMEDIA_TYPE_AUDIO: | 187 | case AVMEDIA_TYPE_AUDIO: |
| 188 | ff_filter_samples(outlink, buf); | 188 | ff_filter_frame(outlink, buf); |
| 189 | break; | 189 | break; |
| 190 | } | 190 | } |
| 191 | } | 191 | } |
| @@ -244,7 +244,7 @@ static int end_frame(AVFilterLink *inlink) · 52 unmodified lines | |||
| 244 | return 0; | 244 | return 0; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *buf) | 247 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *buf) |
| 248 | { | 248 | { |
| 249 | process_frame(inlink, buf); | 249 | process_frame(inlink, buf); |
| 250 | return 0; /* enhancement: handle error return */ | 250 | 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 | |||
| 297 | av_samples_set_silence(buf->extended_data, 0, frame_nb_samples, | 297 | av_samples_set_silence(buf->extended_data, 0, frame_nb_samples, |
| 298 | nb_channels, outlink->format); | 298 | nb_channels, outlink->format); |
| 299 | buf->pts = base_pts + av_rescale_q(sent, rate_tb, outlink->time_base); | 299 | 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); |
| 301 | sent += frame_nb_samples; | 301 | sent += frame_nb_samples; |
| 302 | nb_samples -= frame_nb_samples; | 302 | nb_samples -= frame_nb_samples; |
| 303 | } | 303 | } |
| @@ -397,7 +397,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 93 unmodified lines | |||
| 397 | pad.draw_slice = draw_slice; | 397 | pad.draw_slice = draw_slice; |
| 398 | pad.end_frame = end_frame; | 398 | pad.end_frame = end_frame; |
| 399 | } else { | 399 | } else { |
| 400 | pad.filter_samples = filter_samples; | 400 | pad.filter_frame = filter_frame; |
| 401 | } | 401 | } |
| 402 | ff_insert_inpad(ctx, ctx->nb_inputs, &pad); | 402 | ff_insert_inpad(ctx, ctx->nb_inputs, &pad); |
| 403 | } | 403 | } |
| @@ -281,7 +281,7 @@ static int plot_spectrum_column(AVFilterLink *inlink, AVFilterBufferRef *insampl · 280 unmodified lines | |||
| 281 | return add_samples; | 281 | return add_samples; |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 284 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 285 | { | 285 | { |
| 286 | AVFilterContext *ctx = inlink->dst; | 286 | AVFilterContext *ctx = inlink->dst; |
| 287 | ShowSpectrumContext *showspectrum = ctx->priv; | 287 | ShowSpectrumContext *showspectrum = ctx->priv; |
| @@ -310,7 +310,7 @@ AVFilter avfilter_avf_showspectrum = { · 22 unmodified lines | |||
| 310 | { | 310 | { |
| 311 | .name = "default", | 311 | .name = "default", |
| 312 | .type = AVMEDIA_TYPE_AUDIO, | 312 | .type = AVMEDIA_TYPE_AUDIO, |
| 313 | .filter_samples = filter_samples, | 313 | .filter_frame = filter_frame, |
| 314 | .min_perms = AV_PERM_READ, | 314 | .min_perms = AV_PERM_READ, |
| 315 | }, | 315 | }, |
| 316 | { .name = NULL } | 316 | { .name = NULL } |
| @@ -179,7 +179,7 @@ static int request_frame(AVFilterLink *outlink) · 178 unmodified lines | |||
| 179 | 179 | ||
| 180 | #define MAX_INT16 ((1<<15) -1) | 180 | #define MAX_INT16 ((1<<15) -1) |
| 181 | 181 | ||
| 182 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 182 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 183 | { | 183 | { |
| 184 | AVFilterContext *ctx = inlink->dst; | 184 | AVFilterContext *ctx = inlink->dst; |
| 185 | AVFilterLink *outlink = ctx->outputs[0]; | 185 | AVFilterLink *outlink = ctx->outputs[0]; |
| @@ -240,7 +240,7 @@ AVFilter avfilter_avf_showwaves = { · 54 unmodified lines | |||
| 240 | { | 240 | { |
| 241 | .name = "default", | 241 | .name = "default", |
| 242 | .type = AVMEDIA_TYPE_AUDIO, | 242 | .type = AVMEDIA_TYPE_AUDIO, |
| 243 | .filter_samples = filter_samples, | 243 | .filter_frame = filter_frame, |
| 244 | .min_perms = AV_PERM_READ, | 244 | .min_perms = AV_PERM_READ, |
| 245 | }, | 245 | }, |
| 246 | { .name = NULL } | 246 | { .name = NULL } |
| @@ -343,7 +343,7 @@ int ff_request_frame(AVFilterLink *link) · 342 unmodified lines | |||
| 343 | if (ret == AVERROR_EOF && link->partial_buf) { | 343 | if (ret == AVERROR_EOF && link->partial_buf) { |
| 344 | AVFilterBufferRef *pbuf = link->partial_buf; | 344 | AVFilterBufferRef *pbuf = link->partial_buf; |
| 345 | link->partial_buf = NULL; | 345 | link->partial_buf = NULL; |
| 346 | ff_filter_samples_framed(link, pbuf); | 346 | ff_filter_frame_framed(link, pbuf); |
| 347 | return 0; | 347 | return 0; |
| 348 | } | 348 | } |
| 349 | if (ret == AVERROR_EOF) | 349 | if (ret == AVERROR_EOF) |
| @@ -339,7 +339,7 @@ struct AVFilterPad { · 338 unmodified lines | |||
| 339 | * must ensure that samplesref is properly unreferenced on error if it | 339 | * must ensure that samplesref is properly unreferenced on error if it |
| 340 | * hasn't been passed on to another filter. | 340 | * hasn't been passed on to another filter. |
| 341 | */ | 341 | */ |
| 342 | int (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref); | 342 | int (*filter_frame)(AVFilterLink *link, AVFilterBufferRef *samplesref); |
| 343 | 343 | ||
| 344 | /** | 344 | /** |
| 345 | * Frame poll callback. This returns the number of immediately available | 345 | * Frame poll callback. This returns the number of immediately available |
| @@ -678,7 +678,7 @@ struct AVFilterLink { · 332 unmodified lines | |||
| 678 | int partial_buf_size; | 678 | int partial_buf_size; |
| 679 | 679 | ||
| 680 | /** | 680 | /** |
| 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 |
| 682 | * called with fewer samples, it will accumulate them in partial_buf. | 682 | * called with fewer samples, it will accumulate them in partial_buf. |
| 683 | * This field and the related ones must not be changed after filtering | 683 | * This field and the related ones must not be changed after filtering |
| 684 | * has started. | 684 | * has started. |
| @@ -687,7 +687,7 @@ struct AVFilterLink { · 2 unmodified lines | |||
| 687 | int min_samples; | 687 | int min_samples; |
| 688 | 688 | ||
| 689 | /** | 689 | /** |
| 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 |
| 691 | * called with more samples, it will split them. | 691 | * called with more samples, it will split them. |
| 692 | */ | 692 | */ |
| 693 | int max_samples; | 693 | int max_samples; |
| @@ -703,7 +703,7 @@ struct AVFilterLink { · 9 unmodified lines | |||
| 703 | 703 | ||
| 704 | /** | 704 | /** |
| 705 | * True if the link is closed. | 705 | * 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 |
| 707 | * will fail with AVERROR_EOF, and if necessary the reference will be | 707 | * will fail with AVERROR_EOF, and if necessary the reference will be |
| 708 | * destroyed. | 708 | * destroyed. |
| 709 | * If request_frame returns AVERROR_EOF, this flag is set on the | 709 | * If request_frame returns AVERROR_EOF, this flag is set on the |
| @@ -169,7 +169,7 @@ static const AVFilterPad avfilter_asink_abuffer_inputs[] = { · 168 unmodified lines | |||
| 169 | { | 169 | { |
| 170 | .name = "default", | 170 | .name = "default", |
| 171 | .type = AVMEDIA_TYPE_AUDIO, | 171 | .type = AVMEDIA_TYPE_AUDIO, |
| 172 | .filter_samples = start_frame, | 172 | .filter_frame = start_frame, |
| 173 | .min_perms = AV_PERM_READ, | 173 | .min_perms = AV_PERM_READ, |
| 174 | .needs_fifo = 1 | 174 | .needs_fifo = 1 |
| 175 | }, | 175 | }, |
| @@ -379,7 +379,7 @@ static int request_frame(AVFilterLink *link) · 378 unmodified lines | |||
| 379 | return ret; | 379 | return ret; |
| 380 | break; | 380 | break; |
| 381 | case AVMEDIA_TYPE_AUDIO: | 381 | case AVMEDIA_TYPE_AUDIO: |
| 382 | ret = ff_filter_samples(link, buf); | 382 | ret = ff_filter_frame(link, buf); |
| 383 | break; | 383 | break; |
| 384 | default: | 384 | default: |
| 385 | avfilter_unref_bufferp(&buf); | 385 | avfilter_unref_bufferp(&buf); |
| @@ -436,7 +436,7 @@ static int gate_update(struct integrator *integ, double power, · 435 unmodified lines | |||
| 436 | return gate_hist_pos; | 436 | return gate_hist_pos; |
| 437 | } | 437 | } |
| 438 | 438 | ||
| 439 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) | 439 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples) |
| 440 | { | 440 | { |
| 441 | int i, ch; | 441 | int i, ch; |
| 442 | AVFilterContext *ctx = inlink->dst; | 442 | AVFilterContext *ctx = inlink->dst; |
| @@ -638,7 +638,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) · 195 unmodified lines | |||
| 638 | } | 638 | } |
| 639 | } | 639 | } |
| 640 | 640 | ||
| 641 | return ff_filter_samples(ctx->outputs[ebur128->do_video], insamples); | 641 | return ff_filter_frame(ctx->outputs[ebur128->do_video], insamples); |
| 642 | } | 642 | } |
| 643 | 643 | ||
| 644 | static int query_formats(AVFilterContext *ctx) | 644 | static int query_formats(AVFilterContext *ctx) |
| @@ -740,7 +740,7 @@ AVFilter avfilter_af_ebur128 = { · 95 unmodified lines | |||
| 740 | { .name = "default", | 740 | { .name = "default", |
| 741 | .type = AVMEDIA_TYPE_AUDIO, | 741 | .type = AVMEDIA_TYPE_AUDIO, |
| 742 | .get_audio_buffer = ff_null_get_audio_buffer, | 742 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 743 | .filter_samples = filter_samples, }, | 743 | .filter_frame = filter_frame, }, |
| 744 | { .name = NULL } | 744 | { .name = NULL } |
| 745 | }, | 745 | }, |
| 746 | .outputs = NULL, | 746 | .outputs = NULL, |
| @@ -511,7 +511,7 @@ end: · 510 unmodified lines | |||
| 511 | 511 | ||
| 512 | switch (inlink->type) { | 512 | switch (inlink->type) { |
| 513 | case AVMEDIA_TYPE_VIDEO: return ff_start_frame (inlink->dst->outputs[0], ref); | 513 | 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); |
| 515 | } | 515 | } |
| 516 | return AVERROR(ENOSYS); | 516 | return AVERROR(ENOSYS); |
| 517 | } | 517 | } |
| @@ -562,7 +562,7 @@ AVFilter avfilter_af_asendcmd = { · 44 unmodified lines | |||
| 562 | .name = "default", | 562 | .name = "default", |
| 563 | .type = AVMEDIA_TYPE_AUDIO, | 563 | .type = AVMEDIA_TYPE_AUDIO, |
| 564 | .get_audio_buffer = ff_null_get_audio_buffer, | 564 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 565 | .filter_samples = process_frame, | 565 | .filter_frame = process_frame, |
| 566 | }, | 566 | }, |
| 567 | { .name = NULL } | 567 | { .name = NULL } |
| 568 | }, | 568 | }, |
| @@ -174,7 +174,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) · 173 unmodified lines | |||
| 174 | setpts->var_values[VAR_N] += 1.0; | 174 | setpts->var_values[VAR_N] += 1.0; |
| 175 | if (setpts->type == AVMEDIA_TYPE_AUDIO) { | 175 | if (setpts->type == AVMEDIA_TYPE_AUDIO) { |
| 176 | setpts->var_values[VAR_NB_CONSUMED_SAMPLES] += inpicref->audio->nb_samples; | 176 | 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); |
| 178 | } else | 178 | } else |
| 179 | return ff_start_frame (inlink->dst->outputs[0], outpicref); | 179 | return ff_start_frame (inlink->dst->outputs[0], outpicref); |
| 180 | } | 180 | } |
| @@ -201,7 +201,7 @@ AVFilter avfilter_af_asetpts = { · 20 unmodified lines | |||
| 201 | .type = AVMEDIA_TYPE_AUDIO, | 201 | .type = AVMEDIA_TYPE_AUDIO, |
| 202 | .get_audio_buffer = ff_null_get_audio_buffer, | 202 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 203 | .config_props = config_input, | 203 | .config_props = config_input, |
| 204 | .filter_samples = filter_frame, | 204 | .filter_frame = filter_frame, |
| 205 | }, | 205 | }, |
| 206 | { .name = NULL } | 206 | { .name = NULL } |
| 207 | }, | 207 | }, |
| @@ -120,7 +120,7 @@ static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) · 119 unmodified lines | |||
| 120 | return ff_start_frame(outlink, picref); | 120 | return ff_start_frame(outlink, picref); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) | 123 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samplesref) |
| 124 | { | 124 | { |
| 125 | AVFilterContext *ctx = inlink->dst; | 125 | AVFilterContext *ctx = inlink->dst; |
| 126 | AVFilterLink *outlink = ctx->outputs[0]; | 126 | AVFilterLink *outlink = ctx->outputs[0]; |
| @@ -133,7 +133,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) · 6 unmodified lines | |||
| 133 | outlink->time_base.num, outlink->time_base.den, samplesref->pts); | 133 | outlink->time_base.num, outlink->time_base.den, samplesref->pts); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | return ff_filter_samples(outlink, samplesref); | 136 | return ff_filter_frame(outlink, samplesref); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | #if CONFIG_SETTB_FILTER | 139 | #if CONFIG_SETTB_FILTER |
| @@ -181,7 +181,7 @@ AVFilter avfilter_af_asettb = { · 41 unmodified lines | |||
| 181 | { .name = "default", | 181 | { .name = "default", |
| 182 | .type = AVMEDIA_TYPE_AUDIO, | 182 | .type = AVMEDIA_TYPE_AUDIO, |
| 183 | .get_audio_buffer = ff_null_get_audio_buffer, | 183 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 184 | .filter_samples = filter_samples, }, | 184 | .filter_frame = filter_frame, }, |
| 185 | { .name = NULL } | 185 | { .name = NULL } |
| 186 | }, | 186 | }, |
| 187 | .outputs = (const AVFilterPad[]) { | 187 | .outputs = (const AVFilterPad[]) { |
| @@ -228,7 +228,7 @@ static int return_audio_frame(AVFilterContext *ctx) · 227 unmodified lines | |||
| 228 | buf_out = s->buf_out; | 228 | buf_out = s->buf_out; |
| 229 | s->buf_out = NULL; | 229 | s->buf_out = NULL; |
| 230 | } | 230 | } |
| 231 | return ff_filter_samples(link, buf_out); | 231 | return ff_filter_frame(link, buf_out); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | static int request_frame(AVFilterLink *outlink) | 234 | static int request_frame(AVFilterLink *outlink) |
| @@ -257,7 +257,7 @@ static int request_frame(AVFilterLink *outlink) · 22 unmodified lines | |||
| 257 | if (outlink->request_samples) { | 257 | if (outlink->request_samples) { |
| 258 | return return_audio_frame(outlink->src); | 258 | return return_audio_frame(outlink->src); |
| 259 | } else { | 259 | } else { |
| 260 | ret = ff_filter_samples(outlink, fifo->root.next->buf); | 260 | ret = ff_filter_frame(outlink, fifo->root.next->buf); |
| 261 | queue_pop(fifo); | 261 | queue_pop(fifo); |
| 262 | } | 262 | } |
| 263 | break; | 263 | break; |
| @@ -308,7 +308,7 @@ static const AVFilterPad avfilter_af_afifo_inputs[] = { · 44 unmodified lines | |||
| 308 | .name = "default", | 308 | .name = "default", |
| 309 | .type = AVMEDIA_TYPE_AUDIO, | 309 | .type = AVMEDIA_TYPE_AUDIO, |
| 310 | .get_audio_buffer = ff_null_get_audio_buffer, | 310 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 311 | .filter_samples = add_to_queue, | 311 | .filter_frame = add_to_queue, |
| 312 | .min_perms = AV_PERM_PRESERVE, | 312 | .min_perms = AV_PERM_PRESERVE, |
| 313 | }, | 313 | }, |
| 314 | { NULL } | 314 | { NULL } |
| @@ -147,7 +147,7 @@ struct AVFilterPad { · 146 unmodified lines | |||
| 147 | * must ensure that samplesref is properly unreferenced on error if it | 147 | * must ensure that samplesref is properly unreferenced on error if it |
| 148 | * hasn't been passed on to another filter. | 148 | * hasn't been passed on to another filter. |
| 149 | */ | 149 | */ |
| 150 | int (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref); | 150 | int (*filter_frame)(AVFilterLink *link, AVFilterBufferRef *samplesref); |
| 151 | 151 | ||
| 152 | /** | 152 | /** |
| 153 | * Frame poll callback. This returns the number of immediately available | 153 | * Frame poll callback. This returns the number of immediately available |
| @@ -268,7 +268,7 @@ AVFilter avfilter_vsink_buffersink = { · 267 unmodified lines | |||
| 268 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | 268 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, |
| 269 | }; | 269 | }; |
| 270 | 270 | ||
| 271 | static int filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref) | 271 | static int filter_frame(AVFilterLink *link, AVFilterBufferRef *samplesref) |
| 272 | { | 272 | { |
| 273 | end_frame(link); | 273 | end_frame(link); |
| 274 | return 0; | 274 | return 0; |
| @@ -338,7 +338,7 @@ AVFilter avfilter_asink_ffabuffersink = { · 63 unmodified lines | |||
| 338 | 338 | ||
| 339 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 339 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 340 | .type = AVMEDIA_TYPE_AUDIO, | 340 | .type = AVMEDIA_TYPE_AUDIO, |
| 341 | .filter_samples = filter_samples, | 341 | .filter_frame = filter_frame, |
| 342 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, | 342 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, |
| 343 | { .name = NULL }}, | 343 | { .name = NULL }}, |
| 344 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | 344 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, |
| @@ -354,7 +354,7 @@ AVFilter avfilter_asink_abuffersink = { · 9 unmodified lines | |||
| 354 | 354 | ||
| 355 | .inputs = (const AVFilterPad[]) {{ .name = "default", | 355 | .inputs = (const AVFilterPad[]) {{ .name = "default", |
| 356 | .type = AVMEDIA_TYPE_AUDIO, | 356 | .type = AVMEDIA_TYPE_AUDIO, |
| 357 | .filter_samples = filter_samples, | 357 | .filter_frame = filter_frame, |
| 358 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, | 358 | .min_perms = AV_PERM_READ | AV_PERM_PRESERVE, }, |
| 359 | { .name = NULL }}, | 359 | { .name = NULL }}, |
| 360 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | 360 | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, |
| @@ -372,13 +372,13 @@ int av_buffersink_read(AVFilterContext *ctx, AVFilterBufferRef **buf) · 11 unmodified lines | |||
| 372 | 372 | ||
| 373 | if (ctx->filter-> inputs[0].start_frame == | 373 | if (ctx->filter-> inputs[0].start_frame == |
| 374 | avfilter_vsink_buffer. inputs[0].start_frame || | 374 | avfilter_vsink_buffer. inputs[0].start_frame || |
| 375 | ctx->filter-> inputs[0].filter_samples == | 375 | ctx->filter-> inputs[0].filter_frame == |
| 376 | avfilter_asink_abuffer.inputs[0].filter_samples) | 376 | avfilter_asink_abuffer.inputs[0].filter_frame) |
| 377 | return ff_buffersink_read_compat(ctx, buf); | 377 | return ff_buffersink_read_compat(ctx, buf); |
| 378 | av_assert0(ctx->filter-> inputs[0].end_frame == | 378 | av_assert0(ctx->filter-> inputs[0].end_frame == |
| 379 | avfilter_vsink_ffbuffersink. inputs[0].end_frame || | 379 | avfilter_vsink_ffbuffersink. inputs[0].end_frame || |
| 380 | ctx->filter-> inputs[0].filter_samples == | 380 | ctx->filter-> inputs[0].filter_frame == |
| 381 | avfilter_asink_ffabuffersink.inputs[0].filter_samples); | 381 | avfilter_asink_ffabuffersink.inputs[0].filter_frame); |
| 382 | 382 | ||
| 383 | ret = av_buffersink_get_buffer_ref(ctx, &tbuf, | 383 | ret = av_buffersink_get_buffer_ref(ctx, &tbuf, |
| 384 | buf ? 0 : AV_BUFFERSINK_FLAG_PEEK); | 384 | buf ? 0 : AV_BUFFERSINK_FLAG_PEEK); |
| @@ -399,11 +399,11 @@ int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **buf, · 14 unmodified lines | |||
| 399 | AVFilterLink *link = ctx->inputs[0]; | 399 | AVFilterLink *link = ctx->inputs[0]; |
| 400 | int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout); | 400 | int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout); |
| 401 | 401 | ||
| 402 | if (ctx->filter-> inputs[0].filter_samples == | 402 | if (ctx->filter-> inputs[0].filter_frame == |
| 403 | avfilter_asink_abuffer.inputs[0].filter_samples) | 403 | avfilter_asink_abuffer.inputs[0].filter_frame) |
| 404 | return ff_buffersink_read_samples_compat(ctx, buf, nb_samples); | 404 | return ff_buffersink_read_samples_compat(ctx, buf, nb_samples); |
| 405 | av_assert0(ctx->filter-> inputs[0].filter_samples == | 405 | av_assert0(ctx->filter-> inputs[0].filter_frame == |
| 406 | avfilter_asink_ffabuffersink.inputs[0].filter_samples); | 406 | avfilter_asink_ffabuffersink.inputs[0].filter_frame); |
| 407 | 407 | ||
| 408 | tbuf = ff_get_audio_buffer(link, AV_PERM_WRITE, nb_samples); | 408 | tbuf = ff_get_audio_buffer(link, AV_PERM_WRITE, nb_samples); |
| 409 | if (!tbuf) | 409 | if (!tbuf) |
| @@ -142,7 +142,7 @@ AVFilter avfilter_vf_split = { · 141 unmodified lines | |||
| 142 | .outputs = NULL, | 142 | .outputs = NULL, |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) | 145 | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *samplesref) |
| 146 | { | 146 | { |
| 147 | AVFilterContext *ctx = inlink->dst; | 147 | AVFilterContext *ctx = inlink->dst; |
| 148 | int i, ret = 0; | 148 | int i, ret = 0; |
| @@ -155,7 +155,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref) · 6 unmodified lines | |||
| 155 | break; | 155 | break; |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | ret = ff_filter_samples(inlink->dst->outputs[i], buf_out); | 158 | ret = ff_filter_frame(inlink->dst->outputs[i], buf_out); |
| 159 | if (ret < 0) | 159 | if (ret < 0) |
| 160 | break; | 160 | break; |
| 161 | } | 161 | } |
| @@ -168,7 +168,7 @@ static const AVFilterPad avfilter_af_asplit_inputs[] = { · 6 unmodified lines | |||
| 168 | .name = "default", | 168 | .name = "default", |
| 169 | .type = AVMEDIA_TYPE_AUDIO, | 169 | .type = AVMEDIA_TYPE_AUDIO, |
| 170 | .get_audio_buffer = ff_null_get_audio_buffer, | 170 | .get_audio_buffer = ff_null_get_audio_buffer, |
| 171 | .filter_samples = filter_samples | 171 | .filter_frame = filter_frame |
| 172 | }, | 172 | }, |
| 173 | { NULL } | 173 | { NULL } |
| 174 | }; | 174 | }; |
| @@ -577,7 +577,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id) · 576 unmodified lines | |||
| 577 | ff_end_frame(outlink); | 577 | ff_end_frame(outlink); |
| 578 | break; | 578 | break; |
| 579 | case AVMEDIA_TYPE_AUDIO: | 579 | case AVMEDIA_TYPE_AUDIO: |
| 580 | ff_filter_samples(outlink, buf); | 580 | ff_filter_frame(outlink, buf); |
| 581 | break; | 581 | break; |
| 582 | } | 582 | } |
| 583 | 583 | ||