StreamLinkforC
7.0.3-308369
|
Data Structures | |
struct | sl_statistics |
Statistics available from the Library. More... | |
struct | sl_connectionlistener |
Defines the interface that should be satisfied to receive information on the state of the connection. More... | |
struct | sl_configuration |
Configuration of timeouts for the library. More... | |
struct | sl_credentials |
Encapsulates the authentication information used to log in to a Liberator server. More... | |
struct | sl_credentialsprovider_s |
Definition of the interface that StreamLink uses to obtain credentials information. More... | |
Typedefs | |
typedef struct sl_s | streamlink |
Opaque handle that defines the StreamLink server connection. | |
Enumerations |
Functions | |
streamlink * | sl_new (const char *uri, sl_credentialsprovider *credentials_provider) |
Create a new Streamlink client object. More... | |
void | sl_connect (streamlink *client) |
Connect the StreamLink instance to the server. More... | |
void | sl_dealloc (streamlink *client) |
Release all resources associated with the StreamLink instance. More... | |
void | sl_set_applicationid (streamlink *client, const char *applicationid) |
Set the application identifier for the StreamLink instance. More... | |
void | sl_disconnect (streamlink *client) |
Disconnect the StreamLink instance to the server. More... | |
void | sl_set_reachability (streamlink *client, int reachable) |
Set the reachability of a network service. More... | |
void | sl_add_connection_listener (streamlink *client, sl_connectionlistener *listener, void *ctx) |
Add a connection listener. More... | |
sl_connectionstatus | sl_get_connectionstatus (streamlink *client) |
Get the connection status of Streamlink. More... | |
void | sl_del_connection_listener (streamlink *client, sl_connectionlistener *listener) |
Remove a connection listener. More... | |
sl_configuration * | sl_get_configuration (streamlink *client) |
Get the configuration for the client. More... | |
enum sl_connectionstatus |
Enumeration that defines the state of a StreamLink connection.
Enumeration defining the reasons why a login attempt may fail.
enum sl_subjectstatus |
Enumeration that defines the status of a subject.
void sl_add_connection_listener | ( | streamlink * | client, |
sl_connectionlistener * | listener, | ||
void * | ctx | ||
) |
Add a connection listener.
client | - The client to add a connection listener to. |
listener | - A populated interface definition. |
ctx | - User callback context which will passed to the listener. |
void sl_connect | ( | streamlink * | client | ) |
Connect the StreamLink instance to the server.
client | - The client to connnect |
The client will connect to the server that the instance was constructed with.
The connection status will passed to any connection listeners registered with sl_add_connection_listener() .
void sl_dealloc | ( | streamlink * | client | ) |
Release all resources associated with the StreamLink instance.
client | - The client to deallocate |
This call will not release any resources associated with callback parameters.
void sl_del_connection_listener | ( | streamlink * | client, |
sl_connectionlistener * | listener | ||
) |
Remove a connection listener.
client | - The client to remove a connection listener from. |
listener | - The listener to remove. |
void sl_disconnect | ( | streamlink * | client | ) |
Disconnect the StreamLink instance to the server.
client | - The client to disconnnect |
Following disconnection, all subscriptions will be cancelled. It is the responsibility of the caller to deallocate any memory associated with these resources (i.e. the registered context parameter).
sl_configuration* sl_get_configuration | ( | streamlink * | client | ) |
Get the configuration for the client.
client | - The client |
sl_connectionstatus sl_get_connectionstatus | ( | streamlink * | client | ) |
Get the connection status of Streamlink.
client | - The StreamLink instance to query |
streamlink* sl_new | ( | const char * | uri, |
sl_credentialsprovider * | credentials_provider | ||
) |
Create a new Streamlink client object.
uri | - URI to connect to the Liberator server or json configuration object or json collection of urls |
credentials_provider | - The credentials provider encapsulating login information |
The URI can be in the form: rttp://host:port
, http://host:port
or tcp://host:port
Or their SSL equivalents: rttps://host:port
, https://host:port
or tcps://host:port
Or an array of connections: [ [ "https://host1", "https://host2" ], ["https://host3", "https://host4" ] ]
Or a JSON configuration object { "liberator_urls" : [ [ "https://host1", "https://host2" ], ["https://host3", "https://host4" ] ] }
The following JSON attribute names are available:
Attribute name | Type | Default | Optional | Description |
---|---|---|---|---|
liberator_urls | string, [string], [[string]] | None | No | The Liberator URL groups to connect to (see below). |
keymaster_url | string | None (KeyMaster not used) | Yes | URL of KeyMaster for secure authentication of Liberator login requests. |
keymaster_httpuser | string | None | Yes | Username to access the KeyMaster URL. |
keymaster_httppass | string | None | Yes | Corresponding password to access the KeyMaster URL. |
keymaster_rttpuser | string | None | Yes | Username that KeyMaster will generate a one-use token for. Use of this configuration option is strongly discouraged. Your KeyMaster instance should determine this value from the keymaster_httpuser option. |
username | string | None | Yes | Liberator login user-name to use if logins are not being managed by KeyMaster. |
password | string | None | Yes | Liberator login password to use if logins are not being managed by KeyMaster. |
application_id | string | Unknown | Yes | Application identifier. This is useful for tracing purposes and managing licensing requirements. |
thread_name | string | None | Yes | StreamLink will name its internal threads using the format SL4i-library-n where n is a instance number. Should you wish to override this default behaviour set this configuration value and the thread will be named with the value supplied prefixed by SL4i-. Setting this option can assist debugging when multiple StreamLink instances are created by the application. |
accept_all_certificates | number | 0 | Yes | Set to a non-zero value to allow all SSL certificates (for example self-signed and expired) to be accepted. |
noop_period | number | 10000 | Yes | The length of time, in milliseconds, between heartbeat (NOOP) messages sent to the Liberator to test connectivity. |
noop_timeout | number | 5000 | Yes | The length of time, in milliseconds, to wait for a response to a heartbeat (NOOP) message before assuming we've lost the connection to the Liberator. |
http_pad_length | number | 4096 | Yes | The amount of padding to use when establishing a streaming connection using the http(s):// connection type. Increasing this value can help should there be a buffering network component between the client and the Liberator. |
inactivity_timeout | number | -1 (disabled) | Yes | Set the duration (in milliseconds) that Liberator will use to disconnect this client should no messages have been received from StreamLink |
poll_interval | number | 1000 milliseconds (1 second) | Yes | Time interval in milliseconds between polls of the Liberator. This only applies to HTTP polling type connections (see 'RTTP connection types' in the document StreamLink Overview). |
disable_polling | number | 0 (disabled) | Yes | Set to a non-zero value if you don't want to use polling connection when the rttp(s) protocol is specified. |
Failover configuration using liberator_urls. A URL group is selected at random. StreamLink tries to connect to them sequentially. If StreamLink did not successfully connect the next group will be tried. URL's must include the protocol (http, https, ws, wss, tcp, tcp). The protocol rttp means use the best non-ssl supported protocols (not including tcp). The protocol rttps means use the best ssl supported protocols (not including tcps).
void sl_set_applicationid | ( | streamlink * | client, |
const char * | applicationid | ||
) |
Set the application identifier for the StreamLink instance.
client | - The StreamLink instance on which to set the application identifier. |
applicationid | - The name of the application |
This can be useful for authentication purposes on the Caplin Liberator, and is only required if the Caplin Liberator administrator should require it.
void sl_set_reachability | ( | streamlink * | client, |
int | reachable | ||
) |
Set the reachability of a network service.
client | - The client to set the reachability for |
reachable | - The value of the reachability |