diff options
author | Jun Zhao <[email protected]> | 2023-04-03 20:08:23 +0800 |
---|---|---|
committer | Jun Zhao <[email protected]> | 2023-04-09 18:12:26 +0800 |
commit | 639ded10e3599b7dd52a4bd7c06589689d177d08 (patch) | |
tree | b2b643f2b568130f9721aaef278852fc6ea8dfff | |
parent | aa8ff2240ce9ed2bc67d1e5fabfb77f38c823fb7 (diff) |
lavc/videotoolbox: fix warnings
fix mixing declarations and code warnings
Signed-off-by: Jun Zhao <[email protected]>
-rw-r--r-- | libavcodec/videotoolbox.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index e42fea6f32..6444325591 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -799,6 +799,9 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec_type, AVCodecContext *avctx) { + CFMutableDictionaryRef avc_info; + CFDataRef data = NULL; + CFMutableDictionaryRef config_info = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, @@ -810,9 +813,6 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder, kCFBooleanTrue); - CFMutableDictionaryRef avc_info; - CFDataRef data = NULL; - avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, @@ -1072,13 +1072,14 @@ static int videotoolbox_hevc_end_frame(AVCodecContext *avctx) HEVCContext *h = avctx->priv_data; AVFrame *frame = h->ref->frame; VTContext *vtctx = avctx->internal->hwaccel_priv_data; + int ret; h->output_frame->crop_right = 0; h->output_frame->crop_left = 0; h->output_frame->crop_top = 0; h->output_frame->crop_bottom = 0; - int ret = ff_videotoolbox_common_end_frame(avctx, frame); + ret = ff_videotoolbox_common_end_frame(avctx, frame); vtctx->bitstream_size = 0; return ret; } @@ -1132,15 +1133,17 @@ static int videotoolbox_prores_end_frame(AVCodecContext *avctx) } static enum AVPixelFormat videotoolbox_best_pixel_format(AVCodecContext *avctx) { + int depth; const AVPixFmtDescriptor *descriptor = av_pix_fmt_desc_get(avctx->sw_pix_fmt); if (!descriptor) return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context() - int depth = descriptor->comp[0].depth; if (descriptor->flags & AV_PIX_FMT_FLAG_ALPHA) return AV_PIX_FMT_AYUV64; + depth = descriptor->comp[0].depth; + #if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE if (depth > 10) return descriptor->log2_chroma_w == 0 ? AV_PIX_FMT_P416 : AV_PIX_FMT_P216; @@ -1194,6 +1197,7 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx) VTContext *vtctx = avctx->internal->hwaccel_priv_data; AVHWFramesContext *hw_frames; int err; + bool full_range; vtctx->logctx = avctx; @@ -1241,7 +1245,7 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx) goto fail; } - bool full_range = avctx->color_range == AVCOL_RANGE_JPEG; + full_range = avctx->color_range == AVCOL_RANGE_JPEG; vtctx->vt_ctx->cv_pix_fmt_type = av_map_videotoolbox_format_from_pixfmt2(hw_frames->sw_format, full_range); if (!vtctx->vt_ctx->cv_pix_fmt_type) { |