Suggestions

close search

Add Messaging, Voice, and Authentication to your apps with Vonage Communications APIs

Visit the Vonage API Developer Portal

media_transformer.h File Reference

Media transformer functions. More...

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

Enumerations

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...

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.

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.

Parameters
typeThe type of transformer. Set the to OTC_MEDIA_TRANSFORMER_TYPE_CUSTOM for a custom transformer. (Vonage Media Library audio transformers are not supported in this beta version.)
nameA name for the custom tranformer.
propertiesA JSON string with the properties of the Vonage audio transformer. No Vonage audio transformer is yet supported so this paramater must be NULL.
[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.

◆ 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_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. Currently, video transformers are only supported on Apple silicon Macs, and this function only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK. For more information, see Using the Vonage Media Processor library.

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. Currently supported transformers are "BackgroundBlur" and "BackgroundReplacement".
propertiesA JSON string with the properties of the Vonage video transformer. For a background blur transformer, the format of the JSON is "{\"radius":"None"}". Valid values for the <code>radius</code> property a None", "High", and "Low". For a custom background blur transformer, the format of the JSON is "{\"radius":"Custom","custom_radius":"value"}", where custom_radius can be any positive integer. For a background replacement transformer, the format of the JSON is "{\"image_file_path":"path/to/image"}", where image_file_path is the absolute file path of a local image to use as virtual background. Supported image formats are PNG and JPEG.
[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.

◆ 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.