Vonage Video API Linux SDK
Data Structures | Typedefs | Enumerations | Functions
base.h File Reference

Base functions. More...

#include "config.h"

Data Structures

struct  otc_on_mute_forced_info
 
struct  otc_transport_stats
 

Typedefs

typedef int otc_bool
 
typedef int otc_status
 
typedef void(* otc_logger_callback) (const char *message)
 

Enumerations

enum  otc_video_reason {
  OTC_VIDEO_REASON_NONE = 0 , OTC_VIDEO_REASON_PUBLISH_VIDEO = 1 , OTC_VIDEO_REASON_SUBSCRIBE_TO_VIDEO = 2 , OTC_VIDEO_REASON_QUALITY = 3 ,
  OTC_VIDEO_REASON_CODEC_NOT_SUPPORTED = 4 , OTC_VIDEO_REASON_QUALITY_DEGRADATION_BANDWIDTH = 5 , OTC_VIDEO_REASON_QUALITY_DEGRADATION_CPU , OTC_VIDEO_REASON_QUALITY_DEGRADATION_OTHER = 7 ,
  OTC_VIDEO_REASON_CODEC_CHANGE = 8 , OTC_VIDEO_REASON_RESOLUTION_CHANGE = 9 , OTC_VIDEO_REASON_VIDEO_INTERRUPTION = 10 , OTC_VIDEO_REASON_SENDER_QUALITY_RESTRICTION = 11
}
 
enum  otc_network_reason {
  OTC_NETWORK_REASON_NONE = 0 , OTC_NETWORK_REASON_UNKNOWN = 1 , OTC_NETWORK_REASON_BANDWIDTH = 2 , OTC_NETWORK_REASON_PACKET_LOSS = 3 ,
  OTC_NETWORK_REASON_NETWORK_CONDITION_CHANGE = 4
}
 
enum  otc_constant { OTC_SUCCESS = 0 , OTC_FALSE = 0 , OTC_TRUE = !OTC_FALSE }
 
enum  otc_error_code {
  OTC_INVALID_PARAM = 1 , OTC_FATAL = 2 , OTC_INVALID_VIDEO_FORMAT = 3 , OTC_CONNECTION_DROPPED = 1022 ,
  OTC_UNABLE_TO_FORCE_DISCONNECT = 1520 , OTC_UNABLE_TO_FORCE_MUTE = 1540 , OTC_CONNECTION_TIMED_OUT = 1542 , OTC_UNKNOWN_PUBLISHER_INSTANCE = 2003 ,
  OTC_UNKNOWN_SUBSCRIBER_INSTANCE = 2004 , OTC_VIDEO_CAPTURE_FAILED = 3000 , OTC_CAMERA_FAILED = 3010 , OTC_VIDEO_RENDER_FAILED = 4000 ,
  OT_UNABLE_TO_ACCESS_MEDIA_ENGINE = 5000
}
 
enum  otc_log_level {
  OTC_LOG_LEVEL_DISABLED = 0 , OTC_LOG_LEVEL_ERROR = 1 , OTC_LOG_LEVEL_WARN = 2 , OTC_LOG_LEVEL_INFO = 3 ,
  OTC_LOG_LEVEL_DEBUG = 4 , OTC_LOG_LEVEL_FATAL = OTC_LOG_LEVEL_ERROR , OTC_LOG_LEVEL_MSG = OTC_LOG_LEVEL_DEBUG , OTC_LOG_LEVEL_TRACE = OTC_LOG_LEVEL_DEBUG ,
  OTC_LOG_LEVEL_ALL = OTC_LOG_LEVEL_DEBUG
}
 
enum  otc_network_condition {
  OTC_NETWORK_CONDITION_UNKNOWN = 0 , OTC_NETWORK_CONDITION_CRITICAL = 1 , OTC_NETWORK_CONDITION_WARNING = 2 , OTC_NETWORK_CONDITION_FAIR = 3 ,
  OTC_NETWORK_CONDITION_GOOD = 4 , OTC_NETWORK_CONDITION_EXCELLENT = 5
}
 Estimated network condition score for a transport. More...
 
enum  otc_network_degradation_source { OTC_NETWORK_DEGRADATION_SOURCE_NONE = 0 , OTC_NETWORK_DEGRADATION_SOURCE_BOTH_OR_UNCLEAR , OTC_NETWORK_DEGRADATION_SOURCE_LOCAL , OTC_NETWORK_DEGRADATION_SOURCE_REMOTE }
 

Functions

otc_status otc_init (void *reserved)
 
otc_status otc_destroy ()
 
void otc_log_set_logger_callback (otc_logger_callback callback)
 
void otc_log_enable (enum otc_log_level log_level)
 
enum otc_log_level otc_get_log_level ()
 

Detailed Description

Base functions.

This file includes functions uses to initialize and destroy the library engine, as well as other functions to enable console logging.

Typedef Documentation

◆ otc_bool

typedef int otc_bool

Type definition for Boolean values.

Useful type for variables to represent Boolean values (true and false).

◆ otc_logger_callback

typedef void(* otc_logger_callback) (const char *message)

Type definition for a function pointer to the function used as the custom logging callback to get messages logged by the SDK.

Parameters
messageA pointer to the message being logged.
See also
otc_log_set_logger_callback

◆ otc_status

typedef int otc_status

Type definition for statuses.

This is the most common type for return value for functions in this library. This type includes values from the error code enumerations.

See also
otc_constant
otc_error_code
otc_session_error_code
otc_publisher_error_code
otc_subscriber_error_code

Enumeration Type Documentation

◆ otc_constant

This enumeration includes commonly used constants.

Enumerator
OTC_SUCCESS 

Constant that represents success.

OTC_FALSE 

Constant that represents false.

OTC_TRUE 

Constant that represents true.

◆ otc_error_code

This enumeration includes error codes.

Enumerator
OTC_INVALID_PARAM 

Invalid funtion argument error code.

An argment used in a function call is not valid.

OTC_FATAL 

Fatal error code.

Generic error.

OTC_INVALID_VIDEO_FORMAT 

Invalid video format

Raised when the capturer is configured with an invalid video format

OTC_CONNECTION_DROPPED 

Connection dropped error code.

The connection to the OpenTok messaging server was dropped. Check the network connection.

OTC_UNABLE_TO_FORCE_DISCONNECT 

Force disconnect error code.

Unable to successfully call otc_session_force_disconnect, perhaps because of missing permissions.

OTC_UNABLE_TO_FORCE_MUTE 

Force mute error code.

Unable to successfully call otc_session_force_mute_all or otc_session_force_mute_stream, perhaps because of missing permissions.

OTC_CONNECTION_TIMED_OUT 

Connection time out error code.

Time out while performing a connect action.

OTC_UNKNOWN_PUBLISHER_INSTANCE 

Unknown publisher instance error code.

An unknown Publisher instance was used as a function argument.

OTC_UNKNOWN_SUBSCRIBER_INSTANCE 

Unknown subscriber instance error code.

An unknown subscriber instance was used as a function argument.

OTC_VIDEO_CAPTURE_FAILED 

Video capture error code.

There was an error with the video capturer.

OTC_CAMERA_FAILED 

Acquiring video camera error code.

There was an error while acquiring video from the camera.

OTC_VIDEO_RENDER_FAILED 

Video rendering error code.

There was an error while rendering video.

OT_UNABLE_TO_ACCESS_MEDIA_ENGINE 

Media engine access error code.

There was an error when trying to get the list of supported video codecs.

◆ otc_log_level

Log level enumeration.

This enumeration represents the different log levels supported.

Enumerator
OTC_LOG_LEVEL_DISABLED 

No messages enum value.

OTC_LOG_LEVEL_ERROR 

Error level messages.

OTC_LOG_LEVEL_WARN 

Warning level messages.

OTC_LOG_LEVEL_INFO 

Info level messages.

OTC_LOG_LEVEL_DEBUG 

Debug level messages.

OTC_LOG_LEVEL_FATAL 

DEPRECATED.

OTC_LOG_LEVEL_MSG 

DEPRECATED.

OTC_LOG_LEVEL_TRACE 

DEPRECATED.

OTC_LOG_LEVEL_ALL 

DEPRECATED.

◆ otc_network_condition

Estimated network condition score for a transport.

This enum represents the overall health of the network connection for a given transport (local or remote). It is typically derived from metrics such as packet loss, and estimated available bandwidth. Higher values indicate better network conditions.

OTC_NETWORK_CONDITION_WARNING and OTC_NETWORK_CONDITION_CRITICAL indicate degraded network conditions that may trigger audio fallback callbacks. If audio fallback is enabled, the SDK will notify via the corresponding callbacks, and in the CRITICAL state, video is disabled to preserve call stability.

Enumerator
OTC_NETWORK_CONDITION_UNKNOWN 

Network condition could not be determined

OTC_NETWORK_CONDITION_CRITICAL 

Severe network issues; audio fallback is triggered if enabled

OTC_NETWORK_CONDITION_WARNING 

Poor network conditions; video quality is heavily impacted and a video disable warning may be triggered if audio fallback is enabled

OTC_NETWORK_CONDITION_FAIR 

Moderate network conditions; video quality may be restricted by the media server or peer

OTC_NETWORK_CONDITION_GOOD 

Good network conditions; minor temporary issues may occur

OTC_NETWORK_CONDITION_EXCELLENT 

Excellent network conditions; video quality is optimal and estimated bandwidth can accommodate the maximum bitrate for the current resolution

◆ otc_network_degradation_source

Indicates the source of video/network degradation in the session.

This enum identifies which side of the call is responsible for observed network issues impacting video quality. It complements per-transport network condition metrics.

Enumerator
OTC_NETWORK_DEGRADATION_SOURCE_NONE 

No degradation detected; video quality is good.

OTC_NETWORK_DEGRADATION_SOURCE_BOTH_OR_UNCLEAR 

Degradation detected, but the responsible side cannot be determined.

OTC_NETWORK_DEGRADATION_SOURCE_LOCAL 

Local network or transport is the cause of degradation.

OTC_NETWORK_DEGRADATION_SOURCE_REMOTE 

Remot network or transport is the cause of degradation.

◆ otc_network_reason

Enum describing reasons impacting the network condition.

These values indicate the primary factor affecting the current network condition assessment, such as bandwidth constraints, or packet loss.

Enumerator
OTC_NETWORK_REASON_NONE 

No notable reason.

OTC_NETWORK_REASON_UNKNOWN 

Unknown reason.

OTC_NETWORK_REASON_BANDWIDTH 

Network condition score impacted by bandwidth.

OTC_NETWORK_REASON_PACKET_LOSS 

Network condition score impacted by packet loss.

OTC_NETWORK_REASON_NETWORK_CONDITION_CHANGE 

Indicates that the local or remote participant network condition has changed. Triggered when a significant change is detected in the local or remote participant network.

◆ otc_video_reason

Enum for reasons for a video to be started, stopped, resumed, etc.

Enumerator
OTC_VIDEO_REASON_NONE 

No quality degradation or notable video event. Default or unknown reason.

OTC_VIDEO_REASON_PUBLISH_VIDEO 

The client publishing the stream stopped streaming video.

OTC_VIDEO_REASON_SUBSCRIBE_TO_VIDEO 

The local client stopped subscribing to video.

OTC_VIDEO_REASON_QUALITY 

The video event was caused by a change to the video stream quality.

OTC_VIDEO_REASON_CODEC_NOT_SUPPORTED 

The video event was caused when video in the subscriber stream was disabled because the stream uses a video codec that is not supported on the device.

OTC_VIDEO_REASON_QUALITY_DEGRADATION_BANDWIDTH 

Quality degradation due to insufficient network bandwidth.

OTC_VIDEO_REASON_QUALITY_DEGRADATION_CPU 

Quality degradation caused by CPU limitations on the client device.

OTC_VIDEO_REASON_QUALITY_DEGRADATION_OTHER 

Quality degradation caused by other reason

OTC_VIDEO_REASON_CODEC_CHANGE 

Video codec has changed

OTC_VIDEO_REASON_RESOLUTION_CHANGE 

Change in video resolution or number of layers This can occur due to bitrate constraints, encoder adaptation, camera source changes (e.g., switching cameras or changing input resolution), or configuration changes, and does not always imply quality degradation.

OTC_VIDEO_REASON_VIDEO_INTERRUPTION 

Video interruption event

OTC_VIDEO_REASON_SENDER_QUALITY_RESTRICTION 

Sender restricted video quality

Function Documentation

◆ otc_destroy()

otc_status otc_destroy ( )

Destroys the library engine. You should call this function when you are done executing code that uses the library.

Returns
Return value indicating either error or success.

◆ otc_get_log_level()

enum otc_log_level otc_get_log_level ( )

Gets the current console logging level.

Returns
The log level set.

◆ otc_init()

otc_status otc_init ( void *  reserved)

Initializes the library. You must call this function before the execution of any other code using the library.

Parameters
reservedA void pointer to a memory area holding reserved resources used for the internal implementation. This must be set to NULL.
Returns
Return value indicating either error or success.

◆ otc_log_enable()

void otc_log_enable ( enum otc_log_level  log_level)

Enables logging of SDK messages for a given log level.

Parameters
log_levelThe desired log level.
See also
otc_log_set_logger_callback
otc_get_log_level

◆ otc_log_set_logger_callback()

void otc_log_set_logger_callback ( otc_logger_callback  callback)

Sets the function pointer to a custom logging callback function to get messages logged by the SDK. If you do not set a logging callback function, the SDK will log messages to the console.

Parameters
callbackA pointer to the callback function.
See also
otc_log_enable