From patchwork Tue May 8 13:31:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 8867 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp4021759jad; Tue, 8 May 2018 06:32:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXiHHUDSLZY9PAvcfm/4H5I5Jmun90fkQ+AXKSD3Oqwm0JZ5bp1hRrAHGmaTU4pt2rFZB5 X-Received: by 2002:a1c:41c1:: with SMTP id o184-v6mr3516968wma.127.1525786326342; Tue, 08 May 2018 06:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525786326; cv=none; d=google.com; s=arc-20160816; b=sWiJRgj8IrnhZSKyqmElnCATUKp1vS1ZY4e87Xn49w22rBuiqqRQ+1SHNLAMniXhFy eCY/Mlzt+6TR3Fbt+WzUK/+Q1rc0bJiXhq2qZZ1M0wkREqefWAmpl2iNyK1KjbJ6BxM1 9VhwaFdkfByrrvf1YFRxt6gW4ImhitgVFGgTZcxVJRjOQMf/AXkkfu7Z6H1vYZH0rqH/ a0vsOBKc6+AByGbU/s6IjZ+oVukcr+eS2Jm5wAEVxiT1j6FLXqUElTxMOEiO9NqOUTdp XYI0lFMwEAv7mms28VJc2OIVJIvkXEOLDs7qDxKoZb6be1uHOcimmx5glVNltORh0qlI ONaA== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=A6c0ooXxlHY4SDbk14PhYi7Z2LSqA6ajBgOHD03aMdg=; b=Ow4oyX1WSYvJi04+Pm9K3cQ+ubufxlcefaRoqUzsjGbwSWgQn915FLSPT5mA3JMjhP L0xlwoz1ulOKq++ygl1K9+d1kLWUlArL3wfVaPPnoqAVkH7koShaUQI8UgS4mVN9yD/y yecK3LlrIHuehWylptpJ16bmaElF4pfHdq/ajX3ZPOy2B9UHZoC44fURp2aOPHE86WPz 6LMkm60gEhMDsX6iY80bsIfY/4uV7nJkyyo3CO5JjMr8gF3vB2BgnD8b0UGCZUn+ZAzw H6J9UO8GFRgjJI8EymfVV27GEeB7QignhcVuYCfFr26xxrno2WzBBtRkY7R0JEihwfJE rL7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=cwymMirS; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o9-v6si6480428wmb.46.2018.05.08.06.32.05; Tue, 08 May 2018 06:32:06 -0700 (PDT) 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=@rothenpieler.org header.s=mail header.b=cwymMirS; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A2F3B68A6DB; Tue, 8 May 2018 16:31:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from btbn.de (btbn.de [5.9.118.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 323C268A47C for ; Tue, 8 May 2018 16:31:10 +0300 (EEST) Received: from localhost.localdomain (200116b864513a00ba975afffe10ec69.dip.versatel-1u1.de [IPv6:2001:16b8:6451:3a00:ba97:5aff:fe10:ec69]) by btbn.de (Postfix) with ESMTPSA id 2CCCF734C0; Tue, 8 May 2018 15:31:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1525786304; bh=dGjIhaGR4wYkwMCKrY7qABq1udMleJOad7JinFRKZ4g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cwymMirS5Xhl9YCyrFmUEuosuzpH35zwbGecOHPsJ2cVnXVGqmR4Eo6T2itbeGtfd R3Y+rSvEeRpTXb38JSdAMGsm4xUqYDfD1Ipja7dRTXp7U2sHOuYoT3YiGFfYraX/aU rgoE1XyXpg+fc1NA8Flcv5GRBAJz+5us2k1t6hWw= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 May 2018 15:31:30 +0200 Message-Id: <20180508133132.28940-4-timo@rothenpieler.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180508133132.28940-1-timo@rothenpieler.org> References: <20180508133132.28940-1-timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/nvdec: pass CUstream in vpp parameters 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: Timo Rothenpieler MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" --- libavcodec/nvdec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index d98f9dd95e..c5c5c83dc7 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -39,6 +39,7 @@ typedef struct NVDECDecoder { AVBufferRef *hw_device_ref; CUcontext cuda_ctx; + CUstream stream; CudaFunctions *cudl; CuvidFunctions *cvdl; @@ -189,6 +190,7 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref, } decoder->cuda_ctx = device_hwctx->cuda_ctx; decoder->cudl = device_hwctx->internal->cuda_dl; + decoder->stream = device_hwctx->stream; ret = cuvid_load_functions(&decoder->cvdl, logctx); if (ret < 0) { @@ -386,7 +388,7 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame) NVDECFrame *cf = (NVDECFrame*)fdd->hwaccel_priv; NVDECDecoder *decoder = (NVDECDecoder*)cf->decoder_ref->data; - CUVIDPROCPARAMS vpp = { .progressive_frame = 1 }; + CUVIDPROCPARAMS vpp = { 0 }; NVDECFrame *unmap_data = NULL; CUresult err; @@ -397,6 +399,9 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame) unsigned int offset = 0; int ret = 0; + vpp.progressive_frame = 1; + vpp.output_stream = decoder->stream; + err = decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx); if (err != CUDA_SUCCESS) return AVERROR_UNKNOWN;