diff mbox

[FFmpeg-devel,NV,HEADERS] Add cuCtxGetDevice

Message ID 20190912131904.7692-1-robux4@ycbcr.xyz
State New
Headers show

Commit Message

Steve Lhomme Sept. 12, 2019, 1:19 p.m. UTC
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(+)

Comments

Steve Lhomme Sept. 12, 2019, 1:20 p.m. UTC | #1
This is for this repo: 
https://git.videolan.org/?p=ffmpeg/nv-codec-headers.git

On 2019-09-12 15:19, Steve Lhomme wrote:
> 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");
> -- 
> 2.17.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
Timo Rothenpieler Sept. 13, 2019, 9:56 a.m. UTC | #2
On 12/09/2019 15:19, Steve Lhomme wrote:
> 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(+)
> 

applied
Steve Lhomme Sept. 16, 2019, 11:27 a.m. UTC | #3
On 2019-09-13 11:56, Timo Rothenpieler wrote:
> On 12/09/2019 15:19, Steve Lhomme wrote:
>> 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(+)
>>
> 
> applied

Thanks !

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox

Patch

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");