Skip to content

Commit

Permalink
linux-pipewire: Fix 10- and 16-bit captures
Browse files Browse the repository at this point in the history
  • Loading branch information
PancakeTAS committed Aug 28, 2024
1 parent 8251005 commit 6f0717f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugins/linux-pipewire/pipewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,9 @@ static void process_video_sync(obs_pipewire_stream *obs_pw_stream)
obs_pw_stream->texture = gs_texture_create_from_dmabuf(
obs_pw_stream->format.info.raw.size.width,
obs_pw_stream->format.info.raw.size.height,
obs_pw_video_format.drm_format, GS_BGRX, planes, fds,
strides, offsets, use_modifiers ? modifiers : NULL);
obs_pw_video_format.drm_format,
obs_pw_video_format.gs_format, planes, fds, strides,
offsets, use_modifiers ? modifiers : NULL);

if (obs_pw_stream->texture == NULL) {
remove_modifier_from_format(
Expand Down Expand Up @@ -1373,6 +1374,13 @@ void obs_pipewire_stream_video_render(obs_pipewire_stream *obs_pw_stream,
gs_blend_state_push();
gs_blend_function(GS_BLEND_ONE, GS_BLEND_INVSRCALPHA);

enum gs_color_format format = s_get_color_space() == GS_CS_SRGB
? "Draw"
: "DrawSrgbDecompress";
gs_technique_t *tech = gs_effect_get_technique(effect, format);
gs_technique_begin(tech);
gs_technique_begin_pass(tech, 0);

if (has_effective_crop(obs_pw_stream)) {
gs_draw_sprite_subregion(obs_pw_stream->texture, flip,
obs_pw_stream->crop.x,
Expand Down Expand Up @@ -1404,6 +1412,9 @@ void obs_pipewire_stream_video_render(obs_pipewire_stream *obs_pw_stream,
gs_matrix_pop();
}

gs_technique_end_pass(tech);
gs_technique_end(tech);

gs_blend_state_pop();
}

Expand Down

0 comments on commit 6f0717f

Please sign in to comment.