libobs: Add obs_encoder_video_tex_active()

This commit is contained in:
Dennis Sädtler 2024-10-01 15:12:37 +02:00 • committed by Ryan Foster
commit 3b1a66f632
2 changed files with 16 additions and 0 deletions

View file

@ -2068,3 +2068,16 @@ void obs_encoder_group_destroy(obs_encoder_group_t *group)
obs_encoder_group_actually_destroy(group);
}
bool obs_encoder_video_tex_active(const obs_encoder_t *encoder,
enum video_format format)
{
struct obs_core_video_mix *mix = get_mix_for_video(encoder->media);
if (format == VIDEO_FORMAT_NV12)
return mix->using_nv12_tex;
if (format == VIDEO_FORMAT_P010)
return mix->using_p010_tex;
return false;
}

View file

@ -2300,6 +2300,9 @@ EXPORT video_t *obs_encoder_video(const obs_encoder_t *encoder);
*/
EXPORT video_t *obs_encoder_parent_video(const obs_encoder_t *encoder);
/** Returns if the encoder's video output context supports shared textures for the specified video format. */
EXPORT bool obs_encoder_video_tex_active(const obs_encoder_t *encoder, enum video_format format);
/**
* Returns the audio output context used with this encoder, or NULL if not
* a audio context