Conviva Client Library
ccl.h
1 //
2 // Copyright (c) 2014 Conviva. All rights reserved.
3 // CCL - Conviva Client Library
4 //
5 
10 
11 
24 
25 #ifndef CCL_H
26 #define CCL_H
27 
28 #include "ccl_dictionary.h"
29 #include "ccl_content_info.h"
30 #include "ccl_notifier_if.h"
31 #include "ccl_player_if.h"
32 #include "ccl_platform_if.h"
33 
34 #define CCL_SUCCESS 0
35 #define CCL_ERROR -1
36 
39 typedef enum {
51 
52 #define CCL_MAX_URL_LENGTH 256
53 
57 typedef struct {
58 
62  char gateway_url[CCL_MAX_URL_LENGTH];
63 
67  unsigned int heartbeat_interval;
68 
72  unsigned int player_poll_interval;
73 
77 
82 
84 
89 extern void ccl_settings_create (ccl_settings_t *settings);
90 
93 extern void ccl_settings_destroy (ccl_settings_t * settings);
94 
95 
97 typedef struct ccl_session ccl_session_t;
98 
111 extern int ccl_init (const char *customer_key, const ccl_platform_t *platform_interface, const ccl_settings_t *settings);
112 
116 extern void ccl_cleanup (void);
117 
126 extern ccl_session_t *ccl_session_create (ccl_content_info_t *content_info);
127 
137 extern ccl_session_t *ccl_ad_session_create(ccl_session_t *content_session, ccl_content_info_t *ad_content_info);
138 
147 extern int ccl_session_destroy (ccl_session_t *session);
148 
163 extern int ccl_session_player_attach (ccl_session_t *session, const ccl_player_t *player, void *player_data);
164 
177 extern int ccl_session_player_detach (ccl_session_t *session);
178 
187 extern int ccl_session_ad_start (ccl_session_t *session);
188 
197 extern int ccl_session_ad_end (ccl_session_t *session);
198 
211 extern int ccl_session_report_error (ccl_session_t *session, const char *error_message, int is_fatal);
212 
224 extern int ccl_send_event (const char *name, ccl_dictionary_t *attributes);
225 
237 extern int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes);
238 
245 extern void ccl_session_update_content_info(ccl_session_t *session, const ccl_content_info_t *content_info);
246 
253 extern void ccl_notify_network_connection_type(const char *type);
254 
258 extern void ccl_notify_network_signal_strength(double value);
259 
263 //extern void ccl_notify_network_wifi_ssid(const char *ssid);
264 
270 extern void ccl_notify_network_wifi_link_encryption(const char *name);
271 
280 extern int ccl_session_set_video_size(ccl_session_t *session, int width, int height);
281 
288 extern unsigned int ccl_session_get_session_id(ccl_session_t *session);
289 
295 extern char* ccl_get_client_id(void);
296 
297 #endif /* CCL_H */
298 
int ccl_session_player_attach(ccl_session_t *session, const ccl_player_t *player, void *player_data)
Link a video player to a monitoring session.
Display only error logs.
Definition: ccl.h:43
int ccl_session_player_detach(ccl_session_t *session)
Unlink current video player from a monitoring session.
int ccl_session_ad_end(ccl_session_t *session)
Notify Conviva that a preroll ad has ended.
ccl_log_level_t log_level
Definition: ccl.h:76
int ccl_init(const char *customer_key, const ccl_platform_t *platform_interface, const ccl_settings_t *settings)
Initializes the library.
Display all logs.
Definition: ccl.h:49
char * ccl_get_client_id(void)
Gets the Conviva Client ID.
void ccl_notify_network_connection_type(const char *type)
Notify a change of network connection type.
void ccl_settings_create(ccl_settings_t *settings)
Create a new ccl_settings_t.
void ccl_notify_network_wifi_link_encryption(const char *name)
Notify a change of WiFi SSID.
struct ccl_dictionary ccl_dictionary_t
Definition: ccl_dictionary.h:18
int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes)
Report a custom event to Conviva.
#define CCL_MAX_URL_LENGTH
Definition: ccl.h:52
int ccl_session_destroy(ccl_session_t *session)
Destroy an existing monitoring session.
int enable_player_state_inference
Definition: ccl.h:81
ccl_log_level_t
Log level.
Definition: ccl.h:39
Definition: ccl_content_info.h:19
int ccl_send_event(const char *name, ccl_dictionary_t *attributes)
Report a custom event to Conviva.
ccl_session_t * ccl_session_create(ccl_content_info_t *content_info)
Create a new monitoring session.
void ccl_notify_network_signal_strength(double value)
Notify a change of network wireless signal strength.
unsigned int heartbeat_interval
Definition: ccl.h:67
unsigned int ccl_session_get_session_id(ccl_session_t *session)
Gets the Conviva session ID for a session.
unsigned int player_poll_interval
Definition: ccl.h:72
No logging.
Definition: ccl.h:41
void ccl_cleanup(void)
Releases the library and all tied up memory/resources.
Structure of function pointers for poll updates to Conviva.
Definition: ccl_player_if.h:22
Display all logs except debug logs.
Definition: ccl.h:47
int ccl_session_set_video_size(ccl_session_t *session, int width, int height)
Notify Conviva of a video resolution change.
Display only error and warning logs.
Definition: ccl.h:45
int ccl_session_report_error(ccl_session_t *session, const char *error_message, int is_fatal)
Notify Conviva that an error has occurred.
ccl_session_t * ccl_ad_session_create(ccl_session_t *content_session, ccl_content_info_t *ad_content_info)
Create a new AD monitoring session.
struct ccl_session ccl_session_t
Conviva monitoring session.
Definition: ccl.h:97
Encapsulates function pointers for system utilities like logging, timers, locks, etc.
Definition: ccl_platform_if.h:171
Conviva Client Library settings.
Definition: ccl.h:57
void ccl_settings_destroy(ccl_settings_t *settings)
Destroy an existing ccl_settings_t.
void ccl_session_update_content_info(ccl_session_t *session, const ccl_content_info_t *content_info)
Update metadata content for the session.
int ccl_session_ad_start(ccl_session_t *session)
Notify Conviva that preroll advertisement has started.