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