OpenTok C SDK
Loading...
Searching...
No Matches
video_frame.h
Go to the documentation of this file.
1
7#ifndef VIDEO_FRAME_H
8#define VIDEO_FRAME_H
9
10#ifndef _WIN32
11#include <unistd.h>
12#endif
13
14#include "base.h"
15#include "config.h"
16
17OTC_BEGIN_DECL
18
22
52
67
81 const uint8_t* (*get_plane)(void* user_data,
82 enum otc_video_frame_plane plane);
83
92
99 void (*release)(void* user_data);
100
105
110 void* reserved;
111};
112
121typedef void (*otc_video_frame_memory_release_callback)(const uint8_t* buffer,
122 void* arg);
123
130typedef void (*video_transform_callback)(void* user_data,
131 struct otc_video_frame* frame);
132
133OTC_DECL(void*)
134otc_video_frame_get_native_handle(const otc_video_frame* frame);
135
146OTC_DECL(otc_video_frame*)
148 int width,
149 int height,
150 const uint8_t* buffer);
151
159OTC_DECL(otc_status) otc_video_frame_delete(otc_video_frame* frame);
160
175OTC_DECL(otc_video_frame*)
177 int height,
178 const uint8_t* y_plane,
179 int y_stride,
180 const uint8_t* u_plane,
181 int u_stride,
182 const uint8_t* v_plane,
183 int v_stride);
184
195OTC_DECL(otc_video_frame*)
197 int height,
198 const uint8_t* buffer,
199 size_t size);
200
211OTC_DECL(otc_video_frame*)
213 int height,
214 const uint8_t* buffer,
215 size_t size);
216
229OTC_DECL(otc_video_frame*)
231 int width,
232 int height,
233 const uint8_t** planes,
234 int* strides);
235
248OTC_DECL(otc_video_frame*)
250 enum otc_video_frame_format input_format,
251 int width,
252 int height,
253 const uint8_t** planes,
254 int* strides);
255
270OTC_DECL(otc_video_frame*)
272 enum otc_video_frame_format format,
273 int width,
274 int height,
275 otc_bool is_shallow_copyable,
276 const uint8_t* buffer,
277 size_t size,
279 void* arg);
280
296OTC_DECL(otc_video_frame*)
298 enum otc_video_frame_format format,
299 int width,
300 int height,
301 otc_bool is_shallow_copyable,
303
318OTC_DECL(otc_video_frame*)
320 int height,
321 const uint8_t* y_plane,
322 int y_stride,
323 const uint8_t* u_plane,
324 int u_stride,
325 const uint8_t* v_plane,
326 int v_stride);
327
340OTC_DECL(otc_video_frame*)
342 int height,
343 const uint8_t* y_plane,
344 int y_stride,
345 const uint8_t* uv_plane,
346 int uv_stride);
347
360OTC_DECL(otc_video_frame*)
362 int height,
363 const uint8_t* y_plane,
364 int y_stride,
365 const uint8_t* uv_plane,
366 int uv_stride);
367
374OTC_DECL(const uint8_t*)
376
384OTC_DECL(size_t) otc_video_frame_get_buffer_size(const otc_video_frame* frame);
385
392OTC_DECL(int64_t) otc_video_frame_get_timestamp(const otc_video_frame* frame);
393
400OTC_DECL(void)
402
409OTC_DECL(int) otc_video_frame_get_width(const otc_video_frame* frame);
410
417OTC_DECL(int) otc_video_frame_get_height(const otc_video_frame* frame);
418
426OTC_DECL(size_t)
428
436OTC_DECL(enum otc_video_frame_format)
438
446OTC_DECL(void)
448 enum otc_video_frame_format format);
449
458OTC_DECL(const uint8_t*)
460 enum otc_video_frame_plane plane);
461
469OTC_DECL(size_t)
471 enum otc_video_frame_plane plane);
472
480OTC_DECL(int)
482 enum otc_video_frame_plane plane);
483
491OTC_DECL(int)
493 enum otc_video_frame_plane plane);
494
502OTC_DECL(int)
504 enum otc_video_frame_plane plane);
505
513
520OTC_DECL(otc_video_frame*)
522
543OTC_DECL(otc_video_frame*)
545 const otc_video_frame* frame);
546
562OTC_DECL(otc_status)
564 uint8_t** planes,
565 const int* strides,
566 const otc_video_frame* input_frame);
567
574OTC_DECL(otc_bool) otc_video_frame_is_packed(const otc_video_frame* frame);
575
582OTC_DECL(otc_bool) otc_video_frame_is_contiguous(const otc_video_frame* frame);
583
584OTC_END_DECL
585
586#endif // VIDEO_FRAME_H
Base functions.
int otc_bool
Definition base.h:167
int otc_status
Definition base.h:262
Definition video_frame.h:72
void(* release)(void *user_data)
Definition video_frame.h:99
void * user_data
Definition video_frame.h:104
void * reserved
Definition video_frame.h:110
int(* get_plane_stride)(void *user_data, enum otc_video_frame_plane plane)
Definition video_frame.h:91
otc_video_frame * otc_video_frame_new_from_planes(enum otc_video_frame_format format, int width, int height, const uint8_t **planes, int *strides)
otc_video_frame * otc_video_frame_new(enum otc_video_frame_format format, int width, int height, const uint8_t *buffer)
otc_video_frame * otc_video_frame_new_NV21_wrapper(int width, int height, const uint8_t *y_plane, int y_stride, const uint8_t *uv_plane, int uv_stride)
otc_video_frame * otc_video_frame_new_compressed(int width, int height, const uint8_t *buffer, size_t size)
void otc_video_frame_set_format(otc_video_frame *frame, enum otc_video_frame_format format)
otc_video_frame * otc_video_frame_new_planar_memory_wrapper(enum otc_video_frame_format format, int width, int height, otc_bool is_shallow_copyable, struct otc_video_frame_planar_memory_callbacks *callbacks)
otc_video_frame * otc_video_frame_new_I420(int width, int height, const uint8_t *y_plane, int y_stride, const uint8_t *u_plane, int u_stride, const uint8_t *v_plane, int v_stride)
struct otc_video_frame otc_video_frame
Definition video_frame.h:21
int otc_video_frame_get_plane_width(const otc_video_frame *frame, enum otc_video_frame_plane plane)
otc_video_frame * otc_video_frame_new_NV12_wrapper(int width, int height, const uint8_t *y_plane, int y_stride, const uint8_t *uv_plane, int uv_stride)
size_t otc_video_frame_get_plane_size(const otc_video_frame *frame, enum otc_video_frame_plane plane)
enum otc_video_frame_format otc_video_frame_get_format(const otc_video_frame *frame)
otc_video_frame * otc_video_frame_new_MJPEG(int width, int height, const uint8_t *buffer, size_t size)
otc_video_frame_format
Definition video_frame.h:27
@ OTC_VIDEO_FRAME_FORMAT_RGB24
Definition video_frame.h:40
@ OTC_VIDEO_FRAME_FORMAT_MAX
Definition video_frame.h:47
@ OTC_VIDEO_FRAME_FORMAT_MJPEG
Definition video_frame.h:43
@ OTC_VIDEO_FRAME_FORMAT_COMPRESSED
Definition video_frame.h:49
@ OTC_VIDEO_FRAME_FORMAT_ABGR32
Definition video_frame.h:41
@ OTC_VIDEO_FRAME_FORMAT_NV12
Definition video_frame.h:32
@ OTC_VIDEO_FRAME_FORMAT_ARGB32
Definition video_frame.h:36
@ OTC_VIDEO_FRAME_FORMAT_UYVY
Definition video_frame.h:35
@ OTC_VIDEO_FRAME_FORMAT_BGRA32
Definition video_frame.h:38
@ OTC_VIDEO_FRAME_FORMAT_UNKNOWN
Definition video_frame.h:28
@ OTC_VIDEO_FRAME_FORMAT_NV21
Definition video_frame.h:33
@ OTC_VIDEO_FRAME_FORMAT_YUY2
Definition video_frame.h:34
@ OTC_VIDEO_FRAME_FORMAT_RGBA32
Definition video_frame.h:45
@ OTC_VIDEO_FRAME_FORMAT_YUV420P
Definition video_frame.h:30
otc_video_frame * otc_video_frame_new_contiguous_memory_wrapper(enum otc_video_frame_format format, int width, int height, otc_bool is_shallow_copyable, const uint8_t *buffer, size_t size, otc_video_frame_memory_release_callback callback, void *arg)
otc_video_frame * otc_video_frame_new_I420_wrapper(int width, int height, const uint8_t *y_plane, int y_stride, const uint8_t *u_plane, int u_stride, const uint8_t *v_plane, int v_stride)
otc_video_frame * otc_video_frame_copy(const otc_video_frame *frame)
otc_status otc_video_frame_convert_inplace(enum otc_video_frame_format format, uint8_t **planes, const int *strides, const otc_video_frame *input_frame)
size_t otc_video_frame_get_number_of_planes(const otc_video_frame *frame)
otc_video_frame * otc_video_frame_new_I420_from_planes_with_format(enum otc_video_frame_format input_format, int width, int height, const uint8_t **planes, int *strides)
otc_video_frame_plane
Definition video_frame.h:55
@ OTC_VIDEO_FRAME_PLANE_PACKED
Definition video_frame.h:60
@ OTC_VIDEO_FRAME_PLANE_UV_INTERLEAVED
Definition video_frame.h:62
@ OTC_VIDEO_FRAME_PLANE_V
Definition video_frame.h:58
@ OTC_VIDEO_FRAME_PLANE_VU_INTERLEAVED
Definition video_frame.h:64
@ OTC_VIDEO_FRAME_PLANE_Y
Definition video_frame.h:56
@ OTC_VIDEO_FRAME_PLANE_U
Definition video_frame.h:57
const uint8_t * otc_video_frame_get_buffer(const otc_video_frame *frame)
const uint8_t * otc_video_frame_get_plane_binary_data(const otc_video_frame *frame, enum otc_video_frame_plane plane)
void(* otc_video_frame_memory_release_callback)(const uint8_t *buffer, void *arg)
Definition video_frame.h:121
int otc_video_frame_get_plane_stride(const otc_video_frame *frame, enum otc_video_frame_plane plane)
int otc_video_frame_get_plane_height(const otc_video_frame *frame, enum otc_video_frame_plane plane)
otc_video_frame * otc_video_frame_convert(enum otc_video_frame_format format, const otc_video_frame *frame)
otc_video_frame * otc_video_frame_mutable_copy(const otc_video_frame *frame)
void otc_video_frame_set_timestamp(otc_video_frame *frame, int64_t timestamp)
void(* video_transform_callback)(void *user_data, struct otc_video_frame *frame)
The callback that will perform the custom transformation.
Definition video_frame.h:130