From patchwork Fri Mar 3 10:16:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Bin X-Patchwork-Id: 2746 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.31.14 with SMTP id f14csp180363vsf; Fri, 3 Mar 2017 02:23:46 -0800 (PST) X-Received: by 10.223.176.143 with SMTP id i15mr1945232wra.136.1488536626139; Fri, 03 Mar 2017 02:23:46 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u188si2322813wmd.128.2017.03.03.02.23.45; Fri, 03 Mar 2017 02:23:46 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DFAB668829D; Fri, 3 Mar 2017 12:23:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 374F4680565 for ; Fri, 3 Mar 2017 12:23:26 +0200 (EET) Received: by mail-io0-f170.google.com with SMTP id z13so27323406iof.2 for ; Fri, 03 Mar 2017 02:23:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=dBGuwGbrmaSEjQEmfvHHu0e8p/0MR7y6vqal0b2i2Dw=; b=EdT/ZipwbdWygueJZYQAehXa9mEi83HwWmeyG69CcGD1FjTm3s6C7eRiCIMF2eMpZx o2mjZ/yFoTh3nYxFEuWdNROePMvwQacxzlw9GFcBqVffbG/Ogd8FEVGCkYRJ+TbityQa 1YQpgyN5SPgHdjwFrchw1sUYziKMOf9StqZAdICi2GMVn0/gWlQAne4U2n/Cpud/vPtS ZkLJm/CzhfjSQnA+kk2Y0so777lzZh22AZZD2UKv6yT4TyptjTCFtOztr0hEJk+XJ6Dl PiOWgwmPhwGcb61KQiUsPk7GkINJ/BHwY24hGVm6TLcEubPLlSEf40jh2jEWkyzcdPFm lZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=dBGuwGbrmaSEjQEmfvHHu0e8p/0MR7y6vqal0b2i2Dw=; b=YsOj93eKoFhGi+LMgOysu2WcV/vojZN4kt8gTpjFjYBJxEYxxjb/J+fsgQmlhN/e9Q 1gkbZ7v32RTNdtEjtqr3HMq4iJ3E0FuAjXC0i0PxgJo+l2MzE6HM5bqEeUk/u6jibUQ4 /GlCetdbQFw3CaFsE2+VQBo1Wv8+XMnCRTvFx0UTU3l2UB/VAazX7pNjx7BWKmZIlrfm m5rvt+G0iEFKdPNameAD4OhehEv6KCDfl+Y8HyiZVGIT2JOAU8A6wYmsi521sUy2uILY ouF6uo9UaLvtpxo2WT0UIxeMS3Of1wYcMmS87MK/CQMkBGgnXb+yG4cPDkdJJ9WQz5H2 mIgQ== X-Gm-Message-State: AMke39lsKmv72/MZFhYsFPGxMOs71xMIcFK+PWz//XaZ5yoDenDQTiaU1GiXElbKRfsJSV9mgoCPxplAAgSJWg== X-Received: by 10.107.153.9 with SMTP id b9mr915491ioe.200.1488536178469; Fri, 03 Mar 2017 02:16:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.196.218 with HTTP; Fri, 3 Mar 2017 02:16:18 -0800 (PST) In-Reply-To: <20170303095755.5a8bd98d@debian> References: <20170224094939.12523-1-nfxjfg@googlemail.com> <20170302103407.301ee1c1@debian> <20170303063248.62746f34@debian> <20170303095755.5a8bd98d@debian> From: Wang Bin Date: Fri, 3 Mar 2017 18:16:18 +0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey 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" From 011d03c4d2b6b138de539dcf5019169781ee7fb2 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Fri, 3 Mar 2017 18:10:54 +0800 Subject: [PATCH] avcodec/videotoolbox: set kCVPixelBufferOpenGLESCompatibilityKey for iOS kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in iOS --- libavcodec/videotoolbox.c | 5 +++++ 1 file changed, 5 insertions(+) kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder CFSTR("RequireHardwareAcceleratedVideoDecoder") @@ -477,7 +478,11 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties); CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w); CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h); +#if TARGET_OS_IPHONE + CFDictionarySetValue(buffer_attributes, kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue); +#else CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue); +#endif CFRelease(io_surface_properties); CFRelease(cv_pix_fmt); diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 824f2d8e68..9199b02055 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -31,6 +31,7 @@ #include "bytestream.h" #include "h264dec.h" #include "mpegvideo.h" +#include #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder # define