mirror of
https://github.com/mpv-player/mpv
synced 2025-03-18 17:40:30 +00:00
vd_lavc: cuda requires setting hw_device_ctx
This restores cuda/cuvid under Windows. Cuvid is relatively useless under Windows, but this was requested.
This commit is contained in:
parent
2f5ba78a0b
commit
dc5fcced23
@ -593,7 +593,7 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
|
||||
if (ctx->hwdec_dev->restore_device)
|
||||
ctx->hwdec_dev->restore_device(ctx->hwdec_dev);
|
||||
if (!ctx->hwdec->set_hwframes) {
|
||||
#if HAVE_VDPAU_HWACCEL
|
||||
#if HAVE_VDPAU_HWACCEL || HAVE_CUDA_HWACCEL
|
||||
avctx->hw_device_ctx = av_buffer_ref(ctx->hwdec_dev->av_device_ref);
|
||||
#else
|
||||
goto error;
|
||||
|
@ -2,11 +2,14 @@
|
||||
|
||||
typedef void * CUcontext;
|
||||
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/hwcontext_cuda.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_CUDA;
|
||||
AVCUDADeviceContextInternal *foo;
|
||||
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
|
||||
avctx->hw_device_ctx = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user