StreamLinkforC  7.0.3-308369
Creating StreamLink and connecting to the Liberator

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

streamlinksl_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_configurationsl_get_configuration (streamlink *client)
 Get the configuration for the client. More...
 

Detailed Description

Enumeration Type Documentation

Enumeration that defines the state of a StreamLink connection.

Enumerator
sl_CONN_DISCONNECTED 

Disconnected from the Liberator.

sl_CONN_CONNECTING 

A connection attempt is in progress.

sl_CONN_FAILED 

A connection attempt has failed.

sl_CONN_CONNECTED 

A network connection has been established to the Liberator.

sl_CONN_RETRIEVING_CREDENTIALS 

Credentials are being retrieved from the sl_credentialsprovider

sl_CONN_CREDENTIALS_RETRIEVED 

Credentials have been retrieved from the sl_credentialsprovider

sl_CONN_RETRIEVING_CREDENTIALS_FAILED 

Credentials have not been retrieved from the sl_credentialsprovider

sl_CONN_LOGGEDIN 

The client is now logged into the server.

sl_CONN_LOGINFAILED 

The client could not login to the Liberator.

sl_CONN_EJECTED 

The client has been ejected from the Liberator.

sl_CONN_LOST 

Connection to the Liberator has been lost. The API will attempt to reconnect.

sl_CONN_RECONNECTED 

Connection to the Liberator has been re-established.

sl_CONN_UNREACHABLE 

Connection to the Liberator is not possible

Enumeration defining the reasons why a login attempt may fail.

Enumerator
sl_LOGINFAILED_INVALID_USER 

The user is unknown

sl_LOGINFAILED_INVALID_PASS 

The password is incorrect (This will never be seen)

sl_LOGINFAILED_INVALID_IP 

Attempting to access from an invalid address

sl_LOGINFAILED_ACCT_EXPIRED 

The login has expired

sl_LOGINFAILED_ALREADY_LOGGED_IN 

The user is already connected to the Liberator

sl_LOGINFAILED_LICENSE_SITE 

The Liberator licence usage has been exceeded

sl_LOGINFAILED_LICENSE_USER 

The Liberator licence usage has been exceeded

sl_LOGINFAILED_CREDENTIALSERROR 

The credentials provider cannot provide a usable set of credentials

Enumeration that defines the status of a subject.

Enumerator
sl_STATUS_OK 

The data associated with the subject is correct and up-to-date.

sl_STATUS_LIMITED 

One of the sources of data for subject is not available. This may affect the subject's data

sl_STATUS_STALE 

The subject's data may not be correct and up-to-date

sl_STATUS_INFO 

An informational message about the subject (usually sent by the DataSource)

Function Documentation

void sl_add_connection_listener ( streamlink client,
sl_connectionlistener listener,
void *  ctx 
)

Add a connection listener.

Parameters
client- The client to add a connection listener to.
listener- A populated interface definition.
ctx- User callback context which will passed to the listener.
Note
The library does not copy the contents of listener, thus it should not be modified or unexpected effects may occur.
void sl_connect ( streamlink client)

Connect the StreamLink instance to the server.

Parameters
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() .

See also
sl_new()
void sl_dealloc ( streamlink client)

Release all resources associated with the StreamLink instance.

Parameters
client- The client to deallocate

This call will not release any resources associated with callback parameters.

See also
sl_new()
void sl_del_connection_listener ( streamlink client,
sl_connectionlistener listener 
)

Remove a connection listener.

Parameters
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.

Parameters
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).

See also
sl_new()
sl_configuration* sl_get_configuration ( streamlink client)

Get the configuration for the client.

Parameters
client- The client
Returns
The StreamLink configuration object
sl_connectionstatus sl_get_connectionstatus ( streamlink client)

Get the connection status of Streamlink.

Parameters
client- The StreamLink instance to query
streamlink* sl_new ( const char *  uri,
sl_credentialsprovider credentials_provider 
)

Create a new Streamlink client object.

Parameters
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" ] ] }

JSON attribute names

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.

Parameters
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.

Note
This function will only take effect should sl_connect() not have been called
void sl_set_reachability ( streamlink client,
int  reachable 
)

Set the reachability of a network service.

Parameters
client- The client to set the reachability for
reachable- The value of the reachability

Generated on Tue Oct 16 2018 12:25:43 for StreamLinkforC