From patchwork Tue May 8 18:36:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 8879 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp4335168jad; Tue, 8 May 2018 11:37:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpYFERfFbqi0voVKe4KD8seD6dCo7oi7+IebBD6gjQfYkIb5OaKHrON9uJBvUft6vm/QZiA X-Received: by 2002:adf:b11a:: with SMTP id l26-v6mr22134913wra.258.1525804629661; Tue, 08 May 2018 11:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525804629; cv=none; d=google.com; s=arc-20160816; b=oQzLcsatikEti0p9HiW7HbreTg5OUglfaC0tk5f2iOSUvCKGgCjuWgidKpJkD3Z1ds aPvnvYYozhgLhZDdwN1FdE9s3z7g7GqddYFtNZ5L7Q0ucOuuqWHiJDFQQC3HCw2KyT95 8wexEcrbwUDKvjOfcrildpYcdzctrCRNDhw+3/LDKt1p8n0fM8nyKzTig0IxO/xpkCch r0rCy+L3CaNwpO6bdY7eh18gNe/yFw6QS/mp3+rAbl+VMDtSXQh/4PT2W+hlg+u63PmT RNUDIWZY/5zRMUC8xsEV8QK4zV7y7veKx9Er2kV9eYPYQBoPd7ZLk6RYRPMu6+UIbBaF vT3g== 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=vYzFKwGQFHlxgbbUfegh2IAlA7z6xIjAit2Ti6SMHwc=; b=E4cnwP+MEUYNV8v7l9sPciN86xN/dnleWfVgrH6EYDDPeF0iDe32Hp5BuuuCGFvSMO p5dMoX+KkJktlPTzkefljBOhf6DN3bbmPhnhL4k1u0bUQKRhyxJSXuHFVYxtCT445k98 BE5eQ3a8Fxz79qDysWunYG8uSYInp31g6nhvbDvBatuD6edTKULJLpYjJKZ2b2vLCwKQ i60WnFRCntAy+Gq/pxEkdku1Cp5Cv9b2KP5WoUUNW8XyqeRQ4BOdcW2dp4K2NPchuOSy v5hxGLR+GnqTWuBk51T5Z58uvHGYapDa9K/tM7PPBa12ki5CQUR2UhZTl6/KzgA5gbBK vsnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=E0T4tRat; 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 k1-v6si1473920wri.293.2018.05.08.11.37.09; Tue, 08 May 2018 11:37:09 -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=E0T4tRat; 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 1748868A782; Tue, 8 May 2018 21:36:18 +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 B534268A743 for ; Tue, 8 May 2018 21:36: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 ED33873B17; Tue, 8 May 2018 20:36:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rothenpieler.org; s=mail; t=1525804606; bh=k297V1/Xn6A+74o1+xUpAWgse26EqPXk0VmV3yov8ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E0T4tRatUiuC0e8zcfORqfDa0w6tdC5gzUjasMOhDVq/1Fz6PPsBL6aDZYcTJJFeW RzY9LcpSSsbBA8zRB5wrPgRH060sHO1CX/SHIF8cRyWqXai7beRxoJ3MgliTzgZtb6 ffivCnxhtbW2Lfp5GIe8m4IqKUAVM9E9eozfXEl8= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 May 2018 20:36:38 +0200 Message-Id: <20180508183640.13605-3-timo@rothenpieler.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180508183640.13605-1-timo@rothenpieler.org> References: <20180508133132.28940-1-timo@rothenpieler.org> <20180508183640.13605-1-timo@rothenpieler.org> Subject: [FFmpeg-devel] [PATCH 3/5] 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 502747adfd..e779be3a45 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;