From patchwork Thu Sep 12 13:19:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Lhomme X-Patchwork-Id: 15048 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 42027447D08 for ; Thu, 12 Sep 2019 16:19:55 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0AFED688075; Thu, 12 Sep 2019 16:19:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx2a.mailbox.org (mx2a.mailbox.org [80.241.60.219]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4A220688062 for ; Thu, 12 Sep 2019 16:19:48 +0300 (EEST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id D4FF3A1887; Thu, 12 Sep 2019 15:19:47 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id ue-JbIBmXuAA; Thu, 12 Sep 2019 15:19:44 +0200 (CEST) From: Steve Lhomme To: ffmpeg-devel@ffmpeg.org Date: Thu, 12 Sep 2019 15:19:04 +0200 Message-Id: <20190912131904.7692-1-robux4@ycbcr.xyz> Subject: [FFmpeg-devel] [PATCH NV HEADERS] Add cuCtxGetDevice 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: Steve Lhomme MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" It can be useful to determine if the decoder context is the same as the display context. It's used in some samples at https://github.com/NVIDIA/video-sdk-samples --- include/ffnvcodec/dynlink_cuda.h | 1 + include/ffnvcodec/dynlink_loader.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/ffnvcodec/dynlink_cuda.h b/include/ffnvcodec/dynlink_cuda.h index ad5da7c..cc1cc00 100644 --- a/include/ffnvcodec/dynlink_cuda.h +++ b/include/ffnvcodec/dynlink_cuda.h @@ -329,6 +329,7 @@ typedef CUresult CUDAAPI tcuMemcpy2D_v2(const CUDA_MEMCPY2D *pcopy); typedef CUresult CUDAAPI tcuMemcpy2DAsync_v2(const CUDA_MEMCPY2D *pcopy, CUstream hStream); typedef CUresult CUDAAPI tcuGetErrorName(CUresult error, const char** pstr); typedef CUresult CUDAAPI tcuGetErrorString(CUresult error, const char** pstr); +typedef CUresult CUDAAPI tcuCtxGetDevice(CUdevice *device); typedef CUresult CUDAAPI tcuStreamCreate(CUstream *phStream, unsigned int flags); typedef CUresult CUDAAPI tcuStreamQuery(CUstream hStream); diff --git a/include/ffnvcodec/dynlink_loader.h b/include/ffnvcodec/dynlink_loader.h index 358acd5..a1fa323 100644 --- a/include/ffnvcodec/dynlink_loader.h +++ b/include/ffnvcodec/dynlink_loader.h @@ -156,6 +156,7 @@ typedef struct CudaFunctions { tcuMemcpy2DAsync_v2 *cuMemcpy2DAsync; tcuGetErrorName *cuGetErrorName; tcuGetErrorString *cuGetErrorString; + tcuCtxGetDevice *cuCtxGetDevice; tcuStreamCreate *cuStreamCreate; tcuStreamQuery *cuStreamQuery; @@ -280,6 +281,7 @@ static inline int cuda_load_functions(CudaFunctions **functions, void *logctx) LOAD_SYMBOL(cuMemcpy2DAsync, tcuMemcpy2DAsync_v2, "cuMemcpy2DAsync_v2"); LOAD_SYMBOL(cuGetErrorName, tcuGetErrorName, "cuGetErrorName"); LOAD_SYMBOL(cuGetErrorString, tcuGetErrorString, "cuGetErrorString"); + LOAD_SYMBOL(cuCtxGetDevice, tcuCtxGetDevice, "cuCtxGetDevice"); LOAD_SYMBOL(cuStreamCreate, tcuStreamCreate, "cuStreamCreate"); LOAD_SYMBOL(cuStreamQuery, tcuStreamQuery, "cuStreamQuery");