mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-17 18:58:42 -05:00
obs-frontend-api: Add frontend api functions for the virtual camera
This adds functions to the frontend api to start/stop the virtual camera, to check if it is active and adds function to get the output reference. It also adds api events for when the virtual camera is started or stopped.
This commit is contained in:
@@ -23,6 +23,7 @@ extern volatile bool streaming_active;
|
||||
extern volatile bool recording_active;
|
||||
extern volatile bool recording_paused;
|
||||
extern volatile bool replaybuf_active;
|
||||
extern volatile bool virtualcam_active;
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
@@ -548,6 +549,28 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
||||
Q_ARG(OBSSource, OBSSource(source)));
|
||||
}
|
||||
|
||||
obs_output_t *obs_frontend_get_virtualcam_output(void) override
|
||||
{
|
||||
OBSOutput output = main->outputHandler->virtualCam;
|
||||
obs_output_addref(output);
|
||||
return output;
|
||||
}
|
||||
|
||||
void obs_frontend_start_virtualcam(void) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "StartVirtualCam");
|
||||
}
|
||||
|
||||
void obs_frontend_stop_virtualcam(void) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "StopVirtualCam");
|
||||
}
|
||||
|
||||
bool obs_frontend_virtualcam_active(void) override
|
||||
{
|
||||
return os_atomic_load_bool(&virtualcam_active);
|
||||
}
|
||||
|
||||
void on_load(obs_data_t *settings) override
|
||||
{
|
||||
for (size_t i = saveCallbacks.size(); i > 0; i--) {
|
||||
|
||||
Reference in New Issue
Block a user