From patchwork Fri Dec 15 07:02:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Bin X-Patchwork-Id: 6785 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp133843jah; Thu, 14 Dec 2017 23:03:14 -0800 (PST) X-Google-Smtp-Source: ACJfBouVh+smFvResn/M167UrvK6BslGrTu8wxZwdIFaMSjpjz6YbA0Db87W+jPczkCmREe7VbsL X-Received: by 10.28.144.15 with SMTP id s15mr3806923wmd.99.1513321394075; Thu, 14 Dec 2017 23:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513321393; cv=none; d=google.com; s=arc-20160816; b=BrkcPkZfka6aS0fDMUGxvFCYhiYV50smWeDsP3ajlFDI6l2Z9z6f+wmr8skBMwn60+ f91EIT9cdXzgivkuILOEDGc5xWpimBXOKyud5GkN3zZze7+72huhiynE1OiuuKqtab53 P/wRauPgTyhCz/n7egvl7yf27ciQaT5hiQduIGp5ZgY+Y1MP+kO2Q0rs4QPIrweYOMZj XJBE+wZ0vDRDDNYymidwKL2Z3XgYyRAYTFgIBoR0ABCFH3KP5IRtXROTafk8EXmg/aIG RCE9s/zecQaYPV0i+e8+AGZv3HMYxt7neaFbr9wLG6ptIHi8wGAZAeYc6w0He/6JT8sO cdmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=aXBByN6DA0Sx3Be1RfDGgFfEYtG0E1j2CwbG6C+kQWM=; b=yLP1hVh7T1fhg7gq5XItWQFz5DOKJsbmVlojFr4PNoBXDox9+Jn7VjEENSk0E6zNFt om1zjhA7A7adyZxlzebC6jwxHGhblr72SpbQzEZrQR2iHVr+nkrFl9Xn8PUVvLVLBmBW Suq9kVouj4XGY2vUpZ/c3JSNCYLnTYQMf3V+7gSlRsJXStRr+7vKQIYUUsPqbTR+SjFO QMI2GRTBOa6ag6nbfR0vo2cTTze9pBxayls5C9kUyIK9OGBpn3UCa5G6apprnVVA/YWf Snq5GClrE18pQhLdvldIc7+acMn0LSXo7YmqtBmcF+hOE3mcvRhnQlbZPpFcEOGmH6Ea 9MaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=MRvP2DTo; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 22si4846159wrx.188.2017.12.14.23.03.12; Thu, 14 Dec 2017 23:03:13 -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 header.s=20161025 header.b=MRvP2DTo; 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 0A7B6689221; Fri, 15 Dec 2017 09:03:02 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 115476803CB for ; Fri, 15 Dec 2017 09:02:56 +0200 (EET) Received: by mail-pg0-f50.google.com with SMTP id o2so5215381pgc.8 for ; Thu, 14 Dec 2017 23:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9jMBFh72ip05CyRaMow6lUO3bgSuPCQvtwpON0qTOy8=; b=MRvP2DToBBAwX74ntbGUEUXc8ZG7sEJHTwFj8wBQu+OLOggm90VkcynkYmpxPYeZ+a BstrktVzYcHjnFjvUylIo51BNQ7L3IXnUfVsywPp9O6Q62b1Lgg4v82lw6fCDrZhWNvp UOUquAZE7JL4pTnNKCgN6ozcl0Pgru9qV8Mthos/tiih3GzkWrQBw41nqHxL0QY+kfHY zr2iHGmJtaZ9G333IOEl7Snkc1smLsp/+UNTYQR2X5CCARBreQiLMBlJsduZrOvEgPVK o0XJl8kFrRJAcgLrOY+DaO9mdWaS9tu7vNPHTo0aB3OY0fWrWl53w0rSvMI5QP+eP8d+ zbUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9jMBFh72ip05CyRaMow6lUO3bgSuPCQvtwpON0qTOy8=; b=SJDKn5voz6ZQ+TPLcdNT0ubN8KuTyRrPKMZdPKssDrKhx6eLkreErh8AQlKBfYd4XJ DbixqlckBPCRktWfOFN4/l5JQClgTSpRgHF+Be/iaX8926f0dUcQgH8m6kQNTwnxIP2D XPEN3gEzDD7vxEoWicjEU5pCfSsRM2BWu1S62fYI36ng2jkUBd1qnabn+t+AhMzC5J94 1updf8Jl7EV/ahYdthfLkyx0p25OowN7aNWts9aDX4wZBFyWuWbNMlLs749U4iY19+Ru PXW0dUz33S7N1R1ZQ1hvhlkiDo9efVESjKe2XHWv6lfKf+DSlltTpI1kXv5C6Y7OP77E qecQ== X-Gm-Message-State: AKGB3mLNplhrkp++Tbb74D597Hw7J9+aapvjZfn0wYS0a+etXdyS6E6S TSG/x04uUtLvBBgP0Vq3S/aD X-Received: by 10.99.113.83 with SMTP id b19mr10931656pgn.41.1513321383083; Thu, 14 Dec 2017 23:03:03 -0800 (PST) Received: from localhost.localdomain ([188.166.166.98]) by smtp.gmail.com with ESMTPSA id p19sm12742655pfj.140.2017.12.14.23.02.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Dec 2017 23:03:02 -0800 (PST) From: wbsecg1@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 15 Dec 2017 15:02:44 +0800 Message-Id: <20171215070244.34419-1-wbsecg1@gmail.com> X-Mailer: git-send-email 2.15.1 Subject: [FFmpeg-devel] [PATCH 14/14] videotoolbox: remove opengl compatibility attribute 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 Cc: wang-bin MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: wang-bin 1. a cvpixelbuffer backed by iosurface can always be converted to an opengl texture, using CGLTexImageIOSurface2D for macOS, and undocumented api texImageIOSurface(which is internally used by public api CVOpenGLESTextureCacheCreateTextureFromImage) for iOS4.0+. 2. enabling the attribute can slow down decoding speed a lot. I tested many video clips on my macbook air. for example: ffmpeg -ss 00:00:00 -t 00:03:00 -hwaccel videotoolbox -an -i big_buck_bunny_1080p_h264.mov -f null ->/dev/null, result with the attribute enabled: frame= 2082 fps= 85 q=-0.0 Lsize=N/A time=00:03:00.00 bitrate=N/A speed=7.34x disabled: frame= 2031 fps=104 q=-0.0 Lsize=N/A time=00:03:00.00 bitrate=N/A speed=9.22x --- libavcodec/videotoolbox.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 9d2f0afa20..24631684d7 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -664,11 +664,6 @@ 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);