From patchwork Tue May 8 18:36:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Rothenpieler X-Patchwork-Id: 8880 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp4335053jad; Tue, 8 May 2018 11:37:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrAICcojz7B1W9pDJCXzGCRNjIcuUg1nhdCPSwOaMo4Sqmh6Ayxqm5TrxFOh3+cb+V0o/G3 X-Received: by 2002:adf:acae:: with SMTP id o43-v6mr31359118wrc.132.1525804621946; Tue, 08 May 2018 11:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525804621; cv=none; d=google.com; s=arc-20160816; b=kENcoCkhvWI/vVhmnfqI6XbOWj6+EqTXhkWQPcWfHeyUFWX8rdsIaGb18oQLSetBEG tZFE51x5CYtWUJMKjQ+lygV0ByVOoe6jxY3UYzN6LH/54Bc6WBB6x9yIeADbqnzQlBPm 4D38UmxzbrXNOfiSxte0ELiqvqnrh/gi+maD7ipgtAeshzAsxDRvb17+sDIbDSTYjZAq 31OX49sVyWDai4pFSBkMjVCSSdLBTd+OwHvTqmUbzAPtQhCksmx5t0D1duEYRgxX9okO 2Z+00f8CBaNf9h2jGkt+uY/RtGTukU5cJDK5aH6taq4PdWlLr/5aFO3720qO/7RRptnx QHqQ== 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=tE2VXY4sPOXbMFrmfFqA3bBtOQ/53vP53w8nRfD1HpI=; b=fMboKgt+kpPJvET6B/Zyjnkg1JGc0bLZh/xdA9l/vuOz+GROV0c7ro+AVqT1uzwhNf o35d7riV2SvDhV9/5p7uYqlkDiBEdToPssGOAfunYtzi3LgYqNwkya9oycwWLOjnWU2t eq90qlJr3IHNDvt/dlTskdrcc54DvRZM4iD6rgizbW6Jpfmfc8cuJaDga8riCU6M5Xb2 dF4ETFkAuA0egwMnOHYdjOfDh/QqFwAb3G3v+/Lx5nTL/F6qtkA+WayUBtTswOlKGnlm zVkXsEcISV7Jc6Nr7k4n9leZX4cuF0BS79ScPbwKUxGabLT9dQJX593Ismr9Um/B91Om cQkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@rothenpieler.org header.s=mail header.b=FzrkvS8a; 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 j49-v6si22052162wra.424.2018.05.08.11.37.01; Tue, 08 May 2018 11:37:01 -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=FzrkvS8a; 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 6CB7668A778; Tue, 8 May 2018 21:36: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 8DFFD68A727 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 C687773B16; 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=1525804605; bh=nJMgPUurjY1PTsybJwWd+42dJj46TXaGKpBGWSwaQBs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FzrkvS8aUzIta7UL9i9qoDnjKMFGB2eU1abH3ane7ouTzPzveGsofvdURAgxRm2Jm vST99o0qNeTkTQuF4NWHN9F//taRdw5WhCBtM3TicWFue2m2v8PtA3jn7fPhhKUIyl DSS3UsMgZ5qSuvaGOl1mxIL3dbwaNYRbTfySDjMM= From: Timo Rothenpieler To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 May 2018 20:36:37 +0200 Message-Id: <20180508183640.13605-2-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 2/5] 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, 12 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 6626111ff2..9743de05d0 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 ede5b186ae..bbefc8356e 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -15,6 +15,9 @@ libavutil: 2017-10-21 API changes, most recent first: +2018-05-xx - xxxxxxxxxx - lavu 56.18.101 - hwcontext_cuda.h + 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 37827a770c..f3e81680e9 100644 --- a/libavutil/hwcontext_cuda.c +++ b/libavutil/hwcontext_cuda.c @@ -386,6 +386,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 12dae8449e..81a0552cab 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 5185454d9b..186fe0794d 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -80,7 +80,7 @@ #define LIBAVUTIL_VERSION_MAJOR 56 #define LIBAVUTIL_VERSION_MINOR 18 -#define LIBAVUTIL_VERSION_MICRO 100 +#define LIBAVUTIL_VERSION_MICRO 101 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \