libobs: Add services API, reduce repeated code
Add API for streaming services. The services API simplifies the creation of custom service features and user interface. Custom streaming services later on will be able to do things such as: - Be able to use service-specific APIs via modules, allowing a more direct means of communicating with the service and requesting or setting service-specific information - Get URL/stream key via other means of authentication such as OAuth, or be able to build custom URLs for services that require that sort of thing. - Query information (such as viewer count, chat, follower notifications, and other information) - Set channel information (such as current game, current channel title, activating commercials) Also, I reduce some repeated code that was used for all libobs objects. This includes the name of the object, the private data, settings, as well as the signal and procedure handlers. I also switched to using linked lists for the global object lists, rather than using an array of pointers (you could say it was.. pointless.) ..Anyway, the linked list info is also stored in the shared context data structure.
This commit is contained in:
36
libobs/obs.h
36
libobs/obs.h
@@ -234,14 +234,15 @@ EXPORT bool obs_enum_filter_types(size_t idx, const char **id);
|
||||
*/
|
||||
EXPORT bool obs_enum_transition_types(size_t idx, const char **id);
|
||||
|
||||
/**
|
||||
* Enumerates all available ouput types.
|
||||
*
|
||||
* Outputs handle color space conversion, encoding, and output to file or
|
||||
* streams.
|
||||
*/
|
||||
/** Enumerates all available output types. */
|
||||
EXPORT bool obs_enum_output_types(size_t idx, const char **id);
|
||||
|
||||
/** Enumerates all available encoder types. */
|
||||
EXPORT bool obs_enum_encoder_types(size_t idx, const char **id);
|
||||
|
||||
/** Enumerates all available service types. */
|
||||
EXPORT bool obs_enum_service_types(size_t idx, const char **id);
|
||||
|
||||
/** Gets the main graphics context for this OBS context */
|
||||
EXPORT graphics_t obs_graphics(void);
|
||||
|
||||
@@ -864,13 +865,34 @@ EXPORT void obs_free_encoder_packet(struct encoder_packet *packet);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Stream Services */
|
||||
|
||||
EXPORT const char *obs_service_getdisplayname(const char *id,
|
||||
const char *locale);
|
||||
|
||||
EXPORT obs_service_t obs_service_create(const char *service,
|
||||
EXPORT obs_service_t obs_service_create(const char *id, const char *name,
|
||||
obs_data_t settings);
|
||||
EXPORT void obs_service_destroy(obs_service_t service);
|
||||
|
||||
/** Gets the default settings for a service */
|
||||
EXPORT obs_data_t obs_service_defaults(const char *id);
|
||||
|
||||
/** Returns the property list, if any. Free with obs_properties_destroy */
|
||||
EXPORT obs_properties_t obs_get_service_properties(const char *id,
|
||||
const char *locale);
|
||||
|
||||
/**
|
||||
* Returns the property list of an existing service context, if any. Free with
|
||||
* obs_properties_destroy
|
||||
*/
|
||||
EXPORT obs_properties_t obs_service_properties(obs_service_t service,
|
||||
const char *locale);
|
||||
|
||||
/** Returns the URL for this service context */
|
||||
const char *obs_service_get_url(obs_service_t service);
|
||||
|
||||
/** Returns the stream key (if any) for this service context */
|
||||
const char *obs_service_get_key(obs_service_t service);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Source frame allocation functions */
|
||||
|
Reference in New Issue
Block a user