OpenTok C SDK
publisher.h
Go to the documentation of this file.
1 
7 #ifndef PUBLISHER_H
8 #define PUBLISHER_H
9 
10 #include "config.h"
11 #include "stream.h"
12 #include "video_frame.h"
13 #include "audio_data.h"
15 #include "media_transformer.h"
16 
17 OTC_BEGIN_DECL
18 
19 #ifndef OTC_SESSION_FWD_DECL
20 #define OTC_SESSION_FWD_DECL
21 typedef struct otc_session otc_session;
22 #endif
23 
30 
34 
42  1010,
48  6001,
49 };
50 
58 };
59 
64  OTC_MEDIA_TYPE_VIDEO = 0,
65  OTC_MEDIA_TYPE_AUDIO
66 };
67 
76  const char* connection_id;
78  const char* subscriber_id;
80  int64_t
83  int64_t packets_sent;
85  int64_t bytes_sent;
87  float audio_level;
88  double timestamp;
90  double
93 };
94 
103  const char* connection_id;
105  const char* subscriber_id;
107  int64_t
110  int64_t packets_sent;
112  int64_t bytes_sent;
114  double timestamp;
116  double
119 };
120 
142  void (*on_stream_created)(otc_publisher* publisher,
143  void* user_data,
144  const otc_stream* stream);
145 
153  void (*on_stream_destroyed)(otc_publisher* publisher,
154  void* user_data,
155  const otc_stream* stream);
156 
164  void (*on_render_frame)(otc_publisher* publisher,
165  void* user_data,
166  const otc_video_frame* frame);
167 
176  void* user_data,
177  float audio_level);
178 
186  void *user_data);
187 
196  void (*on_audio_stats)(otc_publisher* publisher,
197  void* user_data,
198  struct otc_publisher_audio_stats audio_stats[],
199  size_t number_of_stats);
200 
209  void (*on_video_stats)(otc_publisher* publisher,
210  void* user_data,
211  struct otc_publisher_video_stats video_stats[],
212  size_t number_of_stats);
221  void (*on_error)(otc_publisher* publisher,
222  void* user_data,
223  const char* error_string,
224  enum otc_publisher_error_code error_code);
225 
233  void (*on_video_disabled)(otc_publisher* publisher,
234  void* user_data,
235  enum otc_video_reason reason);
236 
244  void (*on_video_enabled)(otc_publisher* publisher,
245  void* user_data,
246  enum otc_video_reason reason);
247 
257 
267  void* user_data);
268 
272  void* user_data;
273 
278  void* reserved;
279 };
280 
293 OTC_DECL(otc_publisher*)
294 otc_publisher_new(const char* name,
295  const struct otc_video_capturer_callbacks* capturer,
296  const struct otc_publisher_callbacks* callbacks);
297 
304 
311 OTC_DECL(otc_status)
313 
323 OTC_DECL(otc_status)
325  const char* name);
326 
335 OTC_DECL(otc_status)
337  otc_publisher_settings* settings,
338  const struct otc_video_capturer_callbacks* capturer);
339 
350 OTC_DECL(otc_status)
352  otc_bool enabled);
353 
364 OTC_DECL(otc_status)
366  otc_bool enabled);
367 
377 OTC_DECL(otc_status)
379  otc_bool enabled);
380 
391 OTC_DECL(otc_status)
393  otc_bool enabled);
405 OTC_DECL(otc_status)
407  otc_bool enabled);
408 
421 OTC_DECL(otc_status)
423  otc_bool enabled);
424 
437 OTC_DECL(otc_status)
439  otc_bool enabled);
452 OTC_DECL(otc_status)
454  (otc_publisher_settings* settings, otc_bool disabled);
455 
467 OTC_DECL(otc_status)
469  const enum otc_camera_capture_resolution camera_capture_resolution);
470 
481 OTC_DECL(otc_status)
483  const otc_bool enabled);
484 
494 OTC_DECL(otc_publisher*)
496  otc_publisher_settings* settings);
497 
504 OTC_DECL(otc_status) otc_publisher_delete(otc_publisher* publisher);
505 
513 OTC_DECL(otc_stream*) otc_publisher_get_stream(otc_publisher* publisher);
514 
523 OTC_DECL(otc_status)
525  otc_bool publish_video);
526 
535 OTC_DECL(otc_status)
537  otc_bool publish_audio);
538 
546 OTC_DECL(otc_status)
548  otc_bool publish_captions);
549 
556 OTC_DECL(otc_bool)
558 
565 OTC_DECL(otc_bool)
567 
574 OTC_DECL(otc_bool)
576 
584 OTC_DECL(otc_session*)
585 otc_publisher_get_session(const otc_publisher* publisher);
586 
594 OTC_DECL(otc_status)
595 otc_publisher_set_max_audio_bitrate(otc_publisher* publisher, uint32_t bitrate);
596 
608  const char* connection_id;
662 };
663 
673  void *user_data;
690  void *user_data,
691  const struct otc_publisher_rtc_stats* stats,
692  size_t entries);
693  void *reserved;
694 };
695 
707  const struct otc_publisher_rtc_stats_report_cb cb);
722 
743 OTC_DECL(otc_status)
745  otc_bool enabled);
746 
756 OTC_DECL(otc_bool)
758 
766 OTC_DECL(const char*)
768 
780 OTC_DECL(otc_status)
782  enum otc_publisher_video_type video_type);
790 OTC_DECL(enum otc_publisher_video_type)
791 otc_publisher_get_video_type(const struct otc_publisher* publisher);
792 
799 OTC_DECL(void*)
800 otc_publisher_get_user_data(const struct otc_publisher* publisher);
801 
808 OTC_DECL(const char*)
809 otc_publisher_get_name(const struct otc_publisher* publisher);
810 
825 OTC_DECL(otc_status)
827  otc_publisher* publisher,
828  otc_video_transformer** transformers,
829  uint8_t size);
830 
845 OTC_DECL(otc_status)
847  otc_publisher* publisher,
848  otc_audio_transformer** transformers,
849  uint8_t size);
850 
870 OTC_DECL(otc_status)
872  otc_publisher_settings* settings,
873  const otc_bool enabled);
874 
893 OTC_DECL(otc_status)
895  otc_publisher_settings* settings,
896  const otc_bool enabled);
897 
898 OTC_END_DECL
899 
900 #endif // PUBLISHER_H
int64_t packets_lost
Definition: publisher.h:108
Definition: publisher.h:56
int otc_status
Definition: base.h:153
struct otc_publisher otc_publisher
Definition: publisher.h:29
otc_status otc_publisher_settings_set_default_camera_capture_resolution(otc_publisher_settings *settings, const enum otc_camera_capture_resolution camera_capture_resolution)
Definition: publisher.h:44
struct otc_video_frame otc_video_frame
Definition: video_frame.h:25
otc_status otc_publisher_settings_set_noise_suppression(otc_publisher_settings *settings, otc_bool enabled)
double start_time
Definition: publisher.h:117
otc_status otc_publisher_set_publish_video(otc_publisher *publisher, otc_bool publish_video)
void * otc_publisher_get_user_data(const struct otc_publisher *publisher)
Definition: publisher.h:603
otc_status otc_publisher_settings_set_name(otc_publisher_settings *settings, const char *name)
enum otc_publisher_video_type otc_publisher_get_video_type(const struct otc_publisher *publisher)
float audio_level
Definition: publisher.h:87
otc_status otc_publisher_settings_set_disable_audio_processing(otc_publisher_settings *settings, otc_bool disabled)
struct otc_video_transformer otc_video_transformer
Definition: media_transformer.h:34
double start_time
Definition: publisher.h:91
Definition: publisher.h:134
void(* on_render_frame)(otc_publisher *publisher, void *user_data, const otc_video_frame *frame)
Definition: publisher.h:164
Definition: video_capturer.h:43
const char * otc_publisher_get_name(const struct otc_publisher *publisher)
otc_status otc_publisher_settings_set_subscriber_audio_fallback_enabled(otc_publisher_settings *settings, const otc_bool enabled)
otc_bool otc_publisher_get_publish_video(const otc_publisher *publisher)
otc_bool otc_publisher_get_publish_captions(const otc_publisher *publisher)
void(* on_rtc_stats_report)(otc_publisher *publisher, void *user_data, const struct otc_publisher_rtc_stats *stats, size_t entries)
Definition: publisher.h:689
Definition: publisher.h:57
Definition: publisher.h:75
otc_status otc_publisher_settings_set_audio_track(otc_publisher_settings *settings, otc_bool enabled)
otc_status otc_publisher_delete(otc_publisher *publisher)
int64_t bytes_sent
Definition: publisher.h:85
const char * connection_id
Definition: publisher.h:608
otc_bool otc_publisher_get_audio_fallback_enabled(const otc_publisher *publisher)
Audio/Video stream.
otc_status otc_publisher_settings_set_stereo(otc_publisher_settings *settings, otc_bool enabled)
otc_publisher_video_type
Definition: publisher.h:55
void * user_data
Definition: publisher.h:673
struct otc_session otc_session
Definition: session.h:21
OpenTok Camera Capture Resolution on default video capturers.
otc_status otc_publisher_settings_set_auto_gain_control(otc_publisher_settings *settings, otc_bool enabled)
Definition: publisher.h:669
otc_session * otc_publisher_get_session(const otc_publisher *publisher)
Definition: publisher.h:46
otc_status otc_publisher_settings_set_publisher_audio_fallback_enabled(otc_publisher_settings *settings, const otc_bool enabled)
otc_status otc_publisher_set_video_type(struct otc_publisher *publisher, enum otc_publisher_video_type video_type)
otc_camera_capture_resolution
Definition: camera_capture_resolution.h:17
otc_status otc_publisher_set_publish_audio(otc_publisher *publisher, otc_bool publish_audio)
void(* on_video_enabled)(otc_publisher *publisher, void *user_data, enum otc_video_reason reason)
Definition: publisher.h:244
otc_status otc_publisher_get_rtc_stats_report(const otc_publisher *publisher)
double timestamp
Definition: publisher.h:114
Definition: publisher.h:102
struct otc_stream otc_stream
Definition: stream.h:18
Audio Data.
const char * subscriber_id
Definition: publisher.h:78
Media transformer functions.
void(* on_video_stats)(otc_publisher *publisher, void *user_data, struct otc_publisher_video_stats video_stats[], size_t number_of_stats)
Definition: publisher.h:209
double timestamp
Definition: publisher.h:88
otc_publisher_settings * otc_publisher_settings_new()
void(* on_video_disabled)(otc_publisher *publisher, void *user_data, enum otc_video_reason reason)
Definition: publisher.h:233
const char * connection_id
Definition: publisher.h:103
struct otc_audio_transformer otc_audio_transformer
Definition: media_transformer.h:38
otc_publisher * otc_publisher_new(const char *name, const struct otc_video_capturer_callbacks *capturer, const struct otc_publisher_callbacks *callbacks)
void(* on_audio_stats)(otc_publisher *publisher, void *user_data, struct otc_publisher_audio_stats audio_stats[], size_t number_of_stats)
Definition: publisher.h:196
void(* on_audio_level_updated)(otc_publisher *publisher, void *user_data, float audio_level)
Definition: publisher.h:175
void * reserved
Definition: publisher.h:278
Definition: publisher.h:41
otc_status otc_publisher_settings_delete(otc_publisher_settings *settings)
otc_status otc_publisher_settings_set_opus_dtx(otc_publisher_settings *settings, otc_bool enabled)
otc_status otc_publisher_set_video_transformers(otc_publisher *publisher, otc_video_transformer **transformers, uint8_t size)
Sets an array of video transformers to this publisher's video stream. If null resets transformers.
void(* on_publisher_mute_forced)(otc_publisher *publisher, void *user_data)
Definition: publisher.h:185
int64_t packets_lost
Definition: publisher.h:81
void(* on_stream_destroyed)(otc_publisher *publisher, void *user_data, const otc_stream *stream)
Definition: publisher.h:153
const char * json_array_of_reports
Definition: publisher.h:661
int otc_bool
Definition: base.h:127
void * user_data
Definition: publisher.h:272
int64_t bytes_sent
Definition: publisher.h:112
void(* on_video_disable_warning)(otc_publisher *publisher, void *user_data)
Definition: publisher.h:256
otc_stream * otc_publisher_get_stream(otc_publisher *publisher)
otc_media_type
Media type.
Definition: publisher.h:63
void(* on_stream_created)(otc_publisher *publisher, void *user_data, const otc_stream *stream)
Definition: publisher.h:142
otc_video_reason
Definition: base.h:16
otc_status otc_publisher_settings_set_scalable_screenshare(otc_publisher_settings *settings, const otc_bool enabled)
const char * connection_id
Definition: publisher.h:76
int64_t packets_sent
Definition: publisher.h:110
Definition: publisher.h:45
otc_status otc_publisher_settings_set_video_capturer(otc_publisher_settings *settings, const struct otc_video_capturer_callbacks *capturer)
otc_publisher_error_code
Definition: publisher.h:39
otc_status otc_publisher_settings_set_video_track(otc_publisher_settings *settings, otc_bool enabled)
otc_status otc_publisher_set_audio_fallback_enabled(otc_publisher *publisher, otc_bool enabled)
struct otc_publisher_settings otc_publisher_settings
Definition: publisher.h:33
otc_status otc_publisher_settings_set_echo_cancellation(otc_publisher_settings *settings, otc_bool enabled)
otc_status otc_publisher_set_publish_captions(otc_publisher *publisher, otc_bool publish_captions)
otc_publisher * otc_publisher_new_with_settings(const struct otc_publisher_callbacks *callbacks, otc_publisher_settings *settings)
Definition: publisher.h:40
Video frame.
otc_status otc_publisher_set_audio_transformers(otc_publisher *publisher, otc_audio_transformer **transformers, uint8_t size)
Sets an array of audio transformers to this publisher's audio stream. If null resets transformers.
const char * otc_publisher_get_publisher_id(const otc_publisher *publisher)
otc_status otc_publisher_set_max_audio_bitrate(otc_publisher *publisher, uint32_t bitrate)
Definition: publisher.h:47
void(* on_error)(otc_publisher *publisher, void *user_data, const char *error_string, enum otc_publisher_error_code error_code)
Definition: publisher.h:221
void(* on_video_disable_warning_lifted)(otc_publisher *publisher, void *user_data)
Definition: publisher.h:266
int64_t packets_sent
Definition: publisher.h:83
otc_status otc_publisher_set_rtc_stats_report_cb(otc_publisher *publisher, const struct otc_publisher_rtc_stats_report_cb cb)
otc_bool otc_publisher_get_publish_audio(const otc_publisher *publisher)
const char * subscriber_id
Definition: publisher.h:105