From patchwork Fri Feb 24 09:44:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wm4 X-Patchwork-Id: 2668 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp613146vsf; Fri, 24 Feb 2017 01:44:34 -0800 (PST) X-Received: by 10.28.66.11 with SMTP id p11mr2047743wma.38.1487929474285; Fri, 24 Feb 2017 01:44:34 -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 u4si1512236wma.15.2017.02.24.01.44.33; Fri, 24 Feb 2017 01:44:34 -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=@googlemail.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C8B1680C77; Fri, 24 Feb 2017 11:44:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA4DF680AB0 for ; Fri, 24 Feb 2017 11:44:16 +0200 (EET) Received: by mail-wr0-f195.google.com with SMTP id 89so1661345wrr.1 for ; Fri, 24 Feb 2017 01:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=M0qGDvrop1paPs6nfUBvOLncGbrgBhgXaB9ap1YzuJU=; b=e4NpS6bTaesPkhzhfFkTf/nYUpkK3WdD/sLSFqcmmMksVxPka1jKmI8pNFCZ3stiAx YTJZxpur/eGjLuz3YqhoFUrhq2fBPc/I9RU4XRC5UbgkdEcthZiCM3FB+BlD3shcIysz mSYuGdQVnPq3il41kYVkkLJjx6QNGEzE0SLqvQBEaG1hEHS3DdObXbHom5HujoQB39iz X7/RMvoUI55IYrfzIQyVBh/szQ7Vs6OrBzzIkVvWcVX8J0U/iXnWNAQTo9OUx4XryMEZ dI0iSokTC3Fp/ZhcIR+mUrIXCy9vy1hPhqx6egWfq+5Vb92uPpgzLVpkHrzts+wYSjqB EuvQ== 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=M0qGDvrop1paPs6nfUBvOLncGbrgBhgXaB9ap1YzuJU=; b=X+69JZuCZysCjyHSYO4IA3LgYFk6fTiBPAkBanDIo5QnKbcfa959dK1NQjQWBCnTsk kayHe4ljTJLaMl9S+N+pPYW6nuvrURpNUWtkekLhoo6ACe17JqP688bWLfsdUf71W8ly WfTV72vnqOm2a4ilIHY11RpUWbavAzBm0MjNEV/BQQ8Co1YXyefbE5n50JNE7hiZR1H1 yWB/dPFWhsI33YQZ0HjdDGjzlP1TFMCjvJyg/vd1FKlE3OCnuGRQvsdm82Ei/xceY9ld a3HEv/GRyZCvG5WfkeieDYo7UUkqg6xFVXeNClGEmLnPSClN04WFT/QEDmUvoChxup+U 7Bng== X-Gm-Message-State: AMke39nzv3CQeKnBEsLs9erhE/gxeYgkmIeE1LNuUZl9MY1JXkZgehmqGG6ICm2vle+OMQ== X-Received: by 10.223.133.205 with SMTP id 13mr1799619wru.1.1487929465025; Fri, 24 Feb 2017 01:44:25 -0800 (PST) Received: from localhost.localdomain (p4FF003EB.dip0.t-ipconnect.de. [79.240.3.235]) by smtp.googlemail.com with ESMTPSA id j2sm4795700wrd.67.2017.02.24.01.44.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 01:44:24 -0800 (PST) From: wm4 To: ffmpeg-devel@ffmpeg.org Date: Fri, 24 Feb 2017 10:44:23 +0100 Message-Id: <20170224094423.12401-1-nfxjfg@googlemail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] lavc/videotoolbox: allow not setting the kCVPixelBufferPixelFormatTypeKey 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: wm4 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" If AVVideotoolboxContext.cv_pix_fmt_type is set to 0, don't set the kCVPixelBufferPixelFormatTypeKey value on the VT decoder. This makes VT output its native format, which can be much faster on some hardware iterations (if the native format does not match with the requested format, it will be converted, which is slow). The default is still forcing nv12. --- TODO: minor libavcodec bump --- libavcodec/videotoolbox.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 1288aa5087..2ebe60fb5c 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -472,7 +472,8 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt); + if (pix_fmt) + CFDictionarySetValue(buffer_attributes, kCVPixelBufferPixelFormatTypeKey, cv_pix_fmt); CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties); CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w); CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h);