You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavc/videotoolbox: fix warnings
fix mixing declarations and code warnings Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
		| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user