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:
jp9000
2014-06-16 21:29:11 -07:00
parent 85ee5d591b
commit 9b23914c37
7 changed files with 37 additions and 3 deletions

View File

@@ -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;
}