File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/torchcodec/decoders/_core Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ AVBufferRef* getFromCache(const torch::Device& device) {
7777 return nullptr ;
7878}
7979
80+ #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 26, 100)
81+
8082AVBufferRef* getFFMPEGContextFromExistingCudaContext (
8183 const torch::Device& device,
8284 torch::DeviceIndex nonNegativeDeviceIndex,
@@ -105,6 +107,8 @@ AVBufferRef* getFFMPEGContextFromExistingCudaContext(
105107 return hw_device_ctx;
106108}
107109
110+ #else
111+
108112AVBufferRef* getFFMPEGContextFromNewCudaContext (
109113 const torch::Device& device,
110114 torch::DeviceIndex nonNegativeDeviceIndex,
@@ -122,6 +126,8 @@ AVBufferRef* getFFMPEGContextFromNewCudaContext(
122126 return hw_device_ctx;
123127}
124128
129+ #endif
130+
125131AVBufferRef* getCudaContext (const torch::Device& device) {
126132 enum AVHWDeviceType type = av_hwdevice_find_type_by_name (" cuda" );
127133 TORCH_CHECK (type != AV_HWDEVICE_TYPE_NONE, " Failed to find cuda device" );
You can’t perform that action at this time.
0 commit comments