Conviva Client Library  2.187.0.0
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 #include "app_tracker.h"
34 
35 #define CCL_SUCCESS 0
36 #define CCL_ERROR -1
37 
40 typedef enum {
52 
53 #define CCL_MAX_URL_LENGTH 256
54 #define CCL_MAX_APP_NAME_LENGTH 64
55 #define CCL_MAX_USER_ID_LENGTH 64
56 
57 #define CCL_APP_MAX_SCREEN_NAME_LEN 1024
58 #define CCL_APP_MAX_SCREEN_ID_LEN 38
59 
60 #define CCL_MAX_CLIENT_ID_LEN_EXT 49
61 
62 typedef enum {
63  // Ads and content are played using the same video player instance.
64  CONTENT = 0,
65  // Ads and content are played using separate video player instances.
66  SEPARATE = 1,
67  // The ad player is unknown.
68  Unknown = 2
69 } ad_player_t;
70 
71 typedef enum {
72  // Client Side.
74  // Server Side.
76  //Unknown
78 } ad_type_t;
79 
80 typedef enum {
81  // The ad is a bumper
82  BUMPER = 0,
83  // The ad is a preroll, kicking in before content.
85  // The ad is a midroll, kicking in during content.
87  // The ad is a postroll, kicking in after content.
89  // The ad player is unknown.
92 
93 typedef struct {
94 
95  // Pod index
96  int pod_index;
97  // Pod position
99  // Pod duration
101 } ad_pod_info_t;
102 
106 typedef struct {
107 
111  char gateway_url[CCL_MAX_URL_LENGTH];
112 
116  unsigned int heartbeat_interval;
117 
121  unsigned int player_poll_interval;
122 
126 
131 
134  char client_id[CCL_MAX_CLIENT_ID_LEN_EXT];
135 
137 
142 extern void ccl_settings_create (ccl_settings_t *settings);
143 
146 extern void ccl_settings_destroy (ccl_settings_t * settings);
147 
148 
150 typedef struct ccl_session ccl_session_t;
151 
164 extern int ccl_init (const char *customer_key, const ccl_platform_t *platform_interface, const ccl_settings_t *settings);
165 
169 extern void ccl_cleanup (void);
170 
179 extern ccl_session_t *ccl_session_create (ccl_content_info_t *content_info);
180 
190 extern ccl_session_t *ccl_ad_session_create(ccl_session_t *content_session, ccl_content_info_t *ad_content_info);
191 
200 extern int ccl_session_destroy (ccl_session_t *session);
201 
202 
217 extern int ccl_session_player_attach (ccl_session_t *session, const ccl_player_t *player, void *player_data);
218 
231 extern int ccl_session_player_detach (ccl_session_t *session);
232 
241 extern int ccl_session_ad_start (ccl_session_t *session);
242 
251 extern int ccl_session_ad_end (ccl_session_t *session);
252 
265 extern int ccl_session_report_error (ccl_session_t *session, const char *error_message, int is_fatal);
266 
278 extern int ccl_send_event (const char *name, ccl_dictionary_t *attributes);
279 
291 extern int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes);
292 
299 extern void ccl_session_update_content_info(ccl_session_t *session, const ccl_content_info_t *content_info);
300 
307 extern void ccl_notify_network_connection_type(const char *type);
308 
312 extern void ccl_notify_network_signal_strength(double value);
313 
317 //extern void ccl_notify_network_wifi_ssid(const char *ssid);
318 
324 extern void ccl_notify_network_wifi_link_encryption(const char *name);
325 
334 extern int ccl_session_set_video_size(ccl_session_t *session, int width, int height);
335 
342 extern unsigned int ccl_session_get_session_id(ccl_session_t *session);
343 
349 extern char* ccl_get_client_id(void);
350 
359 extern int report_ad_break_started(ccl_session_t *session, ad_player_t ad_player, ad_type_t ad_type, ad_pod_info_t *pod_info);
360 
369 extern int report_ad_break_ended(ccl_session_t *session, ad_player_t ad_player, ad_type_t ad_type, ad_pod_info_t *pod_info);
370 
378 extern int cat_start_tracker(char* app_name, char* user_id);
379 
384 extern int cat_stop_tracker(void);
385 
386 #endif /* CCL_H */
387 
ccl_notify_network_wifi_link_encryption
void ccl_notify_network_wifi_link_encryption(const char *name)
Notify a change of WiFi SSID.
report_ad_break_started
int report_ad_break_started(ccl_session_t *session, ad_player_t ad_player, ad_type_t ad_type, ad_pod_info_t *pod_info)
Informs content session that the ad break has started.
CCL_MAX_URL_LENGTH
#define CCL_MAX_URL_LENGTH
Definition: ccl.h:53
ccl_content_info_t
Definition: ccl_content_info.h:19
ccl_dictionary_t
struct ccl_dictionary ccl_dictionary_t
Definition: ccl_dictionary.h:18
ccl_session_send_event
int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes)
Report a custom event to Conviva.
ad_player_t
ad_player_t
Definition: ccl.h:62
SEPARATE
@ SEPARATE
Definition: ccl.h:66
ccl_get_client_id
char * ccl_get_client_id(void)
Gets the Conviva Client ID.
ccl_init
int ccl_init(const char *customer_key, const ccl_platform_t *platform_interface, const ccl_settings_t *settings)
Initializes the library.
ccl_notify_network_signal_strength
void ccl_notify_network_signal_strength(double value)
Notify a change of network wireless signal strength.
ccl_session_ad_start
int ccl_session_ad_start(ccl_session_t *session)
Notify Conviva that preroll advertisement has started.
CONTENT
@ CONTENT
Definition: ccl.h:64
BUMPER
@ BUMPER
Definition: ccl.h:82
ccl_session_set_video_size
int ccl_session_set_video_size(ccl_session_t *session, int width, int height)
Notify Conviva of a video resolution change.
ccl_session_update_content_info
void ccl_session_update_content_info(ccl_session_t *session, const ccl_content_info_t *content_info)
Update metadata content for the session.
ccl_session_player_detach
int ccl_session_player_detach(ccl_session_t *session)
Unlink current video player from a monitoring session.
ad_pod_info_t::pod_duration
int pod_duration
Definition: ccl.h:100
ccl_settings_t::log_level
ccl_log_level_t log_level
Definition: ccl.h:125
ccl_log_level_t
ccl_log_level_t
Log level.
Definition: ccl.h:40
CCL_LOG_LEVEL_WARN
@ CCL_LOG_LEVEL_WARN
Display only error and warning logs.
Definition: ccl.h:46
ccl_settings_t::heartbeat_interval
unsigned int heartbeat_interval
Definition: ccl.h:116
ccl_cleanup
void ccl_cleanup(void)
Releases the library and all tied up memory/resources.
ccl_session_get_session_id
unsigned int ccl_session_get_session_id(ccl_session_t *session)
Gets the Conviva session ID for a session.
ccl_session_destroy
int ccl_session_destroy(ccl_session_t *session)
Destroy an existing monitoring session.
ccl_session_create
ccl_session_t * ccl_session_create(ccl_content_info_t *content_info)
Create a new monitoring session.
CCL_LOG_LEVEL_DEBUG
@ CCL_LOG_LEVEL_DEBUG
Display all logs.
Definition: ccl.h:50
report_ad_break_ended
int report_ad_break_ended(ccl_session_t *session, ad_player_t ad_player, ad_type_t ad_type, ad_pod_info_t *pod_info)
Informs content session that the ad break has ended.
ccl_settings_t::enable_player_state_inference
int enable_player_state_inference
Definition: ccl.h:130
ccl_settings_create
void ccl_settings_create(ccl_settings_t *settings)
Create a new ccl_settings_t.
CLIENT_SIDE
@ CLIENT_SIDE
Definition: ccl.h:73
ccl_player_t
Structure of function pointers for poll updates to Conviva.
Definition: ccl_player_if.h:22
ccl_settings_t::player_poll_interval
unsigned int player_poll_interval
Definition: ccl.h:121
SERVER_SIDE
@ SERVER_SIDE
Definition: ccl.h:75
CCL_MAX_CLIENT_ID_LEN_EXT
#define CCL_MAX_CLIENT_ID_LEN_EXT
Definition: ccl.h:60
CCL_LOG_LEVEL_ERROR
@ CCL_LOG_LEVEL_ERROR
Display only error logs.
Definition: ccl.h:44
POSTROLL
@ POSTROLL
Definition: ccl.h:88
cat_start_tracker
int cat_start_tracker(char *app_name, char *user_id)
creates tracker for eco
POD_POSITION_Unknown
@ POD_POSITION_Unknown
Definition: ccl.h:90
cat_stop_tracker
int cat_stop_tracker(void)
stop the app tracker
ad_pod_info_t::pod_index
int pod_index
Definition: ccl.h:96
ad_pod_info_t::pod_position
ad_position_t pod_position
Definition: ccl.h:98
ad_pod_info_t
Definition: ccl.h:93
ad_type_t
ad_type_t
Definition: ccl.h:71
ccl_send_event
int ccl_send_event(const char *name, ccl_dictionary_t *attributes)
Report a custom event to Conviva.
Unknown
@ Unknown
Definition: ccl.h:68
CCL_LOG_LEVEL_INFO
@ CCL_LOG_LEVEL_INFO
Display all logs except debug logs.
Definition: ccl.h:48
MIDROLL
@ MIDROLL
Definition: ccl.h:86
ad_position_t
ad_position_t
Definition: ccl.h:80
ccl_session_ad_end
int ccl_session_ad_end(ccl_session_t *session)
Notify Conviva that a preroll ad has ended.
AD_TYPE_UNKNOWN
@ AD_TYPE_UNKNOWN
Definition: ccl.h:77
ccl_ad_session_create
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.
ccl_settings_destroy
void ccl_settings_destroy(ccl_settings_t *settings)
Destroy an existing ccl_settings_t.
ccl_session_report_error
int ccl_session_report_error(ccl_session_t *session, const char *error_message, int is_fatal)
Notify Conviva that an error has occurred.
ccl_settings_t
Conviva Client Library settings.
Definition: ccl.h:106
ccl_notify_network_connection_type
void ccl_notify_network_connection_type(const char *type)
Notify a change of network connection type.
CCL_LOG_LEVEL_NONE
@ CCL_LOG_LEVEL_NONE
No logging.
Definition: ccl.h:42
ccl_platform_t
Encapsulates function pointers for system utilities like logging, timers, locks, etc.
Definition: ccl_platform_if.h:247
ccl_session_player_attach
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.
PREROLL
@ PREROLL
Definition: ccl.h:84
ccl_session_t
struct ccl_session ccl_session_t
Conviva monitoring session.
Definition: ccl.h:150