libobs: Add 'initialize' callback to services
The 'initialize' callback is used before the encoders/output start up so it can adjust encoder settings to required values if needed. Also added the function 'obs_encoder_active' that returns true or false depending on whether that encoder is active or not.
This commit is contained in:
@@ -222,3 +222,14 @@ void obs_service_deactivate(struct obs_service *service, bool remove)
|
||||
else if (remove)
|
||||
service->output = NULL;
|
||||
}
|
||||
|
||||
bool obs_service_initialize(struct obs_service *service,
|
||||
struct obs_output *output)
|
||||
{
|
||||
if (!service || !output)
|
||||
return false;
|
||||
|
||||
if (service->info.initialize)
|
||||
return service->info.initialize(service->context.data, output);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user