MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / cuda_init_avcodec_hardware_input_buffer

Function cuda_init_avcodec_hardware_input_buffer

src/video.cpp:2917–2928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2915 }
2916
2917 util::Either<avcodec_buffer_t, int> cuda_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *encode_device) {
2918 avcodec_buffer_t hw_device_buf;
2919
2920 auto status = av_hwdevice_ctx_create(&hw_device_buf, AV_HWDEVICE_TYPE_CUDA, nullptr, nullptr, 1 /* AV_CUDA_USE_PRIMARY_CONTEXT */);
2921 if (status < 0) {
2922 char string[AV_ERROR_MAX_STRING_SIZE];
2923 BOOST_LOG(error) << "Failed to create a CUDA device: "sv << av_make_error_string(string, AV_ERROR_MAX_STRING_SIZE, status);
2924 return -1;
2925 }
2926
2927 return hw_device_buf;
2928 }
2929
2930 util::Either<avcodec_buffer_t, int> vt_init_avcodec_hardware_input_buffer(platf::avcodec_encode_device_t *encode_device) {
2931 avcodec_buffer_t hw_device_buf;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected