forked from FFmpeg/FFmpeg
avutil/frame: deprecate key_frame
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
c7a8681860
commit
3e06f6f040
9 changed files with 33 additions and 1 deletions
|
@ -572,7 +572,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
|||
if (!ret) {
|
||||
if (avctx->codec_type != AVMEDIA_TYPE_VIDEO)
|
||||
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||
#if FF_API_FRAME_KEY
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
frame->key_frame = !!(frame->flags & AV_FRAME_FLAG_KEY);
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
#if FF_API_INTERLACED_FRAME
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
frame->interlaced_frame = !!(frame->flags & AV_FRAME_FLAG_INTERLACED);
|
||||
|
|
|
@ -192,8 +192,12 @@ int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame)
|
|||
|
||||
av_frame_move_ref(frame, avci->buffer_frame);
|
||||
|
||||
#if FF_API_FRAME_KEY
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (frame->key_frame)
|
||||
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
#if FF_API_INTERLACED_FRAME
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (frame->interlaced_frame)
|
||||
|
|
|
@ -256,8 +256,12 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
|||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
#if FF_API_FRAME_KEY
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (copy->key_frame)
|
||||
copy->flags |= AV_FRAME_FLAG_KEY;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
ret = ff_filter_frame(ctx->outputs[0], copy);
|
||||
if (ret < 0)
|
||||
|
|
|
@ -301,7 +301,9 @@ static int request_frame(AVFilterLink *link)
|
|||
|
||||
frame->pts = ctx->pts;
|
||||
frame->duration = 1;
|
||||
#if FF_API_FRAME_KEY
|
||||
frame->key_frame = 1;
|
||||
#endif
|
||||
frame->flags |= AV_FRAME_FLAG_KEY
|
||||
#if FF_API_INTERLACED_FRAME
|
||||
frame->interlaced_frame = 0;
|
||||
|
|
|
@ -397,7 +397,12 @@ static int activate(AVFilterContext *ctx)
|
|||
if (!frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
#if FF_API_FRAME_KEY
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
frame->key_frame = 1;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||
#if FF_API_INTERLACED_FRAME
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
|
|
|
@ -184,7 +184,11 @@ static int activate(AVFilterContext *ctx)
|
|||
return AVERROR(ENOMEM);
|
||||
frame->pts = test->pts;
|
||||
frame->duration = 1;
|
||||
#if FF_API_PKT_DURATION
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
frame->key_frame = 1;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
frame->flags |= AV_FRAME_FLAG_KEY;
|
||||
#if FF_API_INTERLACED_FRAME
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
|
|
|
@ -55,7 +55,6 @@ FF_DISABLE_DEPRECATION_WARNINGS
|
|||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
frame->time_base = (AVRational){ 0, 1 };
|
||||
frame->key_frame = 1;
|
||||
frame->sample_aspect_ratio = (AVRational){ 0, 1 };
|
||||
frame->format = -1; /* unknown */
|
||||
frame->extended_data = frame->data;
|
||||
|
@ -265,7 +264,11 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
|
|||
{
|
||||
int ret;
|
||||
|
||||
#if FF_API_FRAME_KEY
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
dst->key_frame = src->key_frame;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
dst->pict_type = src->pict_type;
|
||||
dst->sample_aspect_ratio = src->sample_aspect_ratio;
|
||||
dst->crop_top = src->crop_top;
|
||||
|
|
|
@ -416,10 +416,15 @@ typedef struct AVFrame {
|
|||
*/
|
||||
int format;
|
||||
|
||||
#if FF_API_FRAME_KEY
|
||||
/**
|
||||
* 1 -> keyframe, 0-> not
|
||||
*
|
||||
* @deprecated Use AV_FRAME_FLAG_KEY instead
|
||||
*/
|
||||
attribute_deprecated
|
||||
int key_frame;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Picture type of the frame.
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 59)
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
|
Loading…
Add table
Reference in a new issue