Skip to content

Commit 39fca52

Browse files
committed
avutil/hwcontext_cuda: add CUstream in cuda hwctx
1 parent 0cc43b2 commit 39fca52

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5887,8 +5887,10 @@ check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
58875887
check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
58885888

58895889
if ! disabled ffnvcodec; then
5890-
check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.1" \
5891-
"ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""
5890+
check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.2" \
5891+
"ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" "" || \
5892+
{ test_pkg_config ffnvcodec_tmp "ffnvcodec < 8.1" "" "" && check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.2" \
5893+
"ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" ""; }
58925894
fi
58935895

58945896
check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"

doc/APIchanges

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
1515

1616
API changes, most recent first:
1717

18+
2018-05-xx - xxxxxxxxxx - lavu 56.18.101 - hwcontext_cuda.h
19+
Add AVCUDADeviceContext.stream.
20+
1821
2018-04-xx - xxxxxxxxxx - lavu 56.18.100 - pixdesc.h
1922
Add AV_PIX_FMT_FLAG_ALPHA to AV_PIX_FMT_PAL8.
2023

libavutil/hwcontext_cuda.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ static int cuda_device_create(AVHWDeviceContext *ctx, const char *device,
386386
goto error;
387387
}
388388

389+
// Setting stream to NULL will make functions automatically use the default CUstream
390+
hwctx->stream = NULL;
391+
389392
cu->cuCtxPopCurrent(&dummy);
390393

391394
hwctx->internal->is_allocated = 1;

libavutil/hwcontext_cuda.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal;
4141
*/
4242
typedef struct AVCUDADeviceContext {
4343
CUcontext cuda_ctx;
44+
CUstream stream;
4445
AVCUDADeviceContextInternal *internal;
4546
} AVCUDADeviceContext;
4647

libavutil/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
#define LIBAVUTIL_VERSION_MAJOR 56
8282
#define LIBAVUTIL_VERSION_MINOR 18
83-
#define LIBAVUTIL_VERSION_MICRO 100
83+
#define LIBAVUTIL_VERSION_MICRO 101
8484

8585
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
8686
LIBAVUTIL_VERSION_MINOR, \

0 commit comments

Comments
 (0)