History

avutil/frame: deprecate key_frame

James Almer committed 3 years ago

Commit 3e06f6f1 parent c7a86819 files · +33 −1Browse files

Unified · Split

9 files
  1. libavcodec/decode.c +4 −0
  2. libavcodec/encode.c +4 −0
  3. libavfilter/buffersrc.c +4 −0
  4. libavfilter/vf_coreimage.m +2 −0
  5. libavfilter/vsrc_gradients.c +5 −0
  6. libavfilter/vsrc_testsrc.c +4 −0
  7. libavutil/frame.c +4 −1
  8. libavutil/frame.h +5 −0
  9. libavutil/version.h +1 −0
libavcodec/decode.c+4−0
@@ -572,7 +572,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) · 571 unmodified lines
572 if (!ret) {572 if (!ret) {
573 if (avctx->codec_type != AVMEDIA_TYPE_VIDEO)573 if (avctx->codec_type != AVMEDIA_TYPE_VIDEO)
574 frame->flags |= AV_FRAME_FLAG_KEY;574 frame->flags |= AV_FRAME_FLAG_KEY;
575#if FF_API_FRAME_KEY
576FF_DISABLE_DEPRECATION_WARNINGS
575 frame->key_frame = !!(frame->flags & AV_FRAME_FLAG_KEY);577 frame->key_frame = !!(frame->flags & AV_FRAME_FLAG_KEY);
578FF_ENABLE_DEPRECATION_WARNINGS
579#endif
576#if FF_API_INTERLACED_FRAME580#if FF_API_INTERLACED_FRAME
577FF_DISABLE_DEPRECATION_WARNINGS581FF_DISABLE_DEPRECATION_WARNINGS
578 frame->interlaced_frame = !!(frame->flags & AV_FRAME_FLAG_INTERLACED);582 frame->interlaced_frame = !!(frame->flags & AV_FRAME_FLAG_INTERLACED);
libavcodec/encode.c+4−0
@@ -192,8 +192,12 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame) · 191 unmodified lines
192 192
193 av_frame_move_ref(frame, avci->buffer_frame);193 av_frame_move_ref(frame, avci->buffer_frame);
194 194
195#if FF_API_FRAME_KEY
196FF_DISABLE_DEPRECATION_WARNINGS
195 if (frame->key_frame)197 if (frame->key_frame)
196 frame->flags |= AV_FRAME_FLAG_KEY;198 frame->flags |= AV_FRAME_FLAG_KEY;
199FF_ENABLE_DEPRECATION_WARNINGS
200#endif
197#if FF_API_INTERLACED_FRAME201#if FF_API_INTERLACED_FRAME
198FF_DISABLE_DEPRECATION_WARNINGS202FF_DISABLE_DEPRECATION_WARNINGS
199 if (frame->interlaced_frame)203 if (frame->interlaced_frame)
libavfilter/buffersrc.c+4−0
@@ -256,8 +256,12 @@ FF_DISABLE_DEPRECATION_WARNINGS · 255 unmodified lines
256FF_ENABLE_DEPRECATION_WARNINGS256FF_ENABLE_DEPRECATION_WARNINGS
257#endif257#endif
258 258
259#if FF_API_FRAME_KEY
260FF_DISABLE_DEPRECATION_WARNINGS
259 if (copy->key_frame)261 if (copy->key_frame)
260 copy->flags |= AV_FRAME_FLAG_KEY;262 copy->flags |= AV_FRAME_FLAG_KEY;
263FF_ENABLE_DEPRECATION_WARNINGS
264#endif
261 265
262 ret = ff_filter_frame(ctx->outputs[0], copy);266 ret = ff_filter_frame(ctx->outputs[0], copy);
263 if (ret < 0)267 if (ret < 0)
libavfilter/vf_coreimage.m+2−0
@@ -301,7 +301,9 @@ static int request_frame(AVFilterLink *link) · 300 unmodified lines
301 301
302 frame->pts = ctx->pts;302 frame->pts = ctx->pts;
303 frame->duration = 1;303 frame->duration = 1;
304#if FF_API_FRAME_KEY
304 frame->key_frame = 1;305 frame->key_frame = 1;
306#endif
305 frame->flags |= AV_FRAME_FLAG_KEY307 frame->flags |= AV_FRAME_FLAG_KEY
306#if FF_API_INTERLACED_FRAME308#if FF_API_INTERLACED_FRAME
307 frame->interlaced_frame = 0;309 frame->interlaced_frame = 0;
libavfilter/vsrc_gradients.c+5−0
@@ -397,7 +397,12 @@ static int activate(AVFilterContext *ctx) · 396 unmodified lines
397 if (!frame)397 if (!frame)
398 return AVERROR(ENOMEM);398 return AVERROR(ENOMEM);
399 399
400#if FF_API_FRAME_KEY
401FF_DISABLE_DEPRECATION_WARNINGS
400 frame->key_frame = 1;402 frame->key_frame = 1;
403FF_ENABLE_DEPRECATION_WARNINGS
404#endif
405
401 frame->flags |= AV_FRAME_FLAG_KEY;406 frame->flags |= AV_FRAME_FLAG_KEY;
402#if FF_API_INTERLACED_FRAME407#if FF_API_INTERLACED_FRAME
403FF_DISABLE_DEPRECATION_WARNINGS408FF_DISABLE_DEPRECATION_WARNINGS
libavfilter/vsrc_testsrc.c+4−0
@@ -184,7 +184,11 @@ static int activate(AVFilterContext *ctx) · 183 unmodified lines
184 return AVERROR(ENOMEM);184 return AVERROR(ENOMEM);
185 frame->pts = test->pts;185 frame->pts = test->pts;
186 frame->duration = 1;186 frame->duration = 1;
187#if FF_API_PKT_DURATION
188FF_DISABLE_DEPRECATION_WARNINGS
187 frame->key_frame = 1;189 frame->key_frame = 1;
190FF_ENABLE_DEPRECATION_WARNINGS
191#endif
188 frame->flags |= AV_FRAME_FLAG_KEY;192 frame->flags |= AV_FRAME_FLAG_KEY;
189#if FF_API_INTERLACED_FRAME193#if FF_API_INTERLACED_FRAME
190FF_DISABLE_DEPRECATION_WARNINGS194FF_DISABLE_DEPRECATION_WARNINGS
libavutil/frame.c+4−1
@@ -55,7 +55,6 @@ FF_DISABLE_DEPRECATION_WARNINGS · 54 unmodified lines
55FF_ENABLE_DEPRECATION_WARNINGS55FF_ENABLE_DEPRECATION_WARNINGS
56#endif56#endif
57 frame->time_base = (AVRational){ 0, 1 };57 frame->time_base = (AVRational){ 0, 1 };
58 frame->key_frame = 1;
59 frame->sample_aspect_ratio = (AVRational){ 0, 1 };58 frame->sample_aspect_ratio = (AVRational){ 0, 1 };
60 frame->format = -1; /* unknown */59 frame->format = -1; /* unknown */
61 frame->extended_data = frame->data;60 frame->extended_data = frame->data;
@@ -265,7 +264,11 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) · 203 unmodified lines
265{264{
266 int ret;265 int ret;
267 266
267#if FF_API_FRAME_KEY
268FF_DISABLE_DEPRECATION_WARNINGS
268 dst->key_frame = src->key_frame;269 dst->key_frame = src->key_frame;
270FF_ENABLE_DEPRECATION_WARNINGS
271#endif
269 dst->pict_type = src->pict_type;272 dst->pict_type = src->pict_type;
270 dst->sample_aspect_ratio = src->sample_aspect_ratio;273 dst->sample_aspect_ratio = src->sample_aspect_ratio;
271 dst->crop_top = src->crop_top;274 dst->crop_top = src->crop_top;
libavutil/frame.h+5−0
@@ -416,10 +416,15 @@ typedef struct AVFrame { · 415 unmodified lines
416 */416 */
417 int format;417 int format;
418 418
419#if FF_API_FRAME_KEY
419 /**420 /**
420 * 1 -> keyframe, 0-> not421 * 1 -> keyframe, 0-> not
422 *
423 * @deprecated Use AV_FRAME_FLAG_KEY instead
421 */424 */
425 attribute_deprecated
422 int key_frame;426 int key_frame;
427#endif
423 428
424 /**429 /**
425 * Picture type of the frame.430 * Picture type of the frame.
libavutil/version.h+1−0
@@ -116,6 +116,7 @@ · 115 unmodified lines
116#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59)116#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59)
117#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59)117#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59)
118#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59)118#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59)
119#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 59)
119 120
120/**121/**
121 * @}122 * @}

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