libobs: Add video_output_disconnect2()

This commit is contained in:
derrod
2024-12-08 21:16:44 +01:00
committed by Ryan Foster
parent 83934acb44
commit eda882dd0a
3 changed files with 21 additions and 1 deletions

View File

@@ -178,6 +178,17 @@ Video Handler
---------------------
.. function:: bool video_output_disconnect2(video_t *video, void (*callback)(void *param, struct video_data *frame), void *param)
Disconnects a raw video callback from the video output handler.
:param video: Video output handler object
:param callback: Callback
:param param: Private data
:return: *true* if callback was removed, *false* otherwise (e.g., already removed)
---------------------
.. function:: const struct video_output_info *video_output_get_info(const video_t *video)
Gets the full video information of the video output handler.

View File

@@ -463,9 +463,14 @@ static void log_skipped(video_t *video)
}
void video_output_disconnect(video_t *video, void (*callback)(void *param, struct video_data *frame), void *param)
{
video_output_disconnect2(video, callback, param);
}
bool video_output_disconnect2(video_t *video, void (*callback)(void *param, struct video_data *frame), void *param)
{
if (!video || !callback)
return;
return false;
video = get_root(video);
@@ -485,6 +490,8 @@ void video_output_disconnect(video_t *video, void (*callback)(void *param, struc
}
pthread_mutex_unlock(&video->input_mutex);
return idx != DARRAY_INVALID;
}
bool video_output_active(const video_t *video)

View File

@@ -305,6 +305,8 @@ EXPORT bool video_output_connect2(video_t *video, const struct video_scale_info
void *param);
EXPORT void video_output_disconnect(video_t *video, void (*callback)(void *param, struct video_data *frame),
void *param);
EXPORT bool video_output_disconnect2(video_t *video, void (*callback)(void *param, struct video_data *frame),
void *param);
EXPORT bool video_output_active(const video_t *video);