media_transformer.h
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.
Includes: audio_data.h, video_frame.h
#define OTC_MEDIA_TRANSFORMER_ERROR_SPACE
#define OTC_MEDIA_TRANSFORMER_ERROR_SPACE 0x0A000000
typedef otc_video_transformer
OpenTok video transformer.
typedef struct otc_video_transformer otc_video_transformer;
typedef otc_audio_transformer
OpenTok audio transformer.
typedef struct otc_audio_transformer otc_audio_transformer;
enum otc_media_transformer_error_code
| Name | Value | Description |
|---|---|---|
OTC_MEDIA_TRANSFORMER_INTERNAL_ERROR |
0x0A000000 |
|
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
Available types of media transformers.
| Name | Value | Description |
|---|---|---|
OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM |
0 |
|
OTC_MEDIA_TRANSFORMER_TYPE_VONAGE |
Functions
| Name | Description |
|---|---|
otc_video_transformer_create(type, name, properties, cb, user_data) → {struct otc_video_transformer *} |
Creates an instance of a Vonage Media Library video transformer or a custom video transformer. |
otc_audio_transformer_create(type, name, properties, cb, user_data) → {struct otc_audio_transformer *} |
Creates an instance of a custom audio transformer. |
otc_video_transformer_delete(video_transformer) → {otc_status} |
Note: This function only applies to the Vonage Video API macOS SDK. |
otc_audio_transformer_delete(audio_transformer) → {otc_status} |
Note: This function only applies to the Vonage Video API macOS SDK. |
otc_get_media_transformers_error_message(error) → {const char *} |
Gets the error message associated to provided media transformers error code. |
otc_video_transformer_create(type, name, properties, cb, user_data) → {struct otc_video_transformer *}
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:
| Name | Type | Description |
|---|---|---|
type |
enum otc_media_transformer_type | The 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. |
name |
const char * | The name of the Vonage Media Library transformer or a unique name for the custom video transformer. |
properties |
const char * | A JSON string with the properties of the Vonage video transformer. |
cb |
video_transform_callback | The callback that will perform a custom transformation (disregarded for Vonage transformers) |
user_data |
void * | Opaque 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_audio_transformer_create(type, name, properties, cb, user_data) → {struct otc_audio_transformer *}
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:
| Name | Type | Description |
|---|---|---|
type |
enum otc_media_transformer_type | The type of transformer. Set the to OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM for a custom transformer. |
name |
const char * | A name for the custom tranformer. |
properties |
const char * | A JSON string with the properties of the Vonage audio transformer. |
cb |
audio_transform_callback | The callback that will perform a custom transformation (disregarded for Vonage transformers) |
user_data |
void * | Opaque 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_video_transformer_delete(video_transformer) → {otc_status}
Note: This function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.
Parameters:
| Name | Type | Description |
|---|---|---|
video_transformer |
struct otc_video_transformer * | opaque pointer video transfomer to delete. |
Returns:
otc_status
otc_audio_transformer_delete(audio_transformer) → {otc_status}
Note: This function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.
Parameters:
| Name | Type | Description |
|---|---|---|
audio_transformer |
struct otc_audio_transformer * | opaque pointer audio transfomer to delete. |
Returns:
otc_status
otc_get_media_transformers_error_message(error) → {const char *}
Gets the error message associated to provided media transformers error code.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
int | The media transformers error code. |
Returns:
The associated error message or null if no error description is found for this code.