obs-frontend-api: Add function for manual file splitting
This commit is contained in:
parent
ae3c9b3628
commit
467f73d4c9
@ -320,6 +320,23 @@ struct OBSStudioAPI : obs_frontend_callbacks {
|
||||
return os_atomic_load_bool(&recording_paused);
|
||||
}
|
||||
|
||||
bool obs_frontend_recording_split_file(void) override
|
||||
{
|
||||
if (os_atomic_load_bool(&recording_active) &&
|
||||
!os_atomic_load_bool(&recording_paused)) {
|
||||
proc_handler_t *ph = obs_output_get_proc_handler(
|
||||
main->outputHandler->fileOutput);
|
||||
uint8_t stack[128];
|
||||
calldata cd;
|
||||
calldata_init_fixed(&cd, stack, sizeof(stack));
|
||||
proc_handler_call(ph, "split_file", &cd);
|
||||
bool result = calldata_bool(&cd, "split_file_enabled");
|
||||
return result;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_start(void) override
|
||||
{
|
||||
QMetaObject::invokeMethod(main, "StartReplayBuffer");
|
||||
|
@ -279,6 +279,12 @@ bool obs_frontend_recording_paused(void)
|
||||
return !!callbacks_valid() ? c->obs_frontend_recording_paused() : false;
|
||||
}
|
||||
|
||||
bool obs_frontend_recording_split_file(void)
|
||||
{
|
||||
return !!callbacks_valid() ? c->obs_frontend_recording_split_file()
|
||||
: false;
|
||||
}
|
||||
|
||||
void obs_frontend_replay_buffer_start(void)
|
||||
{
|
||||
if (callbacks_valid())
|
||||
|
@ -177,6 +177,7 @@ EXPORT void obs_frontend_recording_stop(void);
|
||||
EXPORT bool obs_frontend_recording_active(void);
|
||||
EXPORT void obs_frontend_recording_pause(bool pause);
|
||||
EXPORT bool obs_frontend_recording_paused(void);
|
||||
EXPORT bool obs_frontend_recording_split_file(void);
|
||||
|
||||
EXPORT void obs_frontend_replay_buffer_start(void);
|
||||
EXPORT void obs_frontend_replay_buffer_save(void);
|
||||
|
@ -52,6 +52,7 @@ struct obs_frontend_callbacks {
|
||||
virtual bool obs_frontend_recording_active(void) = 0;
|
||||
virtual void obs_frontend_recording_pause(bool pause) = 0;
|
||||
virtual bool obs_frontend_recording_paused(void) = 0;
|
||||
virtual bool obs_frontend_recording_split_file(void) = 0;
|
||||
|
||||
virtual void obs_frontend_replay_buffer_start(void) = 0;
|
||||
virtual void obs_frontend_replay_buffer_save(void) = 0;
|
||||
|
@ -553,6 +553,17 @@ Functions
|
||||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: bool obs_frontend_recording_split_file(void)
|
||||
|
||||
Asks OBS to split the current recording file.
|
||||
|
||||
:return: *true* if splitting was successfully requested (this
|
||||
does not mean that splitting has finished or guarantee that it
|
||||
split successfully), *false* if recording is inactive or paused
|
||||
or if file splitting is disabled.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
.. function:: void obs_frontend_replay_buffer_start(void)
|
||||
|
||||
Starts the replay buffer.
|
||||
|
Loading…
x
Reference in New Issue
Block a user