OpenTok C SDK
Macros | Typedefs | Enumerations | Functions
media_transformer.h File Reference

Media transformer functions. More...

#include "audio_data.h"
#include "video_frame.h"

Go to the source code of this file.

Macros

#define OTC_MEDIA_TRANSFORMER_ERROR_SPACE   0x0A000000
 

Typedefs

typedef struct otc_video_transformer otc_video_transformer
 
typedef struct otc_audio_transformer otc_audio_transformer
 

Enumerations

enum  otc_media_transformer_error_code {
  OTC_MEDIA_TRANSFORMER_INTERNAL_ERROR, OTC_MEDIA_TRANSFORMER_INVALID_TYPE, OTC_MEDIA_TRANSFORMER_NAME_NOT_PROVIDED, OTC_MEDIA_TRANSFORMER_CUSTOM_CALLBACK_NOT_PROVIDED,
  OTC_MEDIA_TRANSFORMER_PROPERTIES_NOT_PROVIDED, OTC_MEDIA_TRANSFORMER_MODEL_NOT_FOUND, OTC_MEDIA_TRANSFORMER_OPENTOK_TRANSFORMERS_LIBRARY_NOT_LOADED, OTC_MEDIA_TRANSFORMER_OPENTOK_TRANSFORMERS_SYMBOL_NOT_FOUND
}
 
enum  otc_media_transformer_type { OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM = 0, OTC_MEDIA_TRANSFORMER_TYPE_VONAGE }
 Available types of media transformers.
 

Functions

struct otc_video_transformerotc_video_transformer_create (enum otc_media_transformer_type type, const char *name, const char *properties, video_transform_callback cb, void *user_data)
 
struct otc_audio_transformerotc_audio_transformer_create (enum otc_media_transformer_type type, const char *name, const char *properties, audio_transform_callback cb, void *user_data)
 
otc_status otc_video_transformer_delete (struct otc_video_transformer *video_transformer)
 Deletes a video transformer. More...
 
otc_status otc_audio_transformer_delete (struct otc_audio_transformer *audio_transformer)
 Deletes an audio transformer. More...
 
const char * otc_get_media_transformers_error_message (int error)
 

Detailed Description

Media transformer functions.

This file includes functions for working with custom media transformers and Vonage Media Processor library transformers. For more informmation, see this developer guide.

Note: This functionality only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.

Typedef Documentation

◆ otc_audio_transformer

OpenTok audio transformer.

◆ otc_video_transformer

OpenTok video transformer.

Function Documentation

◆ otc_audio_transformer_create()

struct otc_audio_transformer* otc_audio_transformer_create ( enum otc_media_transformer_type  type,
const char *  name,
const char *  properties,
audio_transform_callback  cb,
void *  user_data 
)

Creates an instance of a custom audio transformer.

Note: This function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK. If an error occurs, NULL is returned and "errno" is set.

Parameters
typeThe type of transformer. Set the to OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM for a custom transformer.
nameA name for the custom tranformer.
propertiesA JSON string with the properties of the Vonage audio transformer.
[in]cbThe callback that will perform a custom transformation (disregarded for Vonage transformers)
[in]user_dataOpaque data passed by the user and returned in the callback.
Returns
audio_transformer opaque pointer audio transfomer to create. NULL if error occurs (which can be checked via "errno").

◆ otc_audio_transformer_delete()

otc_status otc_audio_transformer_delete ( struct otc_audio_transformer audio_transformer)

Deletes an audio transformer.

Note: This function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.

Parameters
[in]audio_transformeropaque pointer audio transfomer to delete.

◆ otc_get_media_transformers_error_message()

const char* otc_get_media_transformers_error_message ( int  error)

Gets the error message associated to provided media transformers error code.

Parameters
errorThe media transformers error code.
Returns
The associated error message or null if no error description is found for this code.

◆ otc_video_transformer_create()

struct otc_video_transformer* otc_video_transformer_create ( enum otc_media_transformer_type  type,
const char *  name,
const char *  properties,
video_transform_callback  cb,
void *  user_data 
)

Creates an instance of a Vonage Media Library video transformer or a custom video transformer. This function is supported in the Vonge Video client SDK for macOS (not the Linux SDK). For more information, see Using the Vonage Media Processor library.

Important: In version 2.27.3+ of the Vonage Video client SDK for macOS, you need to add the Vonage Media Library separately from the Vonage Video macOS SDK. For details, see Vonage Media Library integration.

Check additional information in the Vonage Media Library README.md file.

If an error occurs, NULL is returned and "errno" is set.

Parameters
typeThe type of transformer. Set the to OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM for a custom transformer. Set the to OTC_MEDIA_TRANSFORMER_TYPE_VONAGE for a Vonage Media Library transformer.
nameThe name of the Vonage Media Library transformer or a unique name for the custom video transformer.
propertiesA JSON string with the properties of the Vonage video transformer.
[in]cbThe callback that will perform a custom transformation (disregarded for Vonage transformers)
[in]user_dataOpaque data passed by the user and returned in the callback.
Returns
video_transformer opaque pointer video transfomer to create. NULL if error occurs (which can be checked via "errno").

◆ otc_video_transformer_delete()

otc_status otc_video_transformer_delete ( struct otc_video_transformer video_transformer)

Deletes a video transformer.

Note: This function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.

Parameters
[in]video_transformeropaque pointer video transfomer to delete.