mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
libobs: Allow transitions to give placeholder
The fade transition could benefit by providing NULL to differentiate a real source texture from the transparent placeholder. This would give it a chance to fade correctly for source transitions.
This commit is contained in:
@@ -725,6 +725,15 @@ void obs_transition_force_stop(obs_source_t *transition)
|
||||
|
||||
void obs_transition_video_render(obs_source_t *transition,
|
||||
obs_transition_video_render_callback_t callback)
|
||||
{
|
||||
obs_transition_video_render2(transition, callback,
|
||||
obs->video.transparent_texture);
|
||||
}
|
||||
|
||||
void obs_transition_video_render2(
|
||||
obs_source_t *transition,
|
||||
obs_transition_video_render_callback_t callback,
|
||||
gs_texture_t *placeholder_texture)
|
||||
{
|
||||
struct transition_state state;
|
||||
struct matrix4 matrices[2];
|
||||
@@ -773,9 +782,9 @@ void obs_transition_video_render(obs_source_t *transition,
|
||||
source_space);
|
||||
tex[i] = get_texture(transition, i);
|
||||
if (!tex[i])
|
||||
tex[i] = obs->video.transparent_texture;
|
||||
tex[i] = placeholder_texture;
|
||||
} else {
|
||||
tex[i] = obs->video.transparent_texture;
|
||||
tex[i] = placeholder_texture;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1587,6 +1587,11 @@ EXPORT void
|
||||
obs_transition_video_render(obs_source_t *transition,
|
||||
obs_transition_video_render_callback_t callback);
|
||||
|
||||
EXPORT void
|
||||
obs_transition_video_render2(obs_source_t *transition,
|
||||
obs_transition_video_render_callback_t callback,
|
||||
gs_texture_t *placeholder_texture);
|
||||
|
||||
EXPORT enum gs_color_space
|
||||
obs_transition_video_get_color_space(obs_source_t *transition);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user