|
@@ -806,10 +806,11 @@ static void process_video_sync(obs_pipewire_stream *obs_pw_stream)
|
|
g_clear_pointer(&obs_pw_stream->texture, gs_texture_destroy);
|
|
g_clear_pointer(&obs_pw_stream->texture, gs_texture_destroy);
|
|
|
|
|
|
use_modifiers = obs_pw_stream->format.info.raw.modifier != DRM_FORMAT_MOD_INVALID;
|
|
use_modifiers = obs_pw_stream->format.info.raw.modifier != DRM_FORMAT_MOD_INVALID;
|
|
- 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, obs_pw_video_format.gs_format, planes, fds, strides, offsets,
|
|
|
|
- use_modifiers ? modifiers : NULL);
|
|
|
|
|
|
+ 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);
|
|
|
|
|
|
if (obs_pw_stream->texture == NULL) {
|
|
if (obs_pw_stream->texture == NULL) {
|
|
remove_modifier_from_format(obs_pw_stream, obs_pw_stream->format.info.raw.format,
|
|
remove_modifier_from_format(obs_pw_stream, obs_pw_stream->format.info.raw.format,
|
|
@@ -1326,20 +1327,10 @@ void obs_pipewire_stream_video_render(obs_pipewire_stream *obs_pw_stream, gs_eff
|
|
gs_sync_destroy(acquire_sync);
|
|
gs_sync_destroy(acquire_sync);
|
|
}
|
|
}
|
|
|
|
|
|
- effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
|
|
|
|
- gs_technique_t *tech = gs_effect_get_technique(effect, "DrawSrgbDecompress");
|
|
|
|
- gs_technique_begin(tech);
|
|
|
|
- gs_technique_begin_pass(tech, 0);
|
|
|
|
-
|
|
|
|
- const bool linear_srgb = gs_get_linear_srgb();
|
|
|
|
- const bool previous = gs_framebuffer_srgb_enabled();
|
|
|
|
- gs_enable_framebuffer_srgb(linear_srgb);
|
|
|
|
-
|
|
|
|
|
|
+ /* FIXME: Use obs_pw_stream->format.info.raw colorimetry info to handle
|
|
|
|
+ * textures in their corresponding color space */
|
|
image = gs_effect_get_param_by_name(effect, "image");
|
|
image = gs_effect_get_param_by_name(effect, "image");
|
|
- if (linear_srgb)
|
|
|
|
- gs_effect_set_texture_srgb(image, obs_pw_stream->texture);
|
|
|
|
- else
|
|
|
|
- gs_effect_set_texture(image, obs_pw_stream->texture);
|
|
|
|
|
|
+ gs_effect_set_texture(image, obs_pw_stream->texture);
|
|
|
|
|
|
rotated = push_rotation(obs_pw_stream);
|
|
rotated = push_rotation(obs_pw_stream);
|
|
|
|
|
|
@@ -1373,10 +1364,7 @@ void obs_pipewire_stream_video_render(obs_pipewire_stream *obs_pw_stream, gs_eff
|
|
gs_matrix_push();
|
|
gs_matrix_push();
|
|
gs_matrix_translate3f(cursor_x, cursor_y, 0.0f);
|
|
gs_matrix_translate3f(cursor_x, cursor_y, 0.0f);
|
|
|
|
|
|
- if (linear_srgb)
|
|
|
|
- gs_effect_set_texture_srgb(image, obs_pw_stream->cursor.texture);
|
|
|
|
- else
|
|
|
|
- gs_effect_set_texture(image, obs_pw_stream->cursor.texture);
|
|
|
|
|
|
+ gs_effect_set_texture(image, obs_pw_stream->cursor.texture);
|
|
gs_draw_sprite(obs_pw_stream->texture, 0, obs_pw_stream->cursor.width, obs_pw_stream->cursor.height);
|
|
gs_draw_sprite(obs_pw_stream->texture, 0, obs_pw_stream->cursor.width, obs_pw_stream->cursor.height);
|
|
|
|
|
|
gs_matrix_pop();
|
|
gs_matrix_pop();
|
|
@@ -1384,11 +1372,6 @@ void obs_pipewire_stream_video_render(obs_pipewire_stream *obs_pw_stream, gs_eff
|
|
|
|
|
|
gs_blend_state_pop();
|
|
gs_blend_state_pop();
|
|
|
|
|
|
- gs_enable_framebuffer_srgb(previous);
|
|
|
|
-
|
|
|
|
- gs_technique_end_pass(tech);
|
|
|
|
- gs_technique_end(tech);
|
|
|
|
-
|
|
|
|
if (obs_pw_stream->sync.set) {
|
|
if (obs_pw_stream->sync.set) {
|
|
gs_sync_t *release_sync = gs_sync_create();
|
|
gs_sync_t *release_sync = gs_sync_create();
|
|
gs_sync_export_syncobj_timeline_point(release_sync, obs_pw_stream->sync.release_syncobj_fd,
|
|
gs_sync_export_syncobj_timeline_point(release_sync, obs_pw_stream->sync.release_syncobj_fd,
|