aboutsummaryrefslogtreecommitdiff
path: root/src/capture/xcomposite_cuda.c
diff options
context:
space:
mode:
authorSteam Deck User <deck@archlinux.steamdeck>2023-04-01 15:14:36 +0200
committerSteam Deck User <deck@archlinux.steamdeck>2023-04-01 16:29:24 +0200
commit2f67083915ccb16727d00d49917a520d0962fb8c (patch)
tree6bc13adc7819305f03aa3e68f904d9e19e4b1248 /src/capture/xcomposite_cuda.c
parent162eac8c2f460ac8231696b511785d69bb7c97ff (diff)
Use vaapi to do rgb->yuv420p color conversion
Enable window capture for amd/intel. Properly check if h264/hevc is supported on amd/intel before using codec.
Diffstat (limited to 'src/capture/xcomposite_cuda.c')
-rw-r--r--src/capture/xcomposite_cuda.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/capture/xcomposite_cuda.c b/src/capture/xcomposite_cuda.c
index a812c12..1ea9923 100644
--- a/src/capture/xcomposite_cuda.c
+++ b/src/capture/xcomposite_cuda.c
@@ -131,8 +131,8 @@ static bool cuda_create_codec_context(gsr_capture_xcomposite_cuda *cap_xcomp, AV
return false;
}
- video_codec_context->hw_device_ctx = device_ctx;
- video_codec_context->hw_frames_ctx = frame_context;
+ video_codec_context->hw_device_ctx = av_buffer_ref(device_ctx);
+ video_codec_context->hw_frames_ctx = av_buffer_ref(frame_context);
return true;
}
@@ -252,9 +252,8 @@ static void gsr_capture_xcomposite_cuda_stop(gsr_capture *cap, AVCodecContext *v
if(video_codec_context->hw_device_ctx)
av_buffer_unref(&video_codec_context->hw_device_ctx);
- // Not needed because the above call to unref device ctx also frees this?
- //if(video_codec_context->hw_frames_ctx)
- // av_buffer_unref(&video_codec_context->hw_frames_ctx);
+ if(video_codec_context->hw_frames_ctx)
+ av_buffer_unref(&video_codec_context->hw_frames_ctx);
if(cap_xcomp->cuda.cu_ctx) {
CUcontext old_ctx;