From patchwork Sat Dec 18 11:09:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ridley Combs X-Patchwork-Id: 32705 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp2464622iog; Sat, 18 Dec 2021 03:10:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9WeoA+EZ6gCKoTih9j5X1yuGBAVpwajGO5s3295ytm3v94XRdjuXDSYCdqAqFTgzvpB6U X-Received: by 2002:a50:c3cf:: with SMTP id i15mr6754088edf.216.1639825842381; Sat, 18 Dec 2021 03:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639825842; cv=none; d=google.com; s=arc-20160816; b=cYhV2ip22A8G090xQe9dFRttGqc2GFt0phB5XqfAyMylty1+GH/wr6N2Wuol7o0I24 sA6ILFSg/r0nuhSQ2F08Ybe2WSrntMwSXgXh8p1DuQWp7ZSofN0zcsdreNBWsK+rnlpy DpXPl1XqtTcjx3E4S5NiYa59/EhmZQ24oZDPLy+0+CJEcWVY0Y6DNocTB0fcUXra7ZNN gL8la3lUxD+LSty54RvK+OFGXb2XimJACfADsXcd2yqMex632i4U+Cv2Q9Rwh1D8DJ9J iJ7GOv5BDrBstWEGsj7YDI0tpsDxNTe753ON/b/oqywKWIfOm6eqDHdXn8saPvOR2l/V GA7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=UCBwaLAJU/p+Au47SZiL3gZJOi6g/YWjbGGF6rRm0a8=; b=nW+MFs3CE+Du6FI+cWTT+UJH9dUwaEBtYZ39evYb2H0XknguDC7Wh/zj6Yw7XWn4Rs CJ05Rw43DImUW9Gi646LH/kpnZ3h5Fluy7NkbB+0rFkDDmVEnHnquQXPTjBcOXZX0DYK LCdD8c5wLU7opDZppjsYXkYbhd5Z0wm68cKTUChuziYS0KHAhypgst/raQry1zLLrcFZ NoQIxko2OgE/235yR1Ki4OztvyKn+uKkE6e9/LU6rHxV5sZ5y7nv5xhlHOzWsbHHeHYB MbYFoMvYu/c4Me+JuKjpk3ohwCQWAdeL3YsxZLLgkOYtvhv8ADlc4KL2YrNcckVr0+cr IZ+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rcombs.me header.s=google header.b=F34vCaW0; 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=rcombs.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id oz20si22232ejc.528.2021.12.18.03.10.42; Sat, 18 Dec 2021 03:10:42 -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=@rcombs.me header.s=google header.b=F34vCaW0; 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=rcombs.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3400C68AFA1; Sat, 18 Dec 2021 13:10:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 16F1768A6F6 for ; Sat, 18 Dec 2021 13:10:15 +0200 (EET) Received: by mail-qv1-f49.google.com with SMTP id o10so4794493qvc.5 for ; Sat, 18 Dec 2021 03:10:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rcombs.me; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=hZ4I43g9OmOsvazFh/sqKT/SX4xIePHJ8wXqwwITnBg=; b=F34vCaW03v0fmZWBJkSi7FWtkroNsKgNCo1ge9kjL7PaU55dy5bg2syqgKmxYETMbJ T3RIlyNUQbbZxhg7S9xHqQKEJ7voKZds+HdDN2FGD0aOsdrLveRbompvMigSqm49HdZY YifH8RbMYrpIBtZbGxDOkelEofTzv5hMeWxAv8ewnFevyz/kzUFv+HnGOTb+kzN3cDLm BuelR/B/lJkBdqVw0RZhiDVgo5eJD2RbK7TjAGGZbQ0OmYIKwn4NW6fRh5mVS3f45P69 g381q5pwXHReY4lr/WMeE4w5+IaivSlAWU2QCnOh7q7jZtIp6UEq6MnD1vDXzfSuaTs0 NVAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hZ4I43g9OmOsvazFh/sqKT/SX4xIePHJ8wXqwwITnBg=; b=7Zlz1hCbw3diW4Frse8/Juu/85aYzLQeVdm/zXvCedHTx8rS1m/TByQUTjrrWGJfEd hRgS9DTMpQ0TIojI2krM1K15aSveKJoKVMxTh9YBEfhHW6WRTgxnSUxbmWdvfgg2LmSV Quofjx0iyJgWodSYqWSx3e9Ry7l56a/f09uG5k4xL0VoyFe1uoI7V3U8E0yDqgw/trXi q3f+qa4BJmhAnKQCA4+SxBZ5DUCbI2vRp2DiKawkFjboESKHkUMvFA8iOEzOaRSqlAvK VgokBfXx3L/Sp4xmt4WGTt9bQOxUOkmKoSC60tGLdiRt6kPSV1BVeBXRZqOvb/ipvZq8 dwiw== X-Gm-Message-State: AOAM530Us8h50XL5jHLjzV0uSUlssGHuP7VSQe3HgdyNga2/jbaIwcyr 7C1CTRq+DcnPaiJq2xTDLlRVR6J23e+DK4g= X-Received: by 2002:a05:6214:260d:: with SMTP id gu13mr6108970qvb.89.1639825813472; Sat, 18 Dec 2021 03:10:13 -0800 (PST) Received: from rcombs-mbp.localdomain ([2601:243:2000:5ac:70a5:b034:a3a1:e733]) by smtp.gmail.com with ESMTPSA id h19sm9571162qth.63.2021.12.18.03.10.12 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 18 Dec 2021 03:10:13 -0800 (PST) From: rcombs To: ffmpeg-devel@ffmpeg.org Date: Sat, 18 Dec 2021 05:09:53 -0600 Message-Id: <20211218110953.30751-3-rcombs@rcombs.me> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211218110953.30751-1-rcombs@rcombs.me> References: <20211218110953.30751-1-rcombs@rcombs.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] lavc/videotoolbox: set attachments on decoded buffers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: LexunZ7GtaNx VideoToolbox internally sets all the colorspace parameters to BT709, regardless of what the bitstream actually indicates, so we need to replace that with what we've parsed. --- libavcodec/videotoolbox.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 519f55a9ab..69beb3881f 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -90,6 +90,7 @@ int ff_videotoolbox_buffer_copy(VTContext *vtctx, static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame) { + int ret; VTHWFrame *ref = (VTHWFrame *)frame->buf[0]->data; if (!ref->pixbuf) { @@ -103,6 +104,9 @@ static int videotoolbox_postproc_frame(void *avctx, AVFrame *frame) frame->crop_top = 0; frame->crop_bottom = 0; + if ((ret = av_vt_pixbuf_set_attachments(avctx, ref->pixbuf, frame)) < 0) + return ret; + frame->data[3] = (uint8_t*)ref->pixbuf; if (ref->hw_frames_ctx) {