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
291291 if ((!s->type && (cur_sample + nb_samples < s->start_sample)) ||
292292 ( s->type && (s->start_sample + s->nb_samples < cur_sample))) {
293293 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);
295295 } else {
296296 int64_t start;
297297
@@ -301,7 +301,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 3 unmodified lines
301301 start = s->start_sample + s->nb_samples - cur_sample;
302302
303303 s->fade_samples(out_buf->extended_data, buf->extended_data,
304− nb_samples, av_frame_get_channels(buf),
304+ nb_samples, buf->channels,
305305 s->type ? -1 : 1, start,
306306 s->nb_samples, s->curve);
307307 }
@@ -498,7 +498,7 @@ static int acrossfade_filter_frame(AVFilterLink *inlink, AVFrame *in) · 190 unmodified lines
498498
499499 s->crossfade_samples(out->extended_data, cf[0]->extended_data,
500500 cf[1]->extended_data,
501− s->nb_samples, av_frame_get_channels(in),
501+ s->nb_samples, in->channels,
502502 s->curve, s->curve2);
503503 out->pts = s->pts;
504504 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
280280
281281 outbuf->nb_samples = nb_samples;
282282 outbuf->channel_layout = outlink->channel_layout;
283− av_frame_set_channels(outbuf, outlink->channels);
283+ outbuf->channels = outlink->channels;
284284
285285 while (nb_samples) {
286286 ns = nb_samples;
libavfilter/af_apad.c+1−1
@@ -119,7 +119,7 @@ static int request_frame(AVFilterLink *outlink) · 118 unmodified lines
119119
120120 av_samples_set_silence(outsamplesref->extended_data, 0,
121121 n_out,
122− av_frame_get_channels(outsamplesref),
122+ outsamplesref->channels,
123123 outsamplesref->format);
124124
125125 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
254254 }
255255
256256 s->phaser(s, inbuf->extended_data, outbuf->extended_data,
257− outbuf->nb_samples, av_frame_get_channels(outbuf));
257+ outbuf->nb_samples, outbuf->channels);
258258
259259 if (inbuf != outbuf)
260260 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
200200
201201 av_frame_copy_props(outsamplesref, insamplesref);
202202 outsamplesref->format = outlink->format;
203− av_frame_set_channels(outsamplesref, outlink->channels);
203+ outsamplesref->channels = outlink->channels;
204204 outsamplesref->channel_layout = outlink->channel_layout;
205205 outsamplesref->sample_rate = outlink->sample_rate;
206206
libavfilter/af_ashowinfo.c+3−3
@@ -199,7 +199,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 198 unmodified lines
199199 s->plane_checksums[0];
200200 }
201201
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,
203203 buf->channel_layout);
204204
205205 av_log(ctx, AV_LOG_INFO,
@@ -208,8 +208,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 2 unmodified lines
208208 "checksum:%08"PRIX32" ",
209209 inlink->frame_count_out,
210210 av_ts2str(buf->pts), av_ts2timestr(buf->pts, &inlink->time_base),
211− av_frame_get_pkt_pos(buf),
212− av_get_sample_fmt_name(buf->format), av_frame_get_channels(buf), chlayout_str,
211+ buf->pkt_pos,
212+ av_get_sample_fmt_name(buf->format), buf->channels, chlayout_str,
213213 buf->sample_rate, buf->nb_samples,
214214 checksum);
215215
libavfilter/af_astats.c+1−1
@@ -305,7 +305,7 @@ static void set_metadata(AudioStatsContext *s, AVDictionary **metadata) · 304 unmodified lines
305305 static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
306306 {
307307 AudioStatsContext *s = inlink->dst->priv;
308− AVDictionary **metadata = avpriv_frame_get_metadatap(buf);
308+ AVDictionary **metadata = &buf->metadata;
309309 const int channels = s->nb_channels;
310310 int i, c;
311311
libavfilter/af_biquads.c+1−1
@@ -411,7 +411,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 410 unmodified lines
411411 av_frame_copy_props(out_buf, buf);
412412 }
413413
414− for (ch = 0; ch < av_frame_get_channels(buf); ch++)
414+ for (ch = 0; ch < buf->channels; ch++)
415415 s->filter(s, buf->extended_data[ch],
416416 out_buf->extended_data[ch], nb_samples,
417417 &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
354354 FFMIN(FF_ARRAY_ELEMS(buf->data), nch_out) * sizeof(buf->data[0]));
355355
356356 buf->channel_layout = outlink->channel_layout;
357− av_frame_set_channels(buf, outlink->channels);
357+ buf->channels = outlink->channels;
358358
359359 return ff_filter_frame(outlink, buf);
360360 }
libavfilter/af_channelsplit.c+1−1
@@ -120,7 +120,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf) · 119 unmodified lines
120120 buf_out->data[0] = buf_out->extended_data[0] = buf_out->extended_data[i];
121121 buf_out->channel_layout =
122122 av_channel_layout_extract_channel(buf->channel_layout, i);
123− av_frame_set_channels(buf_out, 1);
123+ buf_out->channels = 1;
124124
125125 ret = ff_filter_frame(ctx->outputs[i], buf_out);
126126 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
358358 int c, i;
359359
360360 if (channel == -1) {
361− for (c = 0; c < av_frame_get_channels(frame); c++) {
361+ for (c = 0; c < frame->channels; c++) {
362362 double *data_ptr = (double *)frame->extended_data[c];
363363
364364 for (i = 0; i < frame->nb_samples; i++)
@@ -380,7 +380,7 @@ static double compute_frame_rms(AVFrame *frame, int channel) · 15 unmodified lines
380380 int c, i;
381381
382382 if (channel == -1) {
383− for (c = 0; c < av_frame_get_channels(frame); c++) {
383+ for (c = 0; c < frame->channels; c++) {
384384 const double *data_ptr = (double *)frame->extended_data[c];
385385
386386 for (i = 0; i < frame->nb_samples; i++) {
@@ -388,7 +388,7 @@ static double compute_frame_rms(AVFrame *frame, int channel) · 1 unmodified line
388388 }
389389 }
390390
391− rms_value /= frame->nb_samples * av_frame_get_channels(frame);
391+ rms_value /= frame->nb_samples * frame->channels;
392392 } else {
393393 const double *data_ptr = (double *)frame->extended_data[channel];
394394 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
491491
492492 frame->nb_samples = nb_samples;
493493 frame->channel_layout = outlink->channel_layout;
494− av_frame_set_channels(frame, outlink->channels);
494+ frame->channels = outlink->channels;
495495 frame->sample_rate = outlink->sample_rate;
496496 frame->format = outlink->format;
497497 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
389389 (void *)insamples->extended_data, n);
390390 av_frame_copy_props(outsamples, insamples);
391391 outsamples->channel_layout = outlink->channel_layout;
392− av_frame_set_channels(outsamples, outlink->channels);
392+ outsamples->channels = outlink->channels;
393393
394394 ret = ff_filter_frame(outlink, outsamples);
395395 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
395395 vol->var_values[VAR_T ] = TS2T(buf->pts, inlink->time_base);
396396 vol->var_values[VAR_N ] = inlink->frame_count_out;
397397
398− pos = av_frame_get_pkt_pos(buf);
398+ pos = buf->pkt_pos;
399399 vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;
400400 if (vol->eval_mode == EVAL_MODE_FRAME)
401401 set_volume(ctx);
libavfilter/af_volumedetect.c+1−1
@@ -62,7 +62,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *samples) · 61 unmodified lines
6262 AVFilterContext *ctx = inlink->dst;
6363 VolDetectContext *vd = ctx->priv;
6464 int nb_samples = samples->nb_samples;
65− int nb_channels = av_frame_get_channels(samples);
65+ int nb_channels = samples->channels;
6666 int nb_planes = nb_channels;
6767 int plane, i;
6868 int16_t *pcm;
libavfilter/asrc_flite.c+2−2
@@ -255,8 +255,8 @@ static int request_frame(AVFilterLink *outlink) · 254 unmodified lines
255255 memcpy(samplesref->data[0], flite->wave_samples,
256256 nb_samples * flite->wave->num_channels * 2);
257257 samplesref->pts = flite->pts;
258− av_frame_set_pkt_pos(samplesref, -1);
259− av_frame_set_sample_rate(samplesref, flite->wave->sample_rate);
258+ samplesref->pkt_pos = -1;
259+ samplesref->sample_rate = flite->wave->sample_rate;
260260 flite->pts += nb_samples;
261261 flite->wave_samples += nb_samples * flite->wave->num_channels;
262262 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
204204 memcpy(out->data[0] + i * out->linesize[0], out->data[0], outlink->w * 4);
205205 }
206206
207− metadata = avpriv_frame_get_metadatap(in);
207+ metadata = &in->metadata;
208208 if (metadata) {
209209 uint8_t value[128];
210210
libavfilter/avf_showcqt.c+2−2
@@ -1169,8 +1169,8 @@ static int plot_cqt(AVFilterContext *ctx, AVFrame **frameout) · 1168 unmodified lines
11691169 if (!out)
11701170 return AVERROR(ENOMEM);
11711171 out->sample_aspect_ratio = av_make_q(1, 1);
1172− av_frame_set_color_range(out, AVCOL_RANGE_MPEG);
1173− av_frame_set_colorspace(out, s->csp);
1172+ out->color_range = AVCOL_RANGE_MPEG;
1173+ out->colorspace = s->csp;
11741174 UPDATE_TIME(s->alloc_time);
11751175
11761176 if (s->bar_h) {
libavfilter/avf_showspectrum.c+1−1
@@ -426,7 +426,7 @@ static int config_output(AVFilterLink *outlink) · 425 unmodified lines
426426 memset(outpicref->data[1] + i * outpicref->linesize[1], 128, outlink->w);
427427 memset(outpicref->data[2] + i * outpicref->linesize[2], 128, outlink->w);
428428 }
429− av_frame_set_color_range(outpicref, AVCOL_RANGE_JPEG);
429+ outpicref->color_range = AVCOL_RANGE_JPEG;
430430 }
431431
432432 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
5353 "ref[%p buf:%p data:%p linesize[%d, %d, %d, %d] pts:%"PRId64" pos:%"PRId64,
5454 ref, ref->buf, ref->data[0],
5555 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);
5757
5858 if (ref->width) {
5959 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
11431143 av_log(link->dst, AV_LOG_ERROR, "Format change is not supported\n");
11441144 goto error;
11451145 }
1146− if (av_frame_get_channels(frame) != link->channels) {
1146+ if (frame->channels != link->channels) {
11471147 av_log(link->dst, AV_LOG_ERROR, "Channel count change is not supported\n");
11481148 goto error;
11491149 }
@@ -1585,7 +1585,7 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe) · 435 unmodified lines
15851585 case AVMEDIA_TYPE_AUDIO:
15861586 av_samples_copy(out->extended_data, frame->extended_data,
15871587 0, 0, frame->nb_samples,
1588− av_frame_get_channels(frame),
1588+ frame->channels,
15891589 frame->format);
15901590 break;
15911591 default:
@@ -1616,7 +1616,7 @@ int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *fram · 24 unmodified lines
16161616 {
16171617 AVFilterContext *dstctx = link->dst;
16181618 int64_t pts = frame->pts;
1619− int64_t pos = av_frame_get_pkt_pos(frame);
1619+ int64_t pos = frame->pkt_pos;
16201620
16211621 if (!dstctx->enable_str)
16221622 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
155155 int ret = 0;
156156
157157 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) {
159159 av_log(ctx, AV_LOG_ERROR, "Layout indicates a different number of channels than actually present\n");
160160 return AVERROR(EINVAL);
161161 }
@@ -222,7 +222,7 @@ static int av_buffersrc_add_frame_internal(AVFilterContext *ctx, · 60 unmodified lines
222222 if (!frame->channel_layout)
223223 frame->channel_layout = s->channel_layout;
224224 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);
226226 break;
227227 default:
228228 return AVERROR(EINVAL);
libavfilter/f_drawgraph.c+1−1
@@ -200,7 +200,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 199 unmodified lines
200200 av_frame_copy_props(out, in);
201201 }
202202
203− metadata = av_frame_get_metadata(in);
203+ metadata = in->metadata;
204204
205205 for (i = 0; i < 4; i++) {
206206 double values[VAR_VARS_NB];
libavfilter/f_loop.c+2−2
@@ -275,7 +275,7 @@ static int push_frame(AVFilterContext *ctx) · 274 unmodified lines
275275 if (!out)
276276 return AVERROR(ENOMEM);
277277 out->pts += s->duration - s->start_pts;
278− pts = out->pts + av_frame_get_pkt_duration(out);
278+ pts = out->pts + out->pkt_duration;
279279 ret = ff_filter_frame(outlink, out);
280280 s->current_frame++;
281281
@@ -307,7 +307,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 25 unmodified lines
307307 return AVERROR(ENOMEM);
308308 }
309309 s->nb_frames++;
310− s->duration = frame->pts + av_frame_get_pkt_duration(frame);
310+ s->duration = frame->pts + frame->pkt_duration;
311311 ret = ff_filter_frame(outlink, frame);
312312 } else {
313313 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
280280 AVFilterContext *ctx = inlink->dst;
281281 AVFilterLink *outlink = ctx->outputs[0];
282282 MetadataContext *s = ctx->priv;
283− AVDictionary **metadata = avpriv_frame_get_metadatap(frame);
283+ AVDictionary **metadata = &frame->metadata;
284284 AVDictionaryEntry *e;
285285
286286 if (!*metadata)
libavfilter/f_select.c+3−3
@@ -284,7 +284,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) · 283 unmodified lines
284284
285285 static double get_concatdec_select(AVFrame *frame, int64_t pts)
286286 {
287− AVDictionary *metadata = av_frame_get_metadata(frame);
287+ AVDictionary *metadata = frame->metadata;
288288 AVDictionaryEntry *start_time_entry = av_dict_get(metadata, "lavf.concatdec.start_time", NULL, 0);
289289 AVDictionaryEntry *duration_entry = av_dict_get(metadata, "lavf.concatdec.duration", NULL, 0);
290290 if (start_time_entry) {
@@ -321,7 +321,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame) · 30 unmodified lines
321321 select->var_values[VAR_N ] = inlink->frame_count_out;
322322 select->var_values[VAR_PTS] = TS2D(frame->pts);
323323 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;
325325 select->var_values[VAR_KEY] = frame->key_frame;
326326 select->var_values[VAR_CONCATDEC_SELECT] = get_concatdec_select(frame, av_rescale_q(frame->pts, inlink->time_base, AV_TIME_BASE_Q));
327327
@@ -340,7 +340,7 @@ static void select_frame(AVFilterContext *ctx, AVFrame *frame) · 12 unmodified lines
340340 select->var_values[VAR_SCENE] = get_scene_score(ctx, frame);
341341 // TODO: document metadata
342342 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);
344344 }
345345 break;
346346 }
libavfilter/fifo.c+1−1
@@ -129,7 +129,7 @@ static void buffer_offset(AVFilterLink *link, AVFrame *frame, · 128 unmodified lines
129129 static int calc_ptr_alignment(AVFrame *frame)
130130 {
131131 int planes = av_sample_fmt_is_planar(frame->format) ?
132− av_frame_get_channels(frame) : 1;
132+ frame->channels : 1;
133133 int min_align = 128;
134134 int p;
135135
libavfilter/framepool.c+1−1
@@ -240,7 +240,7 @@ AVFrame *ff_frame_pool_get(FFFramePool *pool) · 239 unmodified lines
240240 break;
241241 case AVMEDIA_TYPE_AUDIO:
242242 frame->nb_samples = pool->nb_samples;
243− av_frame_set_channels(frame, pool->channels);
243+ frame->channels = pool->channels;
244244 frame->format = pool->format;
245245 frame->linesize[0] = pool->linesize[0];
246246
libavfilter/setpts.c+1−1
@@ -165,7 +165,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 164 unmodified lines
165165 }
166166 setpts->var_values[VAR_PTS ] = TS2D(frame->pts);
167167 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;
169169 setpts->var_values[VAR_RTCTIME ] = av_gettime();
170170
171171 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
559559 return 0;
560560 }
561561
562− frame->pts = av_frame_get_best_effort_timestamp(frame);
562+ frame->pts = frame->best_effort_timestamp;
563563 if (frame->pts != AV_NOPTS_VALUE) {
564564 if (movie->ts_offset)
565565 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
8484 av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base));
8585
8686 if (has_bbox) {
87− AVDictionary **metadata = avpriv_frame_get_metadatap(frame);
87+ AVDictionary **metadata = &frame->metadata;
8888
8989 SET_META("lavfi.bbox.x1", box.x1)
9090 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
164164 /* black starts here */
165165 blackdetect->black_started = 1;
166166 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",
168168 av_ts2timestr(blackdetect->black_start, &inlink->time_base), 0);
169169 }
170170 } else if (blackdetect->black_started) {
@@ -172,7 +172,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) · 1 unmodified line
172172 blackdetect->black_started = 0;
173173 blackdetect->black_end = picref->pts;
174174 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",
176176 av_ts2timestr(blackdetect->black_end, &inlink->time_base), 0);
177177 }
178178
libavfilter/vf_blackframe.c+1−1
@@ -85,7 +85,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 84 unmodified lines
8585
8686 pblack = s->nblack * 100 / (inlink->w * inlink->h);
8787 if (pblack >= s->bamount) {
88− metadata = avpriv_frame_get_metadatap(frame);
88+ metadata = &frame->metadata;
8989
9090 av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f "
9191 "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
435435 av_frame_copy_props(out, in);
436436
437437 if (color->source == COLOR_MODE_NONE) {
438− enum AVColorSpace cs = av_frame_get_colorspace(in);
438+ enum AVColorSpace cs = in->colorspace;
439439 enum ColorMode source;
440440
441441 switch(cs) {
@@ -456,11 +456,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 14 unmodified lines
456456 color->mode = color->source * 5 + color->dest;
457457
458458 switch(color->dest) {
459− case COLOR_MODE_BT709 : av_frame_set_colorspace(out, AVCOL_SPC_BT709) ; break;
460− case COLOR_MODE_FCC : av_frame_set_colorspace(out, AVCOL_SPC_FCC) ; break;
461− case COLOR_MODE_SMPTE240M: av_frame_set_colorspace(out, AVCOL_SPC_SMPTE240M) ; break;
462− case COLOR_MODE_BT601 : av_frame_set_colorspace(out, AVCOL_SPC_BT470BG) ; break;
463− case COLOR_MODE_BT2020 : av_frame_set_colorspace(out, AVCOL_SPC_BT2020_NCL); break;
459+ case COLOR_MODE_BT709 : out->colorspace = AVCOL_SPC_BT709 ; break;
460+ case COLOR_MODE_FCC : out->colorspace = AVCOL_SPC_FCC ; break;
461+ case COLOR_MODE_SMPTE240M: out->colorspace = AVCOL_SPC_SMPTE240M ; break;
462+ case COLOR_MODE_BT601 : out->colorspace = AVCOL_SPC_BT470BG ; break;
463+ case COLOR_MODE_BT2020 : out->colorspace = AVCOL_SPC_BT2020_NCL; break;
464464 }
465465
466466 td.src = in;
libavfilter/vf_crop.c+2−2
@@ -258,8 +258,8 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) · 257 unmodified lines
258258 s->var_values[VAR_N] = link->frame_count_out;
259259 s->var_values[VAR_T] = frame->pts == AV_NOPTS_VALUE ?
260260 NAN : frame->pts * av_q2d(link->time_base);
261− s->var_values[VAR_POS] = av_frame_get_pkt_pos(frame) == -1 ?
262− NAN : av_frame_get_pkt_pos(frame);
261+ s->var_values[VAR_POS] = frame->pkt_pos == -1 ?
262+ NAN : frame->pkt_pos;
263263 s->var_values[VAR_X] = av_expr_eval(s->x_pexpr, s->var_values, NULL);
264264 s->var_values[VAR_Y] = av_expr_eval(s->y_pexpr, s->var_values, NULL);
265265 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
169169
170170 // ignore first 2 frames - they may be empty
171171 if (++s->frame_nb > 0) {
172− metadata = avpriv_frame_get_metadatap(frame);
172+ metadata = &frame->metadata;
173173
174174 // Reset the crop area every reset_count frames, if reset_count is > 0
175175 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
386386 }
387387
388388 av_frame_copy_props(out, in);
389− metadata = avpriv_frame_get_metadatap(out);
389+ metadata = &out->metadata;
390390 if (metadata) {
391391 uint8_t value[128];
392392
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
446446 params.surface = input_surface;
447447 params.surface_region = &input_region;
448448 params.surface_color_standard = vaapi_proc_colour_standard(
449− av_frame_get_colorspace(input_frame));
449+ input_frame->colorspace);
450450
451451 params.output_region = NULL;
452452 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
14521452 NAN : frame->pts * av_q2d(inlink->time_base);
14531453
14541454 s->var_values[VAR_PICT_TYPE] = frame->pict_type;
1455− s->metadata = av_frame_get_metadata(frame);
1455+ s->metadata = frame->metadata;
14561456
14571457 draw_text(ctx, frame, frame->width, frame->height);
14581458
libavfilter/vf_eq.c+1−1
@@ -254,7 +254,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 253 unmodified lines
254254 AVFilterLink *outlink = inlink->dst->outputs[0];
255255 EQContext *eq = ctx->priv;
256256 AVFrame *out;
257− int64_t pos = av_frame_get_pkt_pos(in);
257+ int64_t pos = in->pkt_pos;
258258 const AVPixFmtDescriptor *desc;
259259 int i;
260260
libavfilter/vf_idet.c+1−1
@@ -120,7 +120,7 @@ static void filter(AVFilterContext *ctx) · 119 unmodified lines
120120 Type type, best_type;
121121 RepeatedField repeat;
122122 int match = 0;
123− AVDictionary **metadata = avpriv_frame_get_metadatap(idet->cur);
123+ AVDictionary **metadata = &idet->cur->metadata;
124124
125125 for (i = 0; i < idet->csp->nb_components; i++) {
126126 int w = idet->cur->width;
libavfilter/vf_ocr.c+1−1
@@ -97,7 +97,7 @@ static int query_formats(AVFilterContext *ctx) · 96 unmodified lines
9797
9898 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
9999 {
100− AVDictionary **metadata = avpriv_frame_get_metadatap(in);
100+ AVDictionary **metadata = &in->metadata;
101101 AVFilterContext *ctx = inlink->dst;
102102 AVFilterLink *outlink = ctx->outputs[0];
103103 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
715715 AVFilterLink *inlink = ctx->inputs[0];
716716
717717 if (s->eval_mode == EVAL_MODE_FRAME) {
718− int64_t pos = av_frame_get_pkt_pos(mainpic);
718+ int64_t pos = mainpic->pkt_pos;
719719
720720 s->var_values[VAR_N] = inlink->frame_count_out;
721721 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
148148 PSNRContext *s = ctx->priv;
149149 double comp_mse[4], mse = 0;
150150 int j, c;
151− AVDictionary **metadata = avpriv_frame_get_metadatap(main);
151+ AVDictionary **metadata = &main->metadata;
152152
153153 compute_images_mse(s, (const uint8_t **)main->data, main->linesize,
154154 (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
214214
215215 snprintf(key, sizeof(key), "lavfi.readeia608.%d.cc", s->nb_found);
216216 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);
218218
219219 snprintf(key, sizeof(key), "lavfi.readeia608.%d.line", s->nb_found);
220220 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);
222222 }
223223
224224 s->nb_found++;
libavfilter/vf_readvitc.c+2−2
@@ -221,9 +221,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 220 unmodified lines
221221 int found;
222222
223223 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);
225225 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);
227227
228228 return ff_filter_frame(outlink, frame);
229229 }
libavfilter/vf_scale.c+4−4
@@ -409,7 +409,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 408 unmodified lines
409409 char buf[32];
410410 int in_range;
411411
412− if (av_frame_get_colorspace(in) == AVCOL_SPC_YCGCO)
412+ if (in->colorspace == AVCOL_SPC_YCGCO)
413413 av_log(link->dst, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
414414
415415 if( in->width != link->w
@@ -456,7 +456,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 40 unmodified lines
456456 if(scale->output_is_pal)
457457 avpriv_set_systematic_pal2((uint32_t*)out->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format);
458458
459− in_range = av_frame_get_color_range(in);
459+ in_range = in->color_range;
460460
461461 if ( scale->in_color_matrix
462462 || scale->out_color_matrix
@@ -471,7 +471,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 8 unmodified lines
471471 &brightness, &contrast, &saturation);
472472
473473 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);
475475 if (scale->out_color_matrix)
476476 table = parse_yuv_type(scale->out_color_matrix, AVCOL_SPC_UNSPECIFIED);
477477 else if (scale->in_color_matrix)
@@ -496,7 +496,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) · 18 unmodified lines
496496 table, out_full,
497497 brightness, contrast, saturation);
498498
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;
500500 }
501501
502502 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
108108 "fmt:%s sar:%d/%d s:%dx%d i:%c iskey:%d type:%c "
109109 "checksum:%08"PRIX32" plane_checksum:[%08"PRIX32,
110110 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,
112112 desc->name,
113113 frame->sample_aspect_ratio.num, frame->sample_aspect_ratio.den,
114114 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
283283 static AVFrame *do_ssim(AVFilterContext *ctx, AVFrame *main,
284284 const AVFrame *ref)
285285 {
286− AVDictionary **metadata = avpriv_frame_get_metadatap(main);
286+ AVDictionary **metadata = &main->metadata;
287287 SSIMContext *s = ctx->priv;
288288 float c[4], ssimv = 0.0;
289289 int i;
libavfilter/vf_swaprect.c+1−1
@@ -99,7 +99,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 98 unmodified lines
9999 var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR];
100100 var_values[VAR_N] = inlink->frame_count_out;
101101 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;
103103
104104 ret = av_expr_parse_and_eval(&dw, s->w,
105105 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
12121212 if (s->colorspace) {
12131213 s->cs = (s->depth - 8) * 2 + s->colorspace - 1;
12141214 } else {
1215− switch (av_frame_get_colorspace(in)) {
1215+ switch (in->colorspace) {
12161216 case AVCOL_SPC_SMPTE170M:
12171217 case AVCOL_SPC_BT470BG:
12181218 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
27542754 return AVERROR(ENOMEM);
27552755 }
27562756 out->pts = in->pts;
2757− av_frame_set_color_range(out, AVCOL_RANGE_JPEG);
2757+ out->color_range = AVCOL_RANGE_JPEG;
27582758
27592759 for (k = 0; k < s->dcomp; k++) {
27602760 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
13761376 int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;
13771377 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
13781378
1379− av_frame_set_colorspace(picref, AVCOL_SPC_BT470BG);
1379+ picref->colorspace = AVCOL_SPC_BT470BG;
13801380
13811381 r_w = FFALIGN((test->w + 6) / 7, 1 << pixdesc->log2_chroma_w);
13821382 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
14431443 int d_w, r_w, r_h, l_w, i, tmp, x = 0, y = 0;
14441444 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);
14451445
1446− av_frame_set_colorspace(picref, AVCOL_SPC_BT709);
1446+ picref->colorspace = AVCOL_SPC_BT709;
14471447
14481448 d_w = FFALIGN(test->w / 8, 1 << pixdesc->log2_chroma_w);
14491449 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