mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-04 14:00:44 +09:00
Fix AMD single monitor rotated display being rotated in recording
If there is only one monitor connected and it's rotated then the drm buf will also be rotated. This only the case with AMD and only when using one monitor! To fix this, we perform color conversion with an opengl shader which allows us to also rotate the texture. VAAPI supports rotation but it's not implemented by AMD at least. Performance seems to be the same as when using VAAPI, even when GPU usage is 100%.
This commit is contained in:
@@ -452,10 +452,21 @@ static void gsr_capture_xcomposite_vaapi_tick(gsr_capture *cap, AVCodecContext *
|
||||
params.output_region = NULL;
|
||||
params.output_background_color = 0;
|
||||
params.filter_flags = VA_FRAME_PICTURE;
|
||||
// TODO: Colors
|
||||
|
||||
params.input_color_properties.colour_primaries = 1;
|
||||
params.input_color_properties.transfer_characteristics = 1;
|
||||
params.input_color_properties.matrix_coefficients = 1;
|
||||
params.surface_color_standard = VAProcColorStandardBT709;
|
||||
params.input_color_properties.color_range = (*frame)->color_range == AVCOL_RANGE_JPEG ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
|
||||
|
||||
params.output_color_properties.colour_primaries = 1;
|
||||
params.output_color_properties.transfer_characteristics = 1;
|
||||
params.output_color_properties.matrix_coefficients = 1;
|
||||
params.output_color_standard = VAProcColorStandardBT709;
|
||||
params.output_color_properties.color_range = (*frame)->color_range == AVCOL_RANGE_JPEG ? VA_SOURCE_RANGE_FULL : VA_SOURCE_RANGE_REDUCED;
|
||||
|
||||
params.processing_mode = VAProcPerformanceMode;
|
||||
|
||||
va_status = vaCreateBuffer(cap_xcomp->va_dpy, cap_xcomp->context_id, VAProcPipelineParameterBufferType, sizeof(params), 1, ¶ms, &cap_xcomp->buffer_id);
|
||||
if(va_status != VA_STATUS_SUCCESS) {
|
||||
fprintf(stderr, "gsr error: gsr_capture_xcomposite_vaapi_tick: vaCreateBuffer failed: %d\n", va_status);
|
||||
|
||||
Reference in New Issue
Block a user