History

avfilter: do not use AVFrame accessor

Muhammad Faiz committed 9 years ago

Commit 6af050d1 parent 8103c5952 files · +80 −80Browse files

Unified · Split

52 files
  1. libavfilter/af_afade.c +3 −3
  2. libavfilter/af_amerge.c +1 −1
  3. libavfilter/af_apad.c +1 −1
  4. libavfilter/af_aphaser.c +1 −1
  5. libavfilter/af_aresample.c +1 −1
  6. libavfilter/af_ashowinfo.c +3 −3
  7. libavfilter/af_astats.c +1 −1
  8. libavfilter/af_biquads.c +1 −1
  9. libavfilter/af_channelmap.c +1 −1
  10. libavfilter/af_channelsplit.c +1 −1
  11. libavfilter/af_dynaudnorm.c +3 −3
  12. libavfilter/af_join.c +1 −1
  13. libavfilter/af_pan.c +1 −1
  14. libavfilter/af_volume.c +1 −1
  15. libavfilter/af_volumedetect.c +1 −1
  16. libavfilter/asrc_flite.c +2 −2
  17. libavfilter/avf_aphasemeter.c +1 −1
  18. libavfilter/avf_showcqt.c +2 −2
  19. libavfilter/avf_showspectrum.c +1 −1
  20. libavfilter/avfilter.c +4 −4
  21. libavfilter/buffersrc.c +2 −2
  22. libavfilter/f_drawgraph.c +1 −1
  23. libavfilter/f_loop.c +2 −2
  24. libavfilter/f_metadata.c +1 −1
  25. libavfilter/f_select.c +3 −3
  26. libavfilter/fifo.c +1 −1
  27. libavfilter/framepool.c +1 −1
  28. libavfilter/setpts.c +1 −1
  29. libavfilter/src_movie.c +1 −1
  30. libavfilter/vf_bbox.c +1 −1
  31. libavfilter/vf_blackdetect.c +2 −2
  32. libavfilter/vf_blackframe.c +1 −1
  33. libavfilter/vf_colormatrix.c +6 −6
  34. libavfilter/vf_crop.c +2 −2
  35. libavfilter/vf_cropdetect.c +1 −1
  36. libavfilter/vf_deflicker.c +1 −1
  37. libavfilter/vf_deinterlace_vaapi.c +1 −1
  38. libavfilter/vf_drawtext.c +1 −1
  39. libavfilter/vf_eq.c +1 −1
  40. libavfilter/vf_idet.c +1 −1
  41. libavfilter/vf_ocr.c +1 −1
  42. libavfilter/vf_overlay.c +1 −1
  43. libavfilter/vf_psnr.c +1 −1
  44. libavfilter/vf_readeia608.c +2 −2
  45. libavfilter/vf_readvitc.c +2 −2
  46. libavfilter/vf_scale.c +4 −4
  47. libavfilter/vf_showinfo.c +1 −1
  48. libavfilter/vf_ssim.c +1 −1
  49. libavfilter/vf_swaprect.c +1 −1
  50. libavfilter/vf_vectorscope.c +1 −1
  51. libavfilter/vf_waveform.c +1 −1
  52. libavfilter/vsrc_testsrc.c +2 −2
libavfilter/af_afade.c+3−3
@@ -291,7 +291,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 290 unmodified lines
291 if ((!s->type && (cur_sample + nb_samples < s->start_sample)) ||291 if ((!s->type && (cur_sample + nb_samples < s->start_sample)) ||
292 ( s->type && (s->start_sample + s->nb_samples < cur_sample))) {292 ( s->type && (s->start_sample + s->nb_samples < cur_sample))) {
293 av_samples_set_silence(out_buf->extended_data, 0, nb_samples,293 av_samples_set_silence(out_buf->extended_data, 0, nb_samples,
294 av_frame_get_channels(out_buf), out_buf->format);294 out_buf->channels, out_buf->format);
295 } else {295 } else {
296 int64_t start;296 int64_t start;
297 297
@@ -301,7 +301,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 3 unmodified lines
301 start = s->start_sample + s->nb_samples - cur_sample;301 start = s->start_sample + s->nb_samples - cur_sample;
302 302
303 s->fade_samples(out_buf->extended_data, buf->extended_data,303 s->fade_samples(out_buf->extended_data, buf->extended_data,
304 nb_samples, av_frame_get_channels(buf),304 nb_samples, buf->channels,
305 s->type ? -1 : 1, start,305 s->type ? -1 : 1, start,
306 s->nb_samples, s->curve);306 s->nb_samples, s->curve);
307 }307 }
@@ -498,7 +498,7 @@ static int acrossfade_filter_frame(AVFilterLink *inlink, AVFrame *in) · 190 unmodified lines
498 498
499 s->crossfade_samples(out->extended_data, cf[0]->extended_data,499 s->crossfade_samples(out->extended_data, cf[0]->extended_data,
500 cf[1]->extended_data,500 cf[1]->extended_data,
501 s->nb_samples, av_frame_get_channels(in),501 s->nb_samples, in->channels,
502 s->curve, s->curve2);502 s->curve, s->curve2);
503 out->pts = s->pts;503 out->pts = s->pts;
504 s->pts += av_rescale_q(s->nb_samples,504 s->pts += av_rescale_q(s->nb_samples,
libavfilter/af_amerge.c+1−1
@@ -280,7 +280,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 279 unmodified lines
280 280
281 outbuf->nb_samples = nb_samples;281 outbuf->nb_samples = nb_samples;
282 outbuf->channel_layout = outlink->channel_layout;282 outbuf->channel_layout = outlink->channel_layout;
283 av_frame_set_channels(outbuf, outlink->channels);283 outbuf->channels = outlink->channels;
284 284
285 while (nb_samples) {285 while (nb_samples) {
286 ns = nb_samples;286 ns = nb_samples;
libavfilter/af_apad.c+1−1
@@ -119,7 +119,7 @@ static int request_frame(AVFilterLink *outlink) · 118 unmodified lines
119 119
120 av_samples_set_silence(outsamplesref->extended_data, 0,120 av_samples_set_silence(outsamplesref->extended_data, 0,
121 n_out,121 n_out,
122 av_frame_get_channels(outsamplesref),122 outsamplesref->channels,
123 outsamplesref->format);123 outsamplesref->format);
124 124
125 outsamplesref->pts = s->next_pts;125 outsamplesref->pts = s->next_pts;
libavfilter/af_aphaser.c+1−1
@@ -254,7 +254,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inbuf) · 253 unmodified lines
254 }254 }
255 255
256 s->phaser(s, inbuf->extended_data, outbuf->extended_data,256 s->phaser(s, inbuf->extended_data, outbuf->extended_data,
257 outbuf->nb_samples, av_frame_get_channels(outbuf));257 outbuf->nb_samples, outbuf->channels);
258 258
259 if (inbuf != outbuf)259 if (inbuf != outbuf)
260 av_frame_free(&inbuf);260 av_frame_free(&inbuf);
libavfilter/af_aresample.c+1−1
@@ -200,7 +200,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamplesref) · 199 unmodified lines
200 200
201 av_frame_copy_props(outsamplesref, insamplesref);201 av_frame_copy_props(outsamplesref, insamplesref);
202 outsamplesref->format = outlink->format;202 outsamplesref->format = outlink->format;
203 av_frame_set_channels(outsamplesref, outlink->channels);203 outsamplesref->channels = outlink->channels;
204 outsamplesref->channel_layout = outlink->channel_layout;204 outsamplesref->channel_layout = outlink->channel_layout;
205 outsamplesref->sample_rate = outlink->sample_rate;205 outsamplesref->sample_rate = outlink->sample_rate;
206 206
libavfilter/af_ashowinfo.c+3−3
@@ -199,7 +199,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 198 unmodified lines
199 s->plane_checksums[0];199 s->plane_checksums[0];
200 }200 }
201 201
202 av_get_channel_layout_string(chlayout_str, sizeof(chlayout_str), av_frame_get_channels(buf),202 av_get_channel_layout_string(chlayout_str, sizeof(chlayout_str), buf->channels,
203 buf->channel_layout);203 buf->channel_layout);
204 204
205 av_log(ctx, AV_LOG_INFO,205 av_log(ctx, AV_LOG_INFO,
@@ -208,8 +208,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 2 unmodified lines
208 "checksum:%08"PRIX32" ",208 "checksum:%08"PRIX32" ",
209 inlink->frame_count_out,209 inlink->frame_count_out,
210 av_ts2str(buf->pts), av_ts2timestr(buf->pts, &inlink->time_base),210 av_ts2str(buf->pts), av_ts2timestr(buf->pts, &inlink->time_base),
211 av_frame_get_pkt_pos(buf),211 buf->pkt_pos,
212 av_get_sample_fmt_name(buf->format), av_frame_get_channels(buf), chlayout_str,212 av_get_sample_fmt_name(buf->format), buf->channels, chlayout_str,
213 buf->sample_rate, buf->nb_samples,213 buf->sample_rate, buf->nb_samples,
214 checksum);214 checksum);
215 215
libavfilter/af_astats.c+1−1
@@ -305,7 +305,7 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 304 unmodified lines
305static int filter_frame(AVFilterLink *inlink, AVFrame *buf)305static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
306{306{
307 AudioStatsContext *s = inlink->dst->priv;307 AudioStatsContext *s = inlink->dst->priv;
308 AVDictionary **metadata = avpriv_frame_get_metadatap(buf);308 AVDictionary **metadata = &buf->metadata;
309 const int channels = s->nb_channels;309 const int channels = s->nb_channels;
310 int i, c;310 int i, c;
311 311
libavfilter/af_biquads.c+1−1
@@ -411,7 +411,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 410 unmodified lines
411 av_frame_copy_props(out_buf, buf);411 av_frame_copy_props(out_buf, buf);
412 }412 }
413 413
414 for (ch = 0; ch < av_frame_get_channels(buf); ch++)414 for (ch = 0; ch < buf->channels; ch++)
415 s->filter(s, buf->extended_data[ch],415 s->filter(s, buf->extended_data[ch],
416 out_buf->extended_data[ch], nb_samples,416 out_buf->extended_data[ch], nb_samples,
417 &s->cache[ch].i1, &s->cache[ch].i2,417 &s->cache[ch].i1, &s->cache[ch].i2,
libavfilter/af_channelmap.c+1−1
@@ -354,7 +354,7 @@ static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) · 353 unmodified lines
354 FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0]));354 FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0]));
355 355
356 buf->channel_layout = outlink->channel_layout;356 buf->channel_layout = outlink->channel_layout;
357 av_frame_set_channels(buf, outlink->channels);357 buf->channels = outlink->channels;
358 358
359 return ff_filter_frame(outlink, buf);359 return ff_filter_frame(outlink, buf);
360}360}
libavfilter/af_channelsplit.c+1−1
@@ -120,7 +120,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 119 unmodified lines
120 buf_out->data[0] = buf_out->extended_data[0] = buf_out->extended_data[i];120 buf_out->data[0] = buf_out->extended_data[0] = buf_out->extended_data[i];
121 buf_out->channel_layout =121 buf_out->channel_layout =
122 av_channel_layout_extract_channel(buf->channel_layout, i);122 av_channel_layout_extract_channel(buf->channel_layout, i);
123 av_frame_set_channels(buf_out, 1);123 buf_out->channels = 1;
124 124
125 ret = ff_filter_frame(ctx->outputs[i], buf_out);125 ret = ff_filter_frame(ctx->outputs[i], buf_out);
126 if (ret < 0)126 if (ret < 0)
libavfilter/af_dynaudnorm.c+3−3
@@ -358,7 +358,7 @@ static double find_peak_magnitude(AVFrame *frame, int channel) · 357 unmodified lines
358 int c, i;358 int c, i;
359 359
360 if (channel == -1) {360 if (channel == -1) {
361 for (c = 0; c < av_frame_get_channels(frame); c++) {361 for (c = 0; c < frame->channels; c++) {
362 double *data_ptr = (double *)frame->extended_data[c];362 double *data_ptr = (double *)frame->extended_data[c];
363 363
364 for (i = 0; i < frame->nb_samples; i++)364 for (i = 0; i < frame->nb_samples; i++)
@@ -380,7 +380,7 @@ static double compute_frame_rms(AVFrame *frame, int channel) · 15 unmodified lines
380 int c, i;380 int c, i;
381 381
382 if (channel == -1) {382 if (channel == -1) {
383 for (c = 0; c < av_frame_get_channels(frame); c++) {383 for (c = 0; c < frame->channels; c++) {
384 const double *data_ptr = (double *)frame->extended_data[c];384 const double *data_ptr = (double *)frame->extended_data[c];
385 385
386 for (i = 0; i < frame->nb_samples; i++) {386 for (i = 0; i < frame->nb_samples; i++) {
@@ -388,7 +388,7 @@ static double compute_frame_rms(AVFrame *frame, int channel) · 1 unmodified line
388 }388 }
389 }389 }
390 390
391 rms_value /= frame->nb_samples * av_frame_get_channels(frame);391 rms_value /= frame->nb_samples * frame->channels;
392 } else {392 } else {
393 const double *data_ptr = (double *)frame->extended_data[channel];393 const double *data_ptr = (double *)frame->extended_data[channel];
394 for (i = 0; i < frame->nb_samples; i++) {394 for (i = 0; i < frame->nb_samples; i++) {
libavfilter/af_join.c+1−1
@@ -491,7 +491,7 @@ static int try_push_frame(AVFilterContext *ctx) · 490 unmodified lines
491 491
492 frame->nb_samples = nb_samples;492 frame->nb_samples = nb_samples;
493 frame->channel_layout = outlink->channel_layout;493 frame->channel_layout = outlink->channel_layout;
494 av_frame_set_channels(frame, outlink->channels);494 frame->channels = outlink->channels;
495 frame->sample_rate = outlink->sample_rate;495 frame->sample_rate = outlink->sample_rate;
496 frame->format = outlink->format;496 frame->format = outlink->format;
497 frame->pts = s->input_frames[0]->pts;497 frame->pts = s->input_frames[0]->pts;
libavfilter/af_pan.c+1−1
@@ -389,7 +389,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 388 unmodified lines
389 (void *)insamples->extended_data, n);389 (void *)insamples->extended_data, n);
390 av_frame_copy_props(outsamples, insamples);390 av_frame_copy_props(outsamples, insamples);
391 outsamples->channel_layout = outlink->channel_layout;391 outsamples->channel_layout = outlink->channel_layout;
392 av_frame_set_channels(outsamples, outlink->channels);392 outsamples->channels = outlink->channels;
393 393
394 ret = ff_filter_frame(outlink, outsamples);394 ret = ff_filter_frame(outlink, outsamples);
395 av_frame_free(&insamples);395 av_frame_free(&insamples);
libavfilter/af_volume.c+1−1
@@ -395,7 +395,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 394 unmodified lines
395 vol->var_values[VAR_T ] = TS2T(buf->pts, inlink->time_base);395 vol->var_values[VAR_T ] = TS2T(buf->pts, inlink->time_base);
396 vol->var_values[VAR_N ] = inlink->frame_count_out;396 vol->var_values[VAR_N ] = inlink->frame_count_out;
397 397
398 pos = av_frame_get_pkt_pos(buf);398 pos = buf->pkt_pos;
399 vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;399 vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;
400 if (vol->eval_mode == EVAL_MODE_FRAME)400 if (vol->eval_mode == EVAL_MODE_FRAME)
401 set_volume(ctx);401 set_volume(ctx);
libavfilter/af_volumedetect.c+1−1
@@ -62,7 +62,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *samples) · 61 unmodified lines
62 AVFilterContext *ctx = inlink->dst;62 AVFilterContext *ctx = inlink->dst;
63 VolDetectContext *vd = ctx->priv;63 VolDetectContext *vd = ctx->priv;
64 int nb_samples = samples->nb_samples;64 int nb_samples = samples->nb_samples;
65 int nb_channels = av_frame_get_channels(samples);65 int nb_channels = samples->channels;
66 int nb_planes = nb_channels;66 int nb_planes = nb_channels;
67 int plane, i;67 int plane, i;
68 int16_t *pcm;68 int16_t *pcm;
libavfilter/asrc_flite.c+2−2
@@ -255,8 +255,8 @@ static int request_frame(AVFilterLink *outlink) · 254 unmodified lines
255 memcpy(samplesref->data[0], flite->wave_samples,255 memcpy(samplesref->data[0], flite->wave_samples,
256 nb_samples * flite->wave->num_channels * 2);256 nb_samples * flite->wave->num_channels * 2);
257 samplesref->pts = flite->pts;257 samplesref->pts = flite->pts;
258 av_frame_set_pkt_pos(samplesref, -1);258 samplesref->pkt_pos = -1;
259 av_frame_set_sample_rate(samplesref, flite->wave->sample_rate);259 samplesref->sample_rate = flite->wave->sample_rate;
260 flite->pts += nb_samples;260 flite->pts += nb_samples;
261 flite->wave_samples += nb_samples * flite->wave->num_channels;261 flite->wave_samples += nb_samples * flite->wave->num_channels;
262 flite->wave_nb_samples -= nb_samples;262 flite->wave_nb_samples -= nb_samples;
libavfilter/avf_aphasemeter.c+1−1
@@ -204,7 +204,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 203 unmodified lines
204 memcpy(out->data[0] + i * out->linesize[0], out->data[0], outlink->w * 4);204 memcpy(out->data[0] + i * out->linesize[0], out->data[0], outlink->w * 4);
205 }205 }
206 206
207 metadata = avpriv_frame_get_metadatap(in);207 metadata = &in->metadata;
208 if (metadata) {208 if (metadata) {
209 uint8_t value[128];209 uint8_t value[128];
210 210
libavfilter/avf_showcqt.c+2−2
@@ -1169,8 +1169,8 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout) · 1168 unmodified lines
1169 if (!out)1169 if (!out)
1170 return AVERROR(ENOMEM);1170 return AVERROR(ENOMEM);
1171 out->sample_aspect_ratio = av_make_q(1, 1);1171 out->sample_aspect_ratio = av_make_q(1, 1);
1172 av_frame_set_color_range(out, AVCOL_RANGE_MPEG);1172 out->color_range = AVCOL_RANGE_MPEG;
1173 av_frame_set_colorspace(out, s->csp);1173 out->colorspace = s->csp;
1174 UPDATE_TIME(s->alloc_time);1174 UPDATE_TIME(s->alloc_time);
1175 1175
1176 if (s->bar_h) {1176 if (s->bar_h) {
libavfilter/avf_showspectrum.c+1−1
@@ -426,7 +426,7 @@ static int config_output(AVFilterLink *outlink) · 425 unmodified lines
426 memset(outpicref->data[1] + i * outpicref->linesize[1], 128, outlink->w);426 memset(outpicref->data[1] + i * outpicref->linesize[1], 128, outlink->w);
427 memset(outpicref->data[2] + i * outpicref->linesize[2], 128, outlink->w);427 memset(outpicref->data[2] + i * outpicref->linesize[2], 128, outlink->w);
428 }428 }
429 av_frame_set_color_range(outpicref, AVCOL_RANGE_JPEG);429 outpicref->color_range = AVCOL_RANGE_JPEG;
430 }430 }
431 431
432 if ((s->orientation == VERTICAL && s->xpos >= s->w) ||432 if ((s->orientation == VERTICAL && s->xpos >= s->w) ||
libavfilter/avfilter.c+4−4
@@ -53,7 +53,7 @@ void ff_tlog_ref(void *ctx, AVFrame *ref, int end) · 52 unmodified lines
53 "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,53 "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
54 ref, ref->buf, ref->data[0],54 ref, ref->buf, ref->data[0],
55 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],55 ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3],
56 ref->pts, av_frame_get_pkt_pos(ref));56 ref->pts, ref->pkt_pos);
57 57
58 if (ref->width) {58 if (ref->width) {
59 ff_tlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",59 ff_tlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c",
@@ -1143,7 +1143,7 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame) · 1083 unmodified lines
1143 av_log(link->dst, AV_LOG_ERROR, "Format change is not supported\n");1143 av_log(link->dst, AV_LOG_ERROR, "Format change is not supported\n");
1144 goto error;1144 goto error;
1145 }1145 }
1146 if (av_frame_get_channels(frame) != link->channels) {1146 if (frame->channels != link->channels) {
1147 av_log(link->dst, AV_LOG_ERROR, "Channel count change is not supported\n");1147 av_log(link->dst, AV_LOG_ERROR, "Channel count change is not supported\n");
1148 goto error;1148 goto error;
1149 }1149 }
@@ -1585,7 +1585,7 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe) · 435 unmodified lines
1585 case AVMEDIA_TYPE_AUDIO:1585 case AVMEDIA_TYPE_AUDIO:
1586 av_samples_copy(out->extended_data, frame->extended_data,1586 av_samples_copy(out->extended_data, frame->extended_data,
1587 0, 0, frame->nb_samples,1587 0, 0, frame->nb_samples,
1588 av_frame_get_channels(frame),1588 frame->channels,
1589 frame->format);1589 frame->format);
1590 break;1590 break;
1591 default:1591 default:
@@ -1616,7 +1616,7 @@ int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *fram · 24 unmodified lines
1616{1616{
1617 AVFilterContext *dstctx = link->dst;1617 AVFilterContext *dstctx = link->dst;
1618 int64_t pts = frame->pts;1618 int64_t pts = frame->pts;
1619 int64_t pos = av_frame_get_pkt_pos(frame);1619 int64_t pos = frame->pkt_pos;
1620 1620
1621 if (!dstctx->enable_str)1621 if (!dstctx->enable_str)
1622 return 1;1622 return 1;
libavfilter/buffersrc.c+2−2
@@ -155,7 +155,7 @@ int attribute_align_arg av_buffersrc_add_frame_flags(AVFilterContext *ctx, AVFra · 154 unmodified lines
155 int ret = 0;155 int ret = 0;
156 156
157 if (frame && frame->channel_layout &&157 if (frame && frame->channel_layout &&
158 av_get_channel_layout_nb_channels(frame->channel_layout) != av_frame_get_channels(frame)) {158 av_get_channel_layout_nb_channels(frame->channel_layout) != frame->channels) {
159 av_log(ctx, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");159 av_log(ctx, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
160 return AVERROR(EINVAL);160 return AVERROR(EINVAL);
161 }161 }
@@ -222,7 +222,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, · 60 unmodified lines
222 if (!frame->channel_layout)222 if (!frame->channel_layout)
223 frame->channel_layout = s->channel_layout;223 frame->channel_layout = s->channel_layout;
224 CHECK_AUDIO_PARAM_CHANGE(ctx, s, frame->sample_rate, frame->channel_layout,224 CHECK_AUDIO_PARAM_CHANGE(ctx, s, frame->sample_rate, frame->channel_layout,
225 av_frame_get_channels(frame), frame->format);225 frame->channels, frame->format);
226 break;226 break;
227 default:227 default:
228 return AVERROR(EINVAL);228 return AVERROR(EINVAL);
libavfilter/f_drawgraph.c+1−1
@@ -200,7 +200,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 199 unmodified lines
200 av_frame_copy_props(out, in);200 av_frame_copy_props(out, in);
201 }201 }
202 202
203 metadata = av_frame_get_metadata(in);203 metadata = in->metadata;
204 204
205 for (i = 0; i < 4; i++) {205 for (i = 0; i < 4; i++) {
206 double values[VAR_VARS_NB];206 double values[VAR_VARS_NB];
libavfilter/f_loop.c+2−2
@@ -275,7 +275,7 @@ static int push_frame(AVFilterContext *ctx) · 274 unmodified lines
275 if (!out)275 if (!out)
276 return AVERROR(ENOMEM);276 return AVERROR(ENOMEM);
277 out->pts += s->duration - s->start_pts;277 out->pts += s->duration - s->start_pts;
278 pts = out->pts + av_frame_get_pkt_duration(out);278 pts = out->pts + out->pkt_duration;
279 ret = ff_filter_frame(outlink, out);279 ret = ff_filter_frame(outlink, out);
280 s->current_frame++;280 s->current_frame++;
281 281
@@ -307,7 +307,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 25 unmodified lines
307 return AVERROR(ENOMEM);307 return AVERROR(ENOMEM);
308 }308 }
309 s->nb_frames++;309 s->nb_frames++;
310 s->duration = frame->pts + av_frame_get_pkt_duration(frame);310 s->duration = frame->pts + frame->pkt_duration;
311 ret = ff_filter_frame(outlink, frame);311 ret = ff_filter_frame(outlink, frame);
312 } else {312 } else {
313 av_frame_free(&frame);313 av_frame_free(&frame);
libavfilter/f_metadata.c+1−1
@@ -280,7 +280,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 279 unmodified lines
280 AVFilterContext *ctx = inlink->dst;280 AVFilterContext *ctx = inlink->dst;
281 AVFilterLink *outlink = ctx->outputs[0];281 AVFilterLink *outlink = ctx->outputs[0];
282 MetadataContext *s = ctx->priv;282 MetadataContext *s = ctx->priv;
283 AVDictionary **metadata = avpriv_frame_get_metadatap(frame);283 AVDictionary **metadata = &frame->metadata;
284 AVDictionaryEntry *e;284 AVDictionaryEntry *e;
285 285
286 if (!*metadata)286 if (!*metadata)
libavfilter/f_select.c+3−3
@@ -284,7 +284,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) · 283 unmodified lines
284 284
285static double get_concatdec_select(AVFrame *frame, int64_t pts)285static double get_concatdec_select(AVFrame *frame, int64_t pts)
286{286{
287 AVDictionary *metadata = av_frame_get_metadata(frame);287 AVDictionary *metadata = frame->metadata;
288 AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0);288 AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0);
289 AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0);289 AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0);
290 if (start_time_entry) {290 if (start_time_entry) {
@@ -321,7 +321,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame) · 30 unmodified lines
321 select->var_values[VAR_N ] = inlink->frame_count_out;321 select->var_values[VAR_N ] = inlink->frame_count_out;
322 select->var_values[VAR_PTS] = TS2D(frame->pts);322 select->var_values[VAR_PTS] = TS2D(frame->pts);
323 select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base);323 select->var_values[VAR_T ] = TS2D(frame->pts) * av_q2d(inlink->time_base);
324 select->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ? NAN : av_frame_get_pkt_pos(frame);324 select->var_values[VAR_POS] = frame->pkt_pos == -1 ? NAN : frame->pkt_pos;
325 select->var_values[VAR_KEY] = frame->key_frame;325 select->var_values[VAR_KEY] = frame->key_frame;
326 select->var_values[VAR_CONCATDEC_SELECT] = get_concatdec_select(frame, av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q));326 select->var_values[VAR_CONCATDEC_SELECT] = get_concatdec_select(frame, av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q));
327 327
@@ -340,7 +340,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame) · 12 unmodified lines
340 select->var_values[VAR_SCENE] = get_scene_score(ctx, frame);340 select->var_values[VAR_SCENE] = get_scene_score(ctx, frame);
341 // TODO: document metadata341 // TODO: document metadata
342 snprintf(buf, sizeof(buf), "%f", select->var_values[VAR_SCENE]);342 snprintf(buf, sizeof(buf), "%f", select->var_values[VAR_SCENE]);
343 av_dict_set(avpriv_frame_get_metadatap(frame), "lavfi.scene_score", buf, 0);343 av_dict_set(&frame->metadata, "lavfi.scene_score", buf, 0);
344 }344 }
345 break;345 break;
346 }346 }
libavfilter/fifo.c+1−1
@@ -129,7 +129,7 @@ static void buffer_offset(AVFilterLink *link, AVFrame *frame, · 128 unmodified lines
129static int calc_ptr_alignment(AVFrame *frame)129static int calc_ptr_alignment(AVFrame *frame)
130{130{
131 int planes = av_sample_fmt_is_planar(frame->format) ?131 int planes = av_sample_fmt_is_planar(frame->format) ?
132 av_frame_get_channels(frame) : 1;132 frame->channels : 1;
133 int min_align = 128;133 int min_align = 128;
134 int p;134 int p;
135 135
libavfilter/framepool.c+1−1
@@ -240,7 +240,7 @@ AVFrame *ff_frame_pool_get(FFFramePool *pool) · 239 unmodified lines
240 break;240 break;
241 case AVMEDIA_TYPE_AUDIO:241 case AVMEDIA_TYPE_AUDIO:
242 frame->nb_samples = pool->nb_samples;242 frame->nb_samples = pool->nb_samples;
243 av_frame_set_channels(frame, pool->channels);243 frame->channels = pool->channels;
244 frame->format = pool->format;244 frame->format = pool->format;
245 frame->linesize[0] = pool->linesize[0];245 frame->linesize[0] = pool->linesize[0];
246 246
libavfilter/setpts.c+1−1
@@ -165,7 +165,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 164 unmodified lines
165 }165 }
166 setpts->var_values[VAR_PTS ] = TS2D(frame->pts);166 setpts->var_values[VAR_PTS ] = TS2D(frame->pts);
167 setpts->var_values[VAR_T ] = TS2T(frame->pts, inlink->time_base);167 setpts->var_values[VAR_T ] = TS2T(frame->pts, inlink->time_base);
168 setpts->var_values[VAR_POS ] = av_frame_get_pkt_pos(frame) == -1 ? NAN : av_frame_get_pkt_pos(frame);168 setpts->var_values[VAR_POS ] = frame->pkt_pos == -1 ? NAN : frame->pkt_pos;
169 setpts->var_values[VAR_RTCTIME ] = av_gettime();169 setpts->var_values[VAR_RTCTIME ] = av_gettime();
170 170
171 if (inlink->type == AVMEDIA_TYPE_VIDEO) {171 if (inlink->type == AVMEDIA_TYPE_VIDEO) {
libavfilter/src_movie.c+1−1
@@ -559,7 +559,7 @@ static int movie_push_frame(AVFilterContext *ctx, unsigned out_id) · 558 unmodified lines
559 return 0;559 return 0;
560 }560 }
561 561
562 frame->pts = av_frame_get_best_effort_timestamp(frame);562 frame->pts = frame->best_effort_timestamp;
563 if (frame->pts != AV_NOPTS_VALUE) {563 if (frame->pts != AV_NOPTS_VALUE) {
564 if (movie->ts_offset)564 if (movie->ts_offset)
565 frame->pts += av_rescale_q_rnd(movie->ts_offset, AV_TIME_BASE_Q, outlink->time_base, AV_ROUND_UP);565 frame->pts += av_rescale_q_rnd(movie->ts_offset, AV_TIME_BASE_Q, outlink->time_base, AV_ROUND_UP);
libavfilter/vf_bbox.c+1−1
@@ -84,7 +84,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 83 unmodified lines
84 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base));84 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base));
85 85
86 if (has_bbox) {86 if (has_bbox) {
87 AVDictionary **metadata = avpriv_frame_get_metadatap(frame);87 AVDictionary **metadata = &frame->metadata;
88 88
89 SET_META("lavfi.bbox.x1", box.x1)89 SET_META("lavfi.bbox.x1", box.x1)
90 SET_META("lavfi.bbox.x2", box.x2)90 SET_META("lavfi.bbox.x2", box.x2)
libavfilter/vf_blackdetect.c+2−2
@@ -164,7 +164,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 163 unmodified lines
164 /* black starts here */164 /* black starts here */
165 blackdetect->black_started = 1;165 blackdetect->black_started = 1;
166 blackdetect->black_start = picref->pts;166 blackdetect->black_start = picref->pts;
167 av_dict_set(avpriv_frame_get_metadatap(picref), "lavfi.black_start",167 av_dict_set(&picref->metadata, "lavfi.black_start",
168 av_ts2timestr(blackdetect->black_start, &inlink->time_base), 0);168 av_ts2timestr(blackdetect->black_start, &inlink->time_base), 0);
169 }169 }
170 } else if (blackdetect->black_started) {170 } else if (blackdetect->black_started) {
@@ -172,7 +172,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 1 unmodified line
172 blackdetect->black_started = 0;172 blackdetect->black_started = 0;
173 blackdetect->black_end = picref->pts;173 blackdetect->black_end = picref->pts;
174 check_black_end(ctx);174 check_black_end(ctx);
175 av_dict_set(avpriv_frame_get_metadatap(picref), "lavfi.black_end",175 av_dict_set(&picref->metadata, "lavfi.black_end",
176 av_ts2timestr(blackdetect->black_end, &inlink->time_base), 0);176 av_ts2timestr(blackdetect->black_end, &inlink->time_base), 0);
177 }177 }
178 178
libavfilter/vf_blackframe.c+1−1
@@ -85,7 +85,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 84 unmodified lines
85 85
86 pblack = s->nblack * 100 / (inlink->w * inlink->h);86 pblack = s->nblack * 100 / (inlink->w * inlink->h);
87 if (pblack >= s->bamount) {87 if (pblack >= s->bamount) {
88 metadata = avpriv_frame_get_metadatap(frame);88 metadata = &frame->metadata;
89 89
90 av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f "90 av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f "
91 "type:%c last_keyframe:%d\n",91 "type:%c last_keyframe:%d\n",
libavfilter/vf_colormatrix.c+6−6
@@ -435,7 +435,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 434 unmodified lines
435 av_frame_copy_props(out, in);435 av_frame_copy_props(out, in);
436 436
437 if (color->source == COLOR_MODE_NONE) {437 if (color->source == COLOR_MODE_NONE) {
438 enum AVColorSpace cs = av_frame_get_colorspace(in);438 enum AVColorSpace cs = in->colorspace;
439 enum ColorMode source;439 enum ColorMode source;
440 440
441 switch(cs) {441 switch(cs) {
@@ -456,11 +456,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 14 unmodified lines
456 color->mode = color->source * 5 + color->dest;456 color->mode = color->source * 5 + color->dest;
457 457
458 switch(color->dest) {458 switch(color->dest) {
459 case COLOR_MODE_BT709 : av_frame_set_colorspace(out, AVCOL_SPC_BT709) ; break;459 case COLOR_MODE_BT709 : out->colorspace = AVCOL_SPC_BT709 ; break;
460 case COLOR_MODE_FCC : av_frame_set_colorspace(out, AVCOL_SPC_FCC) ; break;460 case COLOR_MODE_FCC : out->colorspace = AVCOL_SPC_FCC ; break;
461 case COLOR_MODE_SMPTE240M: av_frame_set_colorspace(out, AVCOL_SPC_SMPTE240M) ; break;461 case COLOR_MODE_SMPTE240M: out->colorspace = AVCOL_SPC_SMPTE240M ; break;
462 case COLOR_MODE_BT601 : av_frame_set_colorspace(out, AVCOL_SPC_BT470BG) ; break;462 case COLOR_MODE_BT601 : out->colorspace = AVCOL_SPC_BT470BG ; break;
463 case COLOR_MODE_BT2020 : av_frame_set_colorspace(out, AVCOL_SPC_BT2020_NCL); break;463 case COLOR_MODE_BT2020 : out->colorspace = AVCOL_SPC_BT2020_NCL; break;
464 }464 }
465 465
466 td.src = in;466 td.src = in;
libavfilter/vf_crop.c+2−2
@@ -258,8 +258,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) · 257 unmodified lines
258 s->var_values[VAR_N] = link->frame_count_out;258 s->var_values[VAR_N] = link->frame_count_out;
259 s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?259 s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
260 NAN : frame->pts * av_q2d(link->time_base);260 NAN : frame->pts * av_q2d(link->time_base);
261 s->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ?261 s->var_values[VAR_POS] = frame->pkt_pos == -1 ?
262 NAN : av_frame_get_pkt_pos(frame);262 NAN : frame->pkt_pos;
263 s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);263 s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
264 s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);264 s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);
265 s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);265 s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
libavfilter/vf_cropdetect.c+1−1
@@ -169,7 +169,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 168 unmodified lines
169 169
170 // ignore first 2 frames - they may be empty170 // ignore first 2 frames - they may be empty
171 if (++s->frame_nb > 0) {171 if (++s->frame_nb > 0) {
172 metadata = avpriv_frame_get_metadatap(frame);172 metadata = &frame->metadata;
173 173
174 // Reset the crop area every reset_count frames, if reset_count is > 0174 // Reset the crop area every reset_count frames, if reset_count is > 0
175 if (s->reset_count > 0 && s->frame_nb > s->reset_count) {175 if (s->reset_count > 0 && s->frame_nb > s->reset_count) {
libavfilter/vf_deflicker.c+1−1
@@ -386,7 +386,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 385 unmodified lines
386 }386 }
387 387
388 av_frame_copy_props(out, in);388 av_frame_copy_props(out, in);
389 metadata = avpriv_frame_get_metadatap(out);389 metadata = &out->metadata;
390 if (metadata) {390 if (metadata) {
391 uint8_t value[128];391 uint8_t value[128];
392 392
libavfilter/vf_deinterlace_vaapi.c+1−1
@@ -446,7 +446,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) · 445 unmodified lines
446 params.surface = input_surface;446 params.surface = input_surface;
447 params.surface_region = &input_region;447 params.surface_region = &input_region;
448 params.surface_color_standard = vaapi_proc_colour_standard(448 params.surface_color_standard = vaapi_proc_colour_standard(
449 av_frame_get_colorspace(input_frame));449 input_frame->colorspace);
450 450
451 params.output_region = NULL;451 params.output_region = NULL;
452 params.output_background_color = 0xff000000;452 params.output_background_color = 0xff000000;
libavfilter/vf_drawtext.c+1−1
@@ -1452,7 +1452,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 1451 unmodified lines
1452 NAN : frame->pts * av_q2d(inlink->time_base);1452 NAN : frame->pts * av_q2d(inlink->time_base);
1453 1453
1454 s->var_values[VAR_PICT_TYPE] = frame->pict_type;1454 s->var_values[VAR_PICT_TYPE] = frame->pict_type;
1455 s->metadata = av_frame_get_metadata(frame);1455 s->metadata = frame->metadata;
1456 1456
1457 draw_text(ctx, frame, frame->width, frame->height);1457 draw_text(ctx, frame, frame->width, frame->height);
1458 1458
libavfilter/vf_eq.c+1−1
@@ -254,7 +254,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 253 unmodified lines
254 AVFilterLink *outlink = inlink->dst->outputs[0];254 AVFilterLink *outlink = inlink->dst->outputs[0];
255 EQContext *eq = ctx->priv;255 EQContext *eq = ctx->priv;
256 AVFrame *out;256 AVFrame *out;
257 int64_t pos = av_frame_get_pkt_pos(in);257 int64_t pos = in->pkt_pos;
258 const AVPixFmtDescriptor *desc;258 const AVPixFmtDescriptor *desc;
259 int i;259 int i;
260 260
libavfilter/vf_idet.c+1−1
@@ -120,7 +120,7 @@ static void filter(AVFilterContext *ctx) · 119 unmodified lines
120 Type type, best_type;120 Type type, best_type;
121 RepeatedField repeat;121 RepeatedField repeat;
122 int match = 0;122 int match = 0;
123 AVDictionary **metadata = avpriv_frame_get_metadatap(idet->cur);123 AVDictionary **metadata = &idet->cur->metadata;
124 124
125 for (i = 0; i < idet->csp->nb_components; i++) {125 for (i = 0; i < idet->csp->nb_components; i++) {
126 int w = idet->cur->width;126 int w = idet->cur->width;
libavfilter/vf_ocr.c+1−1
@@ -97,7 +97,7 @@ static int query_formats(AVFilterContext *ctx) · 96 unmodified lines
97 97
98static int filter_frame(AVFilterLink *inlink, AVFrame *in)98static int filter_frame(AVFilterLink *inlink, AVFrame *in)
99{99{
100 AVDictionary **metadata = avpriv_frame_get_metadatap(in);100 AVDictionary **metadata = &in->metadata;
101 AVFilterContext *ctx = inlink->dst;101 AVFilterContext *ctx = inlink->dst;
102 AVFilterLink *outlink = ctx->outputs[0];102 AVFilterLink *outlink = ctx->outputs[0];
103 OCRContext *s = ctx->priv;103 OCRContext *s = ctx->priv;
libavfilter/vf_overlay.c+1−1
@@ -715,7 +715,7 @@ static AVFrame *do_blend(AVFilterContext *ctx, AVFrame *mainpic, · 714 unmodified lines
715 AVFilterLink *inlink = ctx->inputs[0];715 AVFilterLink *inlink = ctx->inputs[0];
716 716
717 if (s->eval_mode == EVAL_MODE_FRAME) {717 if (s->eval_mode == EVAL_MODE_FRAME) {
718 int64_t pos = av_frame_get_pkt_pos(mainpic);718 int64_t pos = mainpic->pkt_pos;
719 719
720 s->var_values[VAR_N] = inlink->frame_count_out;720 s->var_values[VAR_N] = inlink->frame_count_out;
721 s->var_values[VAR_T] = mainpic->pts == AV_NOPTS_VALUE ?721 s->var_values[VAR_T] = mainpic->pts == AV_NOPTS_VALUE ?
libavfilter/vf_psnr.c+1−1
@@ -148,7 +148,7 @@ static AVFrame *do_psnr(AVFilterContext *ctx, AVFrame *main, · 147 unmodified lines
148 PSNRContext *s = ctx->priv;148 PSNRContext *s = ctx->priv;
149 double comp_mse[4], mse = 0;149 double comp_mse[4], mse = 0;
150 int j, c;150 int j, c;
151 AVDictionary **metadata = avpriv_frame_get_metadatap(main);151 AVDictionary **metadata = &main->metadata;
152 152
153 compute_images_mse(s, (const uint8_t **)main->data, main->linesize,153 compute_images_mse(s, (const uint8_t **)main->data, main->linesize,
154 (const uint8_t **)ref->data, ref->linesize,154 (const uint8_t **)ref->data, ref->linesize,
libavfilter/vf_readeia608.c+2−2
@@ -214,11 +214,11 @@ static void extract_line(AVFilterContext *ctx, AVFilterLink *inlink, AVFrame *in · 213 unmodified lines
214 214
215 snprintf(key, sizeof(key), "lavfi.readeia608.%d.cc", s->nb_found);215 snprintf(key, sizeof(key), "lavfi.readeia608.%d.cc", s->nb_found);
216 snprintf(value, sizeof(value), "0x%02X%02X", byte[0], byte[1]);216 snprintf(value, sizeof(value), "0x%02X%02X", byte[0], byte[1]);
217 av_dict_set(avpriv_frame_get_metadatap(in), key, value, 0);217 av_dict_set(&in->metadata, key, value, 0);
218 218
219 snprintf(key, sizeof(key), "lavfi.readeia608.%d.line", s->nb_found);219 snprintf(key, sizeof(key), "lavfi.readeia608.%d.line", s->nb_found);
220 snprintf(value, sizeof(value), "%d", line);220 snprintf(value, sizeof(value), "%d", line);
221 av_dict_set(avpriv_frame_get_metadatap(in), key, value, 0);221 av_dict_set(&in->metadata, key, value, 0);
222 }222 }
223 223
224 s->nb_found++;224 s->nb_found++;
libavfilter/vf_readvitc.c+2−2
@@ -221,9 +221,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 220 unmodified lines
221 int found;221 int found;
222 222
223 found = read_vitc_line(s, frame->data[0], frame->linesize[0], inlink->w, inlink->h);223 found = read_vitc_line(s, frame->data[0], frame->linesize[0], inlink->w, inlink->h);
224 av_dict_set(avpriv_frame_get_metadatap(frame), "lavfi.readvitc.found", (found ? "1" : "0"), 0);224 av_dict_set(&frame->metadata, "lavfi.readvitc.found", (found ? "1" : "0"), 0);
225 if (found)225 if (found)
226 av_dict_set(avpriv_frame_get_metadatap(frame), "lavfi.readvitc.tc_str", make_vitc_tc_string(s->tcbuf, s->line_data), 0);226 av_dict_set(&frame->metadata, "lavfi.readvitc.tc_str", make_vitc_tc_string(s->tcbuf, s->line_data), 0);
227 227
228 return ff_filter_frame(outlink, frame);228 return ff_filter_frame(outlink, frame);
229}229}
libavfilter/vf_scale.c+4−4
@@ -409,7 +409,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 408 unmodified lines
409 char buf[32];409 char buf[32];
410 int in_range;410 int in_range;
411 411
412 if (av_frame_get_colorspace(in) == AVCOL_SPC_YCGCO)412 if (in->colorspace == AVCOL_SPC_YCGCO)
413 av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");413 av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
414 414
415 if( in->width != link->w415 if( in->width != link->w
@@ -456,7 +456,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 40 unmodified lines
456 if(scale->output_is_pal)456 if(scale->output_is_pal)
457 avpriv_set_systematic_pal2((uint32_t*)out->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format);457 avpriv_set_systematic_pal2((uint32_t*)out->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format);
458 458
459 in_range = av_frame_get_color_range(in);459 in_range = in->color_range;
460 460
461 if ( scale->in_color_matrix461 if ( scale->in_color_matrix
462 || scale->out_color_matrix462 || scale->out_color_matrix
@@ -471,7 +471,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 8 unmodified lines
471 &brightness, &contrast, &saturation);471 &brightness, &contrast, &saturation);
472 472
473 if (scale->in_color_matrix)473 if (scale->in_color_matrix)
474 inv_table = parse_yuv_type(scale->in_color_matrix, av_frame_get_colorspace(in));474 inv_table = parse_yuv_type(scale->in_color_matrix, in->colorspace);
475 if (scale->out_color_matrix)475 if (scale->out_color_matrix)
476 table = parse_yuv_type(scale->out_color_matrix, AVCOL_SPC_UNSPECIFIED);476 table = parse_yuv_type(scale->out_color_matrix, AVCOL_SPC_UNSPECIFIED);
477 else if (scale->in_color_matrix)477 else if (scale->in_color_matrix)
@@ -496,7 +496,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 18 unmodified lines
496 table, out_full,496 table, out_full,
497 brightness, contrast, saturation);497 brightness, contrast, saturation);
498 498
499 av_frame_set_color_range(out, out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG);499 out->color_range = out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
500 }500 }
501 501
502 av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,502 av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,
libavfilter/vf_showinfo.c+1−1
@@ -108,7 +108,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 107 unmodified lines
108 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "108 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "
109 "checksum:%08"PRIX32" plane_checksum:[%08"PRIX32,109 "checksum:%08"PRIX32" plane_checksum:[%08"PRIX32,
110 inlink->frame_count_out,110 inlink->frame_count_out,
111 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), av_frame_get_pkt_pos(frame),111 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), frame->pkt_pos,
112 desc->name,112 desc->name,
113 frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den,113 frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den,
114 frame->width, frame->height,114 frame->width, frame->height,
libavfilter/vf_ssim.c+1−1
@@ -283,7 +283,7 @@ static double ssim_db(double ssim, double weight) · 282 unmodified lines
283static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main,283static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main,
284 const AVFrame *ref)284 const AVFrame *ref)
285{285{
286 AVDictionary **metadata = avpriv_frame_get_metadatap(main);286 AVDictionary **metadata = &main->metadata;
287 SSIMContext *s = ctx->priv;287 SSIMContext *s = ctx->priv;
288 float c[4], ssimv = 0.0;288 float c[4], ssimv = 0.0;
289 int i;289 int i;
libavfilter/vf_swaprect.c+1−1
@@ -99,7 +99,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 98 unmodified lines
99 var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];99 var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
100 var_values[VAR_N] = inlink->frame_count_out;100 var_values[VAR_N] = inlink->frame_count_out;
101 var_values[VAR_T] = in->pts == AV_NOPTS_VALUE ? NAN : in->pts * av_q2d(inlink->time_base);101 var_values[VAR_T] = in->pts == AV_NOPTS_VALUE ? NAN : in->pts * av_q2d(inlink->time_base);
102 var_values[VAR_POS] = av_frame_get_pkt_pos(in) == -1 ? NAN : av_frame_get_pkt_pos(in);102 var_values[VAR_POS] = in->pkt_pos ? NAN : in->pkt_pos;
103 103
104 ret = av_expr_parse_and_eval(&dw, s->w,104 ret = av_expr_parse_and_eval(&dw, s->w,
105 var_names, &var_values[0],105 var_names, &var_values[0],
libavfilter/vf_vectorscope.c+1−1
@@ -1212,7 +1212,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 1211 unmodified lines
1212 if (s->colorspace) {1212 if (s->colorspace) {
1213 s->cs = (s->depth - 8) * 2 + s->colorspace - 1;1213 s->cs = (s->depth - 8) * 2 + s->colorspace - 1;
1214 } else {1214 } else {
1215 switch (av_frame_get_colorspace(in)) {1215 switch (in->colorspace) {
1216 case AVCOL_SPC_SMPTE170M:1216 case AVCOL_SPC_SMPTE170M:
1217 case AVCOL_SPC_BT470BG:1217 case AVCOL_SPC_BT470BG:
1218 s->cs = (s->depth - 8) * 2 + 0;1218 s->cs = (s->depth - 8) * 2 + 0;
libavfilter/vf_waveform.c+1−1
@@ -2754,7 +2754,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 2753 unmodified lines
2754 return AVERROR(ENOMEM);2754 return AVERROR(ENOMEM);
2755 }2755 }
2756 out->pts = in->pts;2756 out->pts = in->pts;
2757 av_frame_set_color_range(out, AVCOL_RANGE_JPEG);2757 out->color_range = AVCOL_RANGE_JPEG;
2758 2758
2759 for (k = 0; k < s->dcomp; k++) {2759 for (k = 0; k < s->dcomp; k++) {
2760 if (s->bits <= 8) {2760 if (s->bits <= 8) {
libavfilter/vsrc_testsrc.c+2−2
@@ -1376,7 +1376,7 @@ static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref) · 1375 unmodified lines
1376 int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;1376 int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;
1377 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);1377 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
1378 1378
1379 av_frame_set_colorspace(picref, AVCOL_SPC_BT470BG);1379 picref->colorspace = AVCOL_SPC_BT470BG;
1380 1380
1381 r_w = FFALIGN((test->w + 6) / 7, 1 << pixdesc->log2_chroma_w);1381 r_w = FFALIGN((test->w + 6) / 7, 1 << pixdesc->log2_chroma_w);
1382 r_h = FFALIGN(test->h * 2 / 3, 1 << pixdesc->log2_chroma_h);1382 r_h = FFALIGN(test->h * 2 / 3, 1 << pixdesc->log2_chroma_h);
@@ -1443,7 +1443,7 @@ static void smptehdbars_fill_picture(AVFilterContext *ctx, AVFrame *picref) · 60 unmodified lines
1443 int d_w, r_w, r_h, l_w, i, tmp, x = 0, y = 0;1443 int d_w, r_w, r_h, l_w, i, tmp, x = 0, y = 0;
1444 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);1444 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
1445 1445
1446 av_frame_set_colorspace(picref, AVCOL_SPC_BT709);1446 picref->colorspace = AVCOL_SPC_BT709;
1447 1447
1448 d_w = FFALIGN(test->w / 8, 1 << pixdesc->log2_chroma_w);1448 d_w = FFALIGN(test->w / 8, 1 << pixdesc->log2_chroma_w);
1449 r_h = FFALIGN(test->h * 7 / 12, 1 << pixdesc->log2_chroma_h);1449 r_h = FFALIGN(test->h * 7 / 12, 1 << pixdesc->log2_chroma_h);

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