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.master
parent
42c7e29d25
commit
8194e9431e
|
@ -1576,6 +1576,7 @@ Functions used by transitions
|
|||
---------------------
|
||||
|
||||
.. function:: void obs_transition_video_render(obs_source_t *transition, obs_transition_video_render_callback_t callback)
|
||||
void obs_transition_video_render2(obs_source_t *transition, obs_transition_video_render_callback_t callback, gs_texture_t *placeholder_texture)
|
||||
|
||||
Helper function used for rendering transitions. This function will
|
||||
render two distinct textures for source A and source B of the
|
||||
|
@ -1587,6 +1588,10 @@ Functions used by transitions
|
|||
(0.0f..1.0f), *cx* and *cy* are the current dimensions of the
|
||||
transition, and *data* is the implementation's private data.
|
||||
|
||||
The *placeholder_texture* parameter allows a callback to receive
|
||||
a replacement that isn't the default transparent texture, including
|
||||
NULL if the caller desires.
|
||||
|
||||
Relevant data types used with this function:
|
||||
|
||||
.. code:: cpp
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue