動画のフレーム。 続きを読む...

#include <unistd.h> #include "base.h" #include "config.h"

マクロ
#define OTC_VIDEO_FRAME_METADATA_MAX_SIZE   32
型定義
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 *フレーム)
カスタム変換を実行するコールバック。 続きを読む...
機能
void * otc_video_frame_get_native_handle (const otc_video_frame *フレーム)
otc_video_frame * otc_video_frame_new (enum otc_video_frame_format format, int width, int height, const uint8_t *buffer)
otc_status otc_video_frame_delete (otc_video_frame *フレーム)
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)
otc_video_frame * otc_video_frame_new_MJPEG (int width, int height, const uint8_t *buffer, size_t size)
otc_video_frame * otc_video_frame_new_compressed (int width, int height, const uint8_t *buffer, size_t size)
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_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 * 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_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 *コールバック)
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)
otc_video_frame * otc_video_frame_new_NV21_ラッパー (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_NV12_ラッパー (int width, int height, const uint8_t *y_plane, int y_stride, const uint8_t *uv_plane, int uv_stride)
const uint8_t * otc_video_frame_get_buffer (const otc_video_frame *フレーム)
size_t otc_video_frame_get_buffer_size (const otc_video_frame *フレーム)
int64_t otc_video_frame_get_timestamp (const otc_video_frame *フレーム)
void otc_video_frame_set_timestamp (otc_video_frame *frame, int64_t timestamp)
イント otc_video_frame_get_width (const otc_video_frame *フレーム)
イント otc_video_frame_get_height (const otc_video_frame *フレーム)
size_t otc_video_frame_get_number_of_planes (const otc_video_frame *フレーム)
enum otc_video_frame_format otc_video_frame_get_format (const otc_video_frame *フレーム)
void otc_video_frame_set_format (otc_video_frame *フレーム、列挙型 otc_video_frame_format (形式)
const uint8_t * otc_video_frame_get_plane_binary_data (const otc_video_frame *フレーム、列挙型 otc_video_frame_plane (飛行機)
size_t otc_video_frame_get_plane_size (const otc_video_frame *フレーム、列挙型 otc_video_frame_plane (飛行機)
イント otc_video_frame_get_plane_stride (const otc_video_frame *フレーム、列挙型 otc_video_frame_plane (飛行機)
イント otc_video_frame_get_plane_width (const otc_video_frame *フレーム、列挙型 otc_video_frame_plane (飛行機)
イント otc_video_frame_get_plane_height (const otc_video_frame *フレーム、列挙型 otc_video_frame_plane (飛行機)
otc_video_frame * otc_video_frame_copy (const otc_video_frame *フレーム)
otc_video_frame * otc_video_frame_mutable_copy (const otc_video_frame *フレーム)
otc_video_frame * otc_video_frame_convert (enum otc_video_frame_format format, const otc_video_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)
otc_bool otc_video_frame_is_packed (const otc_video_frame *フレーム)
otc_bool otc_video_frame_is_contiguous (const otc_video_frame *フレーム)
otc_status otc_video_frame_set_metadata (otc_video_frame *frame, const uint8_t *data, size_t size)
const uint8_t * otc_video_frame_get_metadata (const otc_video_frame *frame, size_t *size)

詳細な説明

動画のフレーム。

このファイルには、ビデオフレームの型定義と、それらを扱う際に役立ついくつかの関数の宣言が含まれています。

マクロ定義のドキュメント

OTC_VIDEO_FRAME_METADATA_MAX_SIZE

#define OTC_VIDEO_FRAME_METADATA_MAX_SIZE 32

ビデオフレーム内のメタデータ項目を含む配列の最大サイズ。

Typedef のドキュメント

otc_video_frame

ビデオフレームの型定義。

otc_video_frame_memory_release_callback

typedef void(* otc_video_frame_memory_release_callback) (const uint8_t *buffer, void *arg)

ビデオフレームメモリ解放コールバック関数の型定義。

これは、アプリがビデオフレームを保持しているメモリを解放すべき際に呼び出されるコールバック関数への関数ポインタです。

パラメータ : | | | | --- | --- | | buffer | バッファへの関数ポインタ。 | | arg | 追加の引数へのポインタ。 |

video_transform_callback

typedef void(* video_transform_callback) (void *user_data, struct otc_video_frame *フレーム)

カスタム変換を実行するコールバック。

注: この機能は、Vonage Video API macOS SDKにのみ適用されます。Vonage Video API Linux SDKでは動作しません。

列挙型のドキュメント

otc_video_frame_format

ビデオフレームのビデオ形式の列挙。

この列挙型は、いくつかの動画フレーム形式を表しています。

調査員
OTC_VIDEO_FRAME_FORMAT_UNKNOWN 不明な動画フレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_YUV420P YUV420P ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_NV12 NV12 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_NV21 NV21 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_YUY2 YUY2 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_UYVY UYVY ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_ARGB32 ARGB32 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_BGRA32 BGRA32 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_RGB24 RGB24 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_ABGR32 ABGR32 ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_MJPEG MJPEG ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_RGBA32 RGBA ビデオフレーム形式の列挙値。
OTC_VIDEO_FRAME_FORMAT_MAX 最大値。
OTC_VIDEO_FRAME_FORMAT_COMPRESSED 圧縮ビデオフレーム形式の列挙値。

otc_video_frame_plane

ビデオフレームおよびビデオプレーンの列挙。

調査員
OTC_VIDEO_FRAME_PLANE_Y ビデオフレームのY平面の列挙値。
OTC_VIDEO_FRAME_PLANE_U ビデオフレームプレーン U の列挙値。
OTC_VIDEO_FRAME_PLANE_V ビデオフレームプレーン V の列挙値。
OTC_VIDEO_FRAME_PLANE_PACKED ビデオフレームプレーンがパックされた列挙値。
OTC_VIDEO_FRAME_PLANE_UV_INTERLEAVED ビデオフレームプレーンのUVインターリーブされた列挙値。
OTC_VIDEO_FRAME_PLANE_VU_INTERLEAVED ビデオフレームプレーン VU インターリーブ型列挙値。

関数のドキュメント

otc_video_frame_convert()

otc_video_frame * otc_video_frame_convert ( enum otc_video_frame_format フォーマット,
const otc_video_frame * フレーム
)

指定されたフレームを変換します。SDKのコールバック関数によって提供されるすべての動画フレームは、これにバインドされます。 後で使用するためにフレームを保存する場合は、そのフレームをコピーする必要があります。また、動画フレームを別の形式に変換する場合も、この関数を使用します。変換先の形式がソースと同じ場合、可能であれば浅いコピー(nバッファコピー)が行われます。

パラメータ : | | | | --- | --- | | format | 返されるビデオフレームのフォーマット。この関数は、フレームを以下のフォーマットに変換することができます: OTC_VIDEO_FRAME_FORMAT_ARGB32, OTC_VIDEO_FRAME_FORMAT_BGRA32, OTC_VIDEO_FRAME_FORMAT_ABGR32, OTC_VIDEO_FRAME_FORMAT_RGBA32 そして OTC_VIDEO_FRAME_FORMAT_YUV420P. | | フレーム | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 指定された形式のビデオフレームのコピー。エラーが発生した場合はnullになることがあります。このフレームは後で自分で破棄する必要があることに注意してください。

関連項目 : otc_video_frame_format

otc_video_frame_convert_inplace()

otc_status otc_video_frame_convert_inplace ( enum otc_video_frame_format フォーマット,
uint8_t ** 飛行機,
const int * 大股,
const otc_video_frame * 入力フレーム
)

指定されたフレームをその場で変換します。これにより、入力フレームのデータが変更されます。

パラメータ : | | | | --- | --- | | format | ビデオフレームのフォーマット。この関数は、フレームを以下のフォーマットに変換できます: OTC_VIDEO_FRAME_FORMAT_ARGB32, OTC_VIDEO_FRAME_FORMAT_BGRA32, OTC_VIDEO_FRAME_FORMAT_ABGR32そして OTC_VIDEO_FRAME_FORMAT_YUV420P. | | input_frame | ビデオフレームのインスタンスへのポインタ。 | | planes | ビデオフレームのプレーンへのポインタへのポインタ。 | | strides | ビデオフレームのストライドへのポインタへのポインタ。 |

戻り値 : エラーか成功のいずれかを示す戻り値。

関連項目 : otc_エラーコード : otc_video_frame_format

otc_video_frame_copy()

otc_video_frame * otc_video_frame_copy ( const otc_video_frame * フレーム )

指定されたビデオフレームをコピーします。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 新しいビデオフレームインスタンスへのポインタ。

otc_video_frame_delete()

otc_status otc_video_frame_delete ( otc_video_frame * フレーム )

このフレームに関連する無料のリソース。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : エラーか成功かを示す戻り値。

関連項目 : otc_エラーコード

otc_video_frame_get_buffer()

const uint8_t * otc_video_frame_get_buffer ( const otc_video_frame * フレーム )

ビデオフレームデータが格納されたバッファへのポインタを取得します。

パラメータ : | | | | --- | --- | | frame | バッファを取得するビデオフレームインスタンスへのポインタ。 |

戻り値 : ビデオフレームデータを含むバッファへのポインタ。

otc_video_frame_get_buffer_size()

size_t otc_video_frame_get_buffer_size ( const otc_video_frame * フレーム )

ビデオフレームデータを含むバッファのサイズを取得します。

パラメータ : | | | | --- | --- | | frame | バッファサイズを取得するビデオフレームインスタンスへのポインタ。 |

戻り値 : ビデオフレームデータを格納するバッファのサイズ。

otc_video_frame_get_format()

enum otc_video_frame_format otc_video_frame_get_format ( const otc_video_frame * フレーム )

動画フレームの動画形式を取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : ビデオフレームのフォーマット。

関連項目 : otc_video_frame_format

otc_video_frame_get_height()

int otc_video_frame_get_height ( const otc_video_frame * フレーム )

動画フレームの高さをピクセル単位で取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 指定されたフレームの高さ(ピクセル単位)。

otc_video_frame_get_metadata()

const uint8_t * otc_video_frame_get_metadata ( const otc_video_frame * フレーム,
size_t * サイズ
)

動画フレームに関連付けられたメタデータを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | size | このフレームに関連付けられたメタデータバッファのサイズ。 |

戻り値 : ビデオフレーム内の内部メタデータバッファへのポインタ、または関連付けられたメタデータがない場合はNULLポインタ。このポインタは、フレームが破棄された後に無効になります。

otc_video_frame_get_number_of_planes()

size_t otc_video_frame_get_number_of_planes ( const otc_video_frame * フレーム )

ビデオフレームのプレーン数を取得します。通常、YUVフレームの場合は3、RGBA/BGRAフレームの場合は1が返されます。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 飛行機の数。

otc_video_frame_get_plane_binary_data()

const uint8_t * otc_video_frame_get_plane_binary_data ( const otc_video_frame * フレーム,
enum otc_video_frame_plane 飛行機
)

ビデオフレームのいずれかのプレーンからバイナリデータを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | plane | データを取得するビデオプレーン。 |

戻り値 : 平面データが格納されたバッファへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_get_plane_height()

int otc_video_frame_get_plane_height ( const otc_video_frame * フレーム,
enum otc_video_frame_plane 飛行機
)

ビデオフレーム内の平面の高さを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | plane | 高さを取得するビデオプレーン。 |

戻り値 : 高さ。

otc_video_frame_get_plane_size()

size_t otc_video_frame_get_plane_size ( const otc_video_frame * フレーム,
enum otc_video_frame_plane 飛行機
)

ビデオフレーム内の平面のサイズを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | plane | サイズを取得するビデオプレーン。 |

戻り値 : 平面のサイズ。

otc_video_frame_get_plane_stride()

int otc_video_frame_get_plane_stride ( const otc_video_frame * フレーム,
enum otc_video_frame_plane 飛行機
)

ビデオフレーム内の指定された平面から、その平面のストライドを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | plane | ストライドを取得するビデオプレーン。 |

戻り値 : Stride。

otc_video_frame_get_plane_width()

int otc_video_frame_get_plane_width ( const otc_video_frame * フレーム,
enum otc_video_frame_plane 飛行機
)

ビデオフレーム内の平面の幅を取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | plane | 幅を取得するビデオプレーン。 |

返品 : あり。

otc_video_frame_get_timestamp()

int64_t otc_video_frame_get_timestamp ( const otc_video_frame * フレーム )

エポックタイムからの経過時間(ミリ秒単位)として、動画フレームのタイムスタンプを取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : ビデオフレームのタイムスタンプ。

otc_video_frame_get_width()

int otc_video_frame_get_width ( const otc_video_frame * フレーム )

動画フレームの幅をピクセル単位で取得します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 指定されたフレームの幅(ピクセル単位)。

otc_video_frame_is_contiguous()

otc_bool otc_video_frame_is_contiguous ( const otc_video_frame * フレーム )

動画フレームが連続しているかどうかを確認します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 結果を表すブール値。

otc_video_frame_is_packed()

otc_bool otc_video_frame_is_packed ( const otc_video_frame * フレーム )

動画フレームがパックされているかどうかを確認します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 結果を表すブール値。

otc_video_frame_mutable_copy()

otc_video_frame * otc_video_frame_mutable_copy ( const otc_video_frame * フレーム )

指定されたビデオフレームの変更可能なコピーを作成します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 |

戻り値 : 新しいビデオフレームインスタンスへのポインタ。

otc_video_frame_new()

otc_video_frame * otc_video_frame_new ( enum otc_video_frame_format フォーマット,
イント ,
イント 高さ,
const uint8_t * バッファ
)

指定されたフォーマットで新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | format | 希望するフォーマット。 | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | buffer | 動画フレームデータを含むバッファへのポインタ。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_compressed()

otc_video_frame * otc_video_frame_new_compressed ( イント ,
イント 高さ,
const uint8_t * バッファ,
size_t サイズ
)

新しい圧縮済みビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | buffer | 動画フレームデータを含むバッファへのポインタ。 | | size | メモリ上の動画フレームサイズ。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_contiguous_memory_wrapper()

otc_video_frame * otc_video_frame_new_contiguous_memory_wrapper ( enum otc_video_frame_format フォーマット,
イント ,
イント 高さ,
otc_bool is_shallow_copyable,
const uint8_t * バッファ,
size_t サイズ,
otc_video_frame_memory_release_callback コールバック,
void * arg
)

連続したメモリバッファ内のデータから、新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | format | 渡されるビデオフレームのフォーマット。 | | width | ビデオの幅(ピクセル単位)。 | | height | ビデオの高さ(ピクセル単位)。 | | is_shallow_copyable | フレームの浅いコピーを作成できるかどうか。 | | buffer | フレームデータを含むバッファへのポインタ。 | | size | フレームデータのサイズ。 | | callback | ビデオフレームのメモリ解放コールバック関数。 | | arg | 追加の引数へのポインタ。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_from_planes()

otc_video_frame * otc_video_frame_new_from_planes ( enum otc_video_frame_format フォーマット,
イント ,
イント 高さ,
const uint8_t ** 飛行機,
int * 大股
)

指定されたフォーマットを持つ新しいビデオフレームを、その各プレーンから作成します。

パラメータ : | | | | --- | --- | | format | 希望するフォーマット。 | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | planes | 動画フレームのプレーンを格納するバッファへのポインタへのポインタ。 | | strides | ストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_I420()

otc_video_frame * otc_video_frame_new_I420 ( イント ,
イント 高さ,
const uint8_t * y_plane,
イント y_stride,
const uint8_t * u_plane,
イント u_stride,
const uint8_t * v_plane,
イント v_stride
)

I420 形式の新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | y_plane | Y平面のデータを含むバッファへのポインタ。 | | y_stride | Yストライド。 | | u_plane | Uプレーンデータを含むバッファへのポインタ。 | | u_stride | Uストライド。 | | v_plane | Vプレーンデータを含むバッファへのポインタ。 | | v_stride | Vストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_I420_from_planes_with_format()

otc_video_frame * otc_video_frame_new_I420_from_planes_with_format ( enum otc_video_frame_format 入力形式,
イント ,
イント 高さ,
const uint8_t ** 飛行機,
int * 大股
)

プレーンのリストから、I420形式の新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | input_format | 入力として渡される動画フレームのフォーマット。 | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | planes | 動画フレームのプレーンを格納するバッファへのポインタへのポインタ。 | | strides | ストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_I420_wrapper()

otc_video_frame * otc_video_frame_new_I420_wrapper ( イント ,
イント 高さ,
const uint8_t * y_plane,
イント y_stride,
const uint8_t * u_plane,
イント u_stride,
const uint8_t * v_plane,
イント v_stride
)

YUVデータから、I420形式の新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | y_plane | Y平面へのポインタ。 | | y_stride | Y方向のストライド。 | | u_plane | U平面へのポインタ。 | | u_stride | U方向のストライド。 | | v_plane | V平面へのポインタ。 | | v_stride | V方向のストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_MJPEG()

otc_video_frame * otc_video_frame_new_MJPEG ( イント ,
イント 高さ,
const uint8_t * バッファ,
size_t サイズ
)

MJPEG形式の新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | buffer | 動画フレームデータを含むバッファへのポインタ。 | | size | メモリ上の動画フレームサイズ。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_NV12_wrapper()

otc_video_frame * otc_video_frame_new_NV12_wrapper ( イント ,
イント 高さ,
const uint8_t * y_plane,
イント y_stride,
const uint8_t * uv_plane,
イント uv_stride
)

NV12ラッパーを使用した新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | y_plane | Y平面へのポインタ。 | | y_stride | Y方向のストライド。 | | uv_plane | UV平面へのポインタ。 | | uv_stride | UV方向のストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_NV21_wrapper()

otc_video_frame * otc_video_frame_new_NV21_wrapper ( イント ,
イント 高さ,
const uint8_t * y_plane,
イント y_stride,
const uint8_t * uv_plane,
イント uv_stride
)

NV21ラッパーを使用した新しいビデオフレームを作成します。

パラメータ : | | | | --- | --- | | width | 動画の幅(ピクセル単位)。 | | height | 動画の高さ(ピクセル単位)。 | | y_plane | Y平面へのポインタ。 | | y_stride | Y方向のストライド。 | | uv_plane | UV平面へのポインタ。 | | uv_stride | UV方向のストライド。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_new_planar_memory_wrapper()

otc_video_frame * otc_video_frame_new_planar_memory_wrapper ( enum otc_video_frame_format フォーマット,
イント ,
イント 高さ,
otc_bool is_shallow_copyable,
struct otc_video_frame_planar_memory_callbacks * コールバック
)

平面メモリラッパーから新しいビデオフレームを作成します。この otc_video_frame_planar_memory_callbacks 引数として渡されるstructは、ビデオフレームおよびストライドデータが要求された際に呼び出されるコールバック関数を定義しています。

パラメータ : | | | | --- | --- | | format | 渡されるビデオフレームのフォーマット。 | | width | ビデオの幅(ピクセル単位)。 | | height | ビデオの高さ(ピクセル単位)。 | | is_shallow_copyable | フレームの浅いコピーを作成できるかどうか。 | | callbacks | 動画フレームのコールバック関数を含む構造体へのポインタ。 |

戻り値 : ビデオフレームインスタンスへのポインタ。エラーが発生した場合は、null になることがあります。

otc_video_frame_set_format()

void otc_video_frame_set_format ( otc_video_frame * フレーム,
enum otc_video_frame_format フォーマット
)

ビデオフレームのビデオ形式を設定します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | format | ビデオフレームのフォーマット。 |

関連項目 : otc_video_frame_format

otc_video_frame_set_metadata()

otc_status otc_video_frame_set_metadata ( otc_video_frame * フレーム,
const uint8_t * データ,
size_t サイズ
)

動画フレームに関連付けられたメタデータを設定します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | data | フレームにコピーされるメタデータバッファへのポインタ。 | | size | コピーされるメタデータバッファのサイズ。 |

戻り値 : エラーか成功のいずれかを示す戻り値。

関連項目 : otc_エラーコード

otc_video_frame_set_timestamp()

void otc_video_frame_set_timestamp ( otc_video_frame * フレーム,
int64_t タイムスタンプ
)

ビデオフレームのタイムスタンプを、エポックタイムからの経過時間(ミリ秒単位)として設定します。

パラメータ : | | | | --- | --- | | frame | ビデオフレームインスタンスへのポインタ。 | | timestamp | タイムスタンプの値。 |