|
OpenTok C SDK
|
Video frame. More...
Go to the source code of this file.
Data Structures | |
| struct | otc_video_frame_planar_memory_callbacks |
Typedefs | |
| typedef struct otc_video_frame | otc_video_frame |
| typedef void(* | otc_video_frame_memory_release_callback) (const uint8_t *buffer, void *arg) |
| typedef void(* | video_transform_callback) (void *user_data, struct otc_video_frame *frame) |
| The callback that will perform the custom transformation. | |
Video frame.
This file includes the type definition for a video frame along with several function declarations useful when handling them.
| typedef struct otc_video_frame otc_video_frame |
Video frame type definition.
| typedef void(* otc_video_frame_memory_release_callback) (const uint8_t *buffer, void *arg) |
Type definition for the video frame memory release callback function.
This is a function pointer to the callback function that is called when the app should release the memory holding a video frame.
| buffer | A function pointer to the buffer. |
| arg | A pointer to additional arguments. |
| typedef void(* video_transform_callback) (void *user_data, struct otc_video_frame *frame) |
The callback that will perform the custom transformation.
Note: This functionality only applies to the Vonage Video API macOS SDK. It does not work in the Vonage Video API Linux SDK.
Video frame video format enumeration.
This enumeration represents several video frame formats.
Video frame video plane enumeration.
|
extern |
Gets a video frame timestamp in milliseconds since epoch time.
| frame | A pointer to the video frame instance. |
|
extern |
Gets the height of a video frame, in pixels.
| frame | A pointer to the video frame instance. |
|
extern |
Gets the width of a video frame, in pixels.
| frame | A pointer to the video frame instance. |
|
extern |
Checks whether a video frame is contiguous or not.
| frame | A pointer to the video frame instance. |
|
extern |
Checks whether a video frame is packed or not.
| frame | A pointer to the video frame instance. |
|
extern |
Free resources associated with the frame.
| frame | A pointer to a video frame instance. |
|
extern |
Converts a given frame. All the video frames provided by the SDK callback functions are bound to this. If you plan to save the frame so you use it later, you'll need to copy it. In addition to that, if you want to convert a video frame to a different format, you'll use this function also If the destination format is the same as the source, a shallow copy (n buffer copy) will be made if possible.
| format | The format of the video frame which will be returned. This function can convert frames to the following formats: OTC_VIDEO_FRAME_FORMAT_ARGB32, OTC_VIDEO_FRAME_FORMAT_BGRA32, OTC_VIDEO_FRAME_FORMAT_ABGR32, OTC_VIDEO_FRAME_FORMAT_RGBA32 and OTC_VIDEO_FRAME_FORMAT_YUV420P. |
| frame | A pointer to the video frame instance. |
|
extern |
Converts a given frame in place. This changes the data of the input frame.
| format | The format of the video frame. This function can convert frames to the following formats: OTC_VIDEO_FRAME_FORMAT_ARGB32, OTC_VIDEO_FRAME_FORMAT_BGRA32, OTC_VIDEO_FRAME_FORMAT_ABGR32, and OTC_VIDEO_FRAME_FORMAT_YUV420P. |
| input_frame | A pointer to the video frame instance. |
| planes | A pointer to a pointer to the video frame planes. |
| strides | A pointer to a pointer to the video frame stride. |
|
extern |
Copies a given video frame.
| frame | A pointer to the video frame instance. |
|
extern |
Gets a pointer to the buffer containing video frame data.
| frame | A pointer to the video frame instance to get the buffer from. |
|
extern |
Gets the video format of a video frame.
| frame | A pointer to the video frame instance. |
|
extern |
Gets the number of planes of a video frame. Typically, this returns 3 for a YUV fame and 1 for a RGBA/BGRA fame.
| frame | A pointer to the video frame instance. |
|
extern |
Gets the binary data from one of the planes of a video frame.
| frame | A pointer to the video frame instance. |
| plane | The video plane to get data from. |
|
extern |
Gets the height of a plane in a video frame.
| frame | A pointer to the video frame instance. |
| plane | The video plane to get the height from. |
|
extern |
Gets the size of a plane in a video frame.
| frame | A pointer to the video frame instance. |
| plane | The video plane to get the size from. |
|
extern |
Gets plane stride from a give plane in a video frame.
| frame | A pointer to the video frame instance. |
| plane | The video plane to get the stride from. |
|
extern |
Gets the width of a plane in a video frame.
| frame | A pointer to the video frame instance. |
| plane | The video plane to get the width from. |
|
extern |
Makes a mutable copy of a given video frame.
| frame | A pointer to the video frame instance. |
|
extern |
Creates a new video frame with a given format.
| format | The desired format. |
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| buffer | A pointer to a buffer containing video frame data. |
|
extern |
Creates a new compressed video frame.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| buffer | A pointer to a buffer containing video frame data. |
| size | The video frame size in memory. |
|
extern |
Creates a new video frame from data in a contiguous memmory buffer.
| format | The format for the video frame passed in. |
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| is_shallow_copyable | Whether you can make a shallow copy of the frame. |
| buffer | A pointer to the buffer containing the frame data. |
| size | The size of the frame data. |
| callback | The video frame memory release callback function. |
| arg | A pointer to additional arguments. |
|
extern |
Creates a new video frame with a given format from its planes.
| format | The desired format. |
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| planes | A pointer to a pointer to the buffer containing the video frame planes. |
| strides | Strides. |
|
extern |
Creates a new video frame with I420 format.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| y_plane | A pointer to a buffer containing Y plane data. |
| y_stride | Y stride. |
| u_plane | A pointer to a buffer containing U plane data. |
| u_stride | U stride. |
| v_plane | A pointer to a buffer containing V plane data. |
| v_stride | V stride. |
|
extern |
Creates a new video frame with I420 format from a list of planes.
| input_format | The format for the video frame passed as input. |
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| planes | A pointer to a pointer to the buffer containing the video frame planes. |
| strides | Strides. |
|
extern |
Creates a new I420 format video frame from YUV data.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| y_plane | A pointer the Y plane. |
| y_stride | The Y stride. |
| u_plane | A pointer the U plane. |
| u_stride | The U stride. |
| v_plane | A pointer the V plane. |
| v_stride | The V stride. |
|
extern |
Creates a new video frame with MJPEG format.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| buffer | A pointer to a buffer containing video frame data. |
| size | The video frame size in memory. |
|
extern |
Creates a new video frame with an NV12 wrapper.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| y_plane | A pointer the Y plane. |
| y_stride | The Y stride. |
| uv_plane | A pointer the UV plane. |
| uv_stride | The UV stride. |
|
extern |
Creates a new video frame with an NV21 wrapper.
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| y_plane | A pointer the Y plane. |
| y_stride | The Y stride. |
| uv_plane | A pointer the UV plane. |
| uv_stride | The UV stride. |
|
extern |
Creates a new video frame from a planar memory wrapper. The otc_video_frame_planar_memory_callbacks struct, passed in, defines callback functions that are invoked when video frame and stride data is requested.
| format | The format for the video frame passed in. |
| width | The width of the video, in pixels. |
| height | The height of the video, in pixels. |
| is_shallow_copyable | Whether you can make a shallow copy of the frame. |
| callbacks | A pointer to the struct containing the video frame callback functions. |
|
extern |
Sets the video format of a video frame.
| frame | A pointer to the video frame instance. |
| format | The video frame format. |
|
extern |
Sets the timestamp for a video frame in milliseconds since epoch time.
| frame | A pointer to the video frame instance. |
| timestamp | The timestamp value. |
|
extern |
Gets the size of the buffer containing video frame data.
| frame | A pointer to the video frame instance to get the buffer size from. |