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
572572 if (!ret) {
573573 if (avctx->codec_type != AVMEDIA_TYPE_VIDEO)
574574 frame->flags |= AV_FRAME_FLAG_KEY;
575+#if FF_API_FRAME_KEY
576+FF_DISABLE_DEPRECATION_WARNINGS
575577 frame->key_frame = !!(frame->flags & AV_FRAME_FLAG_KEY);
578+FF_ENABLE_DEPRECATION_WARNINGS
579+#endif
576580 #if FF_API_INTERLACED_FRAME
577581 FF_DISABLE_DEPRECATION_WARNINGS
578582 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
192192
193193 av_frame_move_ref(frame, avci->buffer_frame);
194194
195+#if FF_API_FRAME_KEY
196+FF_DISABLE_DEPRECATION_WARNINGS
195197 if (frame->key_frame)
196198 frame->flags |= AV_FRAME_FLAG_KEY;
199+FF_ENABLE_DEPRECATION_WARNINGS
200+#endif
197201 #if FF_API_INTERLACED_FRAME
198202 FF_DISABLE_DEPRECATION_WARNINGS
199203 if (frame->interlaced_frame)
libavfilter/buffersrc.c+4−0
@@ -256,8 +256,12 @@ FF_DISABLE_DEPRECATION_WARNINGS · 255 unmodified lines
256256 FF_ENABLE_DEPRECATION_WARNINGS
257257 #endif
258258
259+#if FF_API_FRAME_KEY
260+FF_DISABLE_DEPRECATION_WARNINGS
259261 if (copy->key_frame)
260262 copy->flags |= AV_FRAME_FLAG_KEY;
263+FF_ENABLE_DEPRECATION_WARNINGS
264+#endif
261265
262266 ret = ff_filter_frame(ctx->outputs[0], copy);
263267 if (ret < 0)
libavfilter/vf_coreimage.m+2−0
@@ -301,7 +301,9 @@ static int request_frame(AVFilterLink *link) · 300 unmodified lines
301301
302302 frame->pts = ctx->pts;
303303 frame->duration = 1;
304+#if FF_API_FRAME_KEY
304305 frame->key_frame = 1;
306+#endif
305307 frame->flags |= AV_FRAME_FLAG_KEY
306308 #if FF_API_INTERLACED_FRAME
307309 frame->interlaced_frame = 0;
libavfilter/vsrc_gradients.c+5−0
@@ -397,7 +397,12 @@ static int activate(AVFilterContext *ctx) · 396 unmodified lines
397397 if (!frame)
398398 return AVERROR(ENOMEM);
399399
400+#if FF_API_FRAME_KEY
401+FF_DISABLE_DEPRECATION_WARNINGS
400402 frame->key_frame = 1;
403+FF_ENABLE_DEPRECATION_WARNINGS
404+#endif
405+
401406 frame->flags |= AV_FRAME_FLAG_KEY;
402407 #if FF_API_INTERLACED_FRAME
403408 FF_DISABLE_DEPRECATION_WARNINGS
libavfilter/vsrc_testsrc.c+4−0
@@ -184,7 +184,11 @@ static int activate(AVFilterContext *ctx) · 183 unmodified lines
184184 return AVERROR(ENOMEM);
185185 frame->pts = test->pts;
186186 frame->duration = 1;
187+#if FF_API_PKT_DURATION
188+FF_DISABLE_DEPRECATION_WARNINGS
187189 frame->key_frame = 1;
190+FF_ENABLE_DEPRECATION_WARNINGS
191+#endif
188192 frame->flags |= AV_FRAME_FLAG_KEY;
189193 #if FF_API_INTERLACED_FRAME
190194 FF_DISABLE_DEPRECATION_WARNINGS
libavutil/frame.c+4−1
@@ -55,7 +55,6 @@ FF_DISABLE_DEPRECATION_WARNINGS · 54 unmodified lines
5555 FF_ENABLE_DEPRECATION_WARNINGS
5656 #endif
5757 frame->time_base = (AVRational){ 0, 1 };
58− frame->key_frame = 1;
5958 frame->sample_aspect_ratio = (AVRational){ 0, 1 };
6059 frame->format = -1; /* unknown */
6160 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
265264 {
266265 int ret;
267266
267+#if FF_API_FRAME_KEY
268+FF_DISABLE_DEPRECATION_WARNINGS
268269 dst->key_frame = src->key_frame;
270+FF_ENABLE_DEPRECATION_WARNINGS
271+#endif
269272 dst->pict_type = src->pict_type;
270273 dst->sample_aspect_ratio = src->sample_aspect_ratio;
271274 dst->crop_top = src->crop_top;
libavutil/frame.h+5−0
@@ -416,10 +416,15 @@ typedef struct AVFrame { · 415 unmodified lines
416416 */
417417 int format;
418418
419+#if FF_API_FRAME_KEY
419420 /**
420421 * 1 -> keyframe, 0-> not
422+ *
423+ * @deprecated Use AV_FRAME_FLAG_KEY instead
421424 */
425+ attribute_deprecated
422426 int key_frame;
427+#endif
423428
424429 /**
425430 * Picture type of the frame.
libavutil/version.h+1−0
@@ -116,6 +116,7 @@ · 115 unmodified lines
116116 #define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59)
117117 #define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59)
118118 #define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59)
119+#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 59)
119120
120121 /**
121122 * @}

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