From patchwork Tue May 14 13:15:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thilo Borgmann X-Patchwork-Id: 13109 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id CBE80448E35 for ; Tue, 14 May 2019 16:16:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A27FB68037B; Tue, 14 May 2019 16:16:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from shout01.mail.de (shout01.mail.de [62.201.172.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2BF3F68037B for ; Tue, 14 May 2019 16:15:54 +0300 (EEST) Received: from postfix01.mail.de (postfix01.bt.mail.de [10.0.121.125]) by shout01.mail.de (Postfix) with ESMTP id A15C5100788 for ; Tue, 14 May 2019 15:15:53 +0200 (CEST) Received: from smtp04.mail.de (smtp04.bt.mail.de [10.0.121.214]) by postfix01.mail.de (Postfix) with ESMTP id 893F08001A for ; Tue, 14 May 2019 15:15:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.de; s=mailde201610; t=1557839753; bh=h5/Y/4sSHc9GDtD+LkH04a07XFfWTC7vo7yUl5Mfr7U=; h=To:From:Subject:Date:From; b=lGofVHvdhNofVUmikvb8+KMQeKAWmr3RaRpytRxVpGNgkDunQjDFBdyWrYwdirCRW p5D9ZmlL49eVmXvvmKspaABiF4FYXsxpflhdMIYj4onukRpMCQ9ff+JzLIFFmSj2V8 8miB4StnCEHecX6VB9ofNGMvCZGZUw/Dt1/s22rg= Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp04.mail.de (Postfix) with ESMTPSA id 52EEB806EA for ; Tue, 14 May 2019 15:15:53 +0200 (CEST) To: FFmpeg development discussions and patches From: Thilo Borgmann Message-ID: <0499ea09-caa1-994e-1ce6-a15010bd81ad@mail.de> Date: Tue, 14 May 2019 15:15:52 +0200 MIME-Version: 1.0 X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 4104 X-purgate-ID: 154282::1557839753-00005218-C2CDB92D/0/0 Subject: [FFmpeg-devel] [PATCH] lavc/videotoolboxenc: Fix compilation for IOS < 11.0 and OSX, < 10.13 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" $Subject Tested compilation only, sanity test actually using it appreciated. Thanks, Thilo From 104b26ca0eab116dcd49b5f2090067b76b5bfc70 Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Tue, 14 May 2019 15:11:38 +0200 Subject: [PATCH] lavc/videotoolboxenc: Fix compilation for IOS < 11.0 and OSX < 10.13. Prior OS versions are missing the 10bpp formats. --- libavcodec/videotoolboxenc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 3665581..24e0b62 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -762,12 +762,17 @@ static int get_cv_pixel_format(AVCodecContext* avctx, *av_pixel_format = range == AVCOL_RANGE_JPEG ? kCVPixelFormatType_420YpCbCr8PlanarFullRange : kCVPixelFormatType_420YpCbCr8Planar; - } else if (fmt == AV_PIX_FMT_P010LE) { + } +#if ((!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || \ + (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)) + else if (fmt == AV_PIX_FMT_P010LE) { *av_pixel_format = range == AVCOL_RANGE_JPEG ? kCVPixelFormatType_420YpCbCr10BiPlanarFullRange : kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange; *av_pixel_format = kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange; - } else { + } +#endif + else { return AVERROR(EINVAL); } @@ -1991,6 +1996,8 @@ static int get_cv_pixel_info( strides[2] = frame ? frame->linesize[2] : (avctx->width + 1) / 2; break; +#if ((!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || \ + (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)) case AV_PIX_FMT_P010LE: *plane_count = 2; widths[0] = avctx->width; @@ -2001,6 +2008,7 @@ static int get_cv_pixel_info( heights[1] = (avctx->height + 1) / 2; strides[1] = frame ? frame->linesize[1] : ((avctx->width + 1) / 2 + 63) & -64; break; +#endif default: av_log( @@ -2488,7 +2496,10 @@ static const enum AVPixelFormat hevc_pix_fmts[] = { AV_PIX_FMT_VIDEOTOOLBOX, AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, +#if ((!TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || \ + (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)) AV_PIX_FMT_P010LE, +#endif AV_PIX_FMT_NONE };