From patchwork Tue May 8 13:31:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 8868 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp4021946jad; Tue, 8 May 2018 06:32:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoSmirrVzKX8ll5H+Xy6YS+gw4FQaI8L3/gz4ie0upx27l0N91iYn89ex9uQPl2xezmDhEE X-Received: by 2002:adf:b00f:: with SMTP id f15-v6mr36690473wra.254.1525786336028; Tue, 08 May 2018 06:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525786335; cv=none; d=google.com; s=arc-20160816; b=qiSEjgWFdtkYC0XERCcllhlUCU6GQM/o5jSPD95dbZ3gPyU/HV7JA4eZEaxOqTo83e egQOmjJWmqA5MRK+MSExUpZDsH+DUbQIGJrDMMWM33ub2uQsz9MJ9fsacsShnoEL0qzS HBQapm9HLcPTCRsLRNMYYFYEGWqdxsa0wI79GxRH0unu1Se4UcJe0fKo/jDXPFZxA0Xl qFOEpeQiw5XnNP7ww0lHcbrNPRReqoSOyFO+8UGxlrqusJAwXPYeetoviuBweXEbKue6 rwyPpZfz1ms0Vls/TCw97UMBQM9386ljf1+8oqcfsaNEvBSEHe4Bkp3G2Y6U98ORyHiX Ow+Q== 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=SszMeXVE/DV+WWPP5L7kOSXzUkpjcCwRqIntiixfjbk=; b=wLJvJpZyuQhGud0C2S5lysB3UJFyLvi4iLPvaRvC4Nb2ss36tqotKNTG0ZZrmxUZxA bXFpSy9ji+Z52dowKji6jAN9i8geJAPVuEJFNgBAsyzamQylQFQbEGPbJzZib8G/pU36 5JA42/fOO4i/dGHm+ILFyzZ/tCTIBtpbmzbOiM3SXqDnjTvJjvjejrTqCtg7ykgI7G6q y4DgxSu+1moPWGS+Wqk5qiJftjNU6dvlQewXfD63xWAs/yk7gEMm9ricPq61InW2Bwot y3IexGYQgyIKtxgmNSGQ7lbdEdpd6ePV+wdMJUwqse6bIQ4+OlODtDO3M/r/MRRED1HC cVrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=21FPvXba; 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 a83-v6si1271385wmi.143.2018.05.08.06.32.15; Tue, 08 May 2018 06:32:15 -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=21FPvXba; 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 4328D68A6D1; Tue, 8 May 2018 16:31: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 2C5AF68A2BE 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 062D17328B; 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=n7A+t28IjLQhiSTbH7ZR/jYMA62XVgHDBFTCp8CcPx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=21FPvXbaQkgHwzy7JvVnYAv8LX9D4ZOyBXflrS0HfnD3RlytwJRYMjpmI530cRxC1 OvSpuBqUHbVqsNDghJQWglur7W5kyGt9U0rA0aAs41kBd4ZbpAD34Np7OFo+GAWcSN tKLFrn6grRQP4laPb/XOTeWJYZHB6bqGuSy97FZY= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 May 2018 15:31:29 +0200 Message-Id: <20180508133132.28940-3-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 3/6] avutil/hwcontext_cuda: add CUstream in cuda hwctx 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" --- configure | 6 ++++-- doc/APIchanges | 3 ++- libavutil/hwcontext_cuda.c | 3 +++ libavutil/hwcontext_cuda.h | 1 + libavutil/version.h | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 7c143238a8..cae8a235a4 100755 --- a/configure +++ b/configure @@ -5887,8 +5887,10 @@ check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9" check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC" if ! disabled ffnvcodec; then - check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.1" \ - "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" + check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \ + "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" || \ + { test_pkg_config ffnvcodec_tmp "ffnvcodec < 8.1" "" "" && check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2" \ + "ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""; } fi check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" diff --git a/doc/APIchanges b/doc/APIchanges index f8ae6b0433..7a0a8522f9 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,8 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: -2018-05-xx - xxxxxxxxxx - lavu 56.19.100 - hwcontext_cuda.h +2018-05-xx - xxxxxxxxxx, xxxxxxxxxx - lavu 56.19.100/101 - hwcontext_cuda.h Add AVCUDAFramesContext and AVCUDAFramesContext.flags. + Add AVCUDADeviceContext.stream. 2018-04-xx - xxxxxxxxxx - lavu 56.18.100 - pixdesc.h Add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8. diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c index b0b4bf24ae..8024eec79d 100644 --- a/libavutil/hwcontext_cuda.c +++ b/libavutil/hwcontext_cuda.c @@ -395,6 +395,9 @@ static int cuda_device_create(AVHWDeviceContext *ctx, const char *device, goto error; } + // Setting stream to NULL will make functions automatically use the default CUstream + hwctx->stream = NULL; + cu->cuCtxPopCurrent(&dummy); hwctx->internal->is_allocated = 1; diff --git a/libavutil/hwcontext_cuda.h b/libavutil/hwcontext_cuda.h index 19accbd9be..cd797ae920 100644 --- a/libavutil/hwcontext_cuda.h +++ b/libavutil/hwcontext_cuda.h @@ -41,6 +41,7 @@ typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal; */ typedef struct AVCUDADeviceContext { CUcontext cuda_ctx; + CUstream stream; AVCUDADeviceContextInternal *internal; } AVCUDADeviceContext; diff --git a/libavutil/version.h b/libavutil/version.h index 84409b1d69..f84ec89154 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -80,7 +80,7 @@ #define LIBAVUTIL_VERSION_MAJOR 56 #define LIBAVUTIL_VERSION_MINOR 19 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \