OpenTok C SDK
|
OpenTok Publisher. More...
Go to the source code of this file.
Data Structures | |
struct | otc_publisher_audio_stats |
struct | otc_publisher_video_stats |
struct | otc_publisher_callbacks |
struct | otc_publisher_rtc_stats |
struct | otc_publisher_rtc_stats_report_cb |
Typedefs | |
typedef struct otc_publisher | otc_publisher |
typedef struct otc_publisher_settings | otc_publisher_settings |
Enumerations | |
enum | otc_publisher_error_code { OTC_PUBLISHER_INTERNAL_ERROR = 2000, OTC_PUBLISHER_SESSION_DISCONNECTED, OTC_PUBLISHER_TIMED_OUT = 1541, OTC_PUBLISHER_UNABLE_TO_PUBLISH = 1500, OTC_PUBLISHER_WEBRTC_ERROR = 1610 } |
enum | otc_publisher_video_type { OTC_PUBLISHER_VIDEO_TYPE_CAMERA = 1, OTC_PUBLISHER_VIDEO_TYPE_SCREEN = 2 } |
OpenTok Publisher.
This file includes the type definition for an OpenTok publisher along with several function declarations.
typedef struct otc_publisher otc_publisher |
OpenTok publisher type definition.
A type representing a publisher of an audio-video stream to an OpenTok session.
typedef struct otc_publisher_settings otc_publisher_settings |
OpenTok publisher settings type definition.
Error code enumeration for OpenTok publishers.
This enumeration represents several error codes associated with a publisher.
otc_status otc_publisher_delete | ( | otc_publisher * | publisher | ) |
Releases a publisher instance, including all hardware resources bound to it.
publisher | The publisher instance to be deleted. |
otc_bool otc_publisher_get_audio_fallback_enabled | ( | const otc_publisher * | publisher | ) |
Returns whether the publisher audio fallback feature is enabled or not. See the otc_publisher_set_audio_fallback_enabled function.
publisher | The publisher instance. |
const char* otc_publisher_get_name | ( | const struct otc_publisher * | publisher | ) |
Gets the name for a given publisher.
publisher | The publisher instance. |
otc_bool otc_publisher_get_publish_audio | ( | const otc_publisher * | publisher | ) |
Returns whether the Publisher is publishing audio or not.
publisher | The publisher instance. |
otc_bool otc_publisher_get_publish_video | ( | const otc_publisher * | publisher | ) |
Returns whether the publisher is publishing video or not.
publisher | The publisher instance. |
const char* otc_publisher_get_publisher_id | ( | const otc_publisher * | publisher | ) |
Gets a unique identifier for a publisher.
publisher | The publisher instance. |
otc_status otc_publisher_get_rtc_stats_report | ( | const otc_publisher * | publisher | ) |
Gets the RTC stats report for the subscriber. This is an asynchronous operation. create an otc_publisher_rtc_stats_report_cb struct and pass it into the otc_publisher_set_rtc_stats_report_cb function prior to calling this function. When the stats are available, the otc_publisher_set_rtc_stats_report_cb callback function is called.
Also see otc_publisher_callbacks.on_audio_stats, otc_publisher_callbacks.on_video_stats, and otc_subscriber_get_rtc_stats_report.
publisher | The publisher. |
otc_session* otc_publisher_get_session | ( | const otc_publisher * | publisher | ) |
Returns the otc_session associated this publisher instance.
publisher | The publisher instance. |
otc_stream* otc_publisher_get_stream | ( | otc_publisher * | publisher | ) |
Returns the stream associated with the publisher.
publisher | The publisher instance to get the stream from. |
void* otc_publisher_get_user_data | ( | const struct otc_publisher * | publisher | ) |
Gets user data for a given publisher.
publisher | The publisher instance. |
enum otc_publisher_video_type otc_publisher_get_video_type | ( | const struct otc_publisher * | publisher | ) |
Gets the publisher video type. See the otc_publisher_set_video_type function.
publisher | The publisher instance. |
otc_publisher* otc_publisher_new | ( | const char * | name, |
const struct otc_video_capturer_callbacks * | capturer, | ||
const struct otc_publisher_callbacks * | callbacks | ||
) |
Creates a new otc_publisher instance.
name | The name of the publisher. Other clients can get the names for streams in the session. |
capturer | Use this parameter if you want to provide a custom video capturer. If it is set to null, the publisher uses a default video capturer using the system's camera. |
callbacks | A pointer to the structure with the publisher callback function pointers. |
otc_publisher* otc_publisher_new_with_settings | ( | const struct otc_publisher_callbacks * | callbacks, |
otc_publisher_settings * | settings | ||
) |
Creates a new otc_publisher instance.
callbacks | A pointer to the struct with publisher callback function pointers. |
settings | The settings struct containing the desired settings for the publisher. |
otc_status otc_publisher_set_audio_fallback_enabled | ( | otc_publisher * | publisher, |
otc_bool | enabled | ||
) |
Enables or disables the audio fallback feature.
The audio-fallback feature is available in sessions that use the OpenTok Media Router. With the audio-fallback feature enabled (the default), when the OpenTok Media Router determines that a stream's quality has degraded significantly for a specific subscriber to the stream, it disables the video in that subscriber in order to preserve audio quality.
To turn off the audio-fallback feature, call the otc_publisher_set_audio_fallback_enabled function (and pass in OTC_FALSE) before calling the otc_session_publish function.
publisher | The publisher to be affected. |
enabled | Whether we want to enable the audio fallback feature or not. |
otc_status otc_publisher_set_max_audio_bitrate | ( | otc_publisher * | publisher, |
uint32_t | bitrate | ||
) |
Sets the max audio bitrate for the publisher.
publisher | The publisher to be affected. |
bitrate | The desired bitrate. |
otc_status otc_publisher_set_publish_audio | ( | otc_publisher * | publisher, |
otc_bool | publish_audio | ||
) |
Whether to publish audio or not. By default, streams publish both audio and video.
publisher | The publisher to be affected. |
publish_audio | Whether to publish audio or not. |
otc_status otc_publisher_set_publish_video | ( | otc_publisher * | publisher, |
otc_bool | publish_video | ||
) |
Whether to publish video or not. By default, streams publish both audio and video.
publisher | The publisher to be affected. |
publish_video | Whether to publish video or not. |
otc_status otc_publisher_set_rtc_stats_report_cb | ( | otc_publisher * | publisher, |
const struct otc_publisher_rtc_stats_report_cb | cb | ||
) |
Sets the RTC stats report callback the publisher.
publisher | The publisher instance. |
cb | The otc_publisher_rtc_stats_report_cb struct that includes the callback function for the RTC stats report. |
otc_status otc_publisher_set_video_type | ( | struct otc_publisher * | publisher, |
enum otc_publisher_video_type | video_type | ||
) |
Sets the publisher video type. By default, videos have the video type set to OTC_PUBLISHER_VIDEO_TYPE_CAMERA (indicating the source of the video is a camera). Set this to OTC_PUBLISHER_VIDEO_TYPE_SCREEN to indicate that the video source is screen sharing. Other clients can detect the video type for streams in the session (to determine the video source type).
publisher | The publisher to be affected. |
video_type | The video type for the publisher. |
otc_status otc_publisher_settings_delete | ( | otc_publisher_settings * | settings | ) |
Deletes an otc_publisher_settings instance.
settings | The otc_publisher_settings instance to be deleted. |
otc_publisher_settings* otc_publisher_settings_new | ( | ) |
Creates a new otc_publisher_settings instance.
otc_status otc_publisher_settings_set_audio_track | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables an audio track for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Enable/disable the existence of an audio track for a publisher to be constructed with otc_publisher_new_with_settings. |
otc_status otc_publisher_settings_set_auto_gain_control | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables audio automatic gain control for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Whether to enable (true, the default) or disable (false) automatic gain control. |
otc_status otc_publisher_settings_set_echo_cancellation | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables acoustic echo cancellation for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Whether to enable (true, the default) or disable (false) acoustic echo cancellation support. |
otc_status otc_publisher_settings_set_name | ( | otc_publisher_settings * | settings, |
const char * | name | ||
) |
Sets the desired name for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
name | The name for the publisher. Other clients can get the names for streams in the session. |
otc_status otc_publisher_settings_set_noise_suppression | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables noise suppression for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Whether to enable (true, the default) or disable (false) noise suppression. |
otc_status otc_publisher_settings_set_opus_dtx | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables Opus DTX for a publisher to be constructed with otc_publisher_new_with_settings. Enabling Opus DTX can reduce bandwidth usage in streams that have long periods of silence.
settings | The otc_publisher_settings instance to be affected. |
enabled | Whether to enable (true) or disable (false, the default) Opus DTX support. |
otc_status otc_publisher_settings_set_scalable_screenshare | ( | otc_publisher_settings * | settings, |
const otc_bool | enabled | ||
) |
Allow use of scalable screenshare for a publisher that has the videoType set to OTStreamVideoTypeScreen with otc_publisher_new_with_settings.
This is a beta feature.
settings | The otc_publisher_settings instance to be affected. |
enabled | Enable/disable the use of scalable screenshare |
otc_status otc_publisher_settings_set_stereo | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables stereo audio for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Enable/disable stereo audio support for a publisher to be constructed with otc_publisher_new_with_settings. |
otc_status otc_publisher_settings_set_video_capturer | ( | otc_publisher_settings * | settings, |
const struct otc_video_capturer_callbacks * | capturer | ||
) |
Sets the video capturer for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
capturer | The video capturer. |
otc_status otc_publisher_settings_set_video_track | ( | otc_publisher_settings * | settings, |
otc_bool | enabled | ||
) |
Enables a video track for a publisher to be constructed with otc_publisher_new_with_settings.
settings | The otc_publisher_settings instance to be affected. |
enabled | Enable/disable the existence of an video track for a publisher to be constructed with otc_publisher_new_with_settings. |