VideoFrame
- Flutter
更新时间不可用
视频帧的属性设置。
@JsonSerializable(explicitToJson: true, includeIfNull: false)
class VideoFrame {
const VideoFrame(
{this.type,
this.width,
this.height,
this.yStride,
this.uStride,
this.vStride,
this.yBuffer,
this.uBuffer,
this.vBuffer,
this.rotation,
this.renderTimeMs,
this.avsyncType,
this.metadataBuffer,
this.metadataSize,
this.textureId,
this.matrix,
this.alphaBuffer,
this.alphaStitchMode,
this.pixelBuffer,
this.metaInfo;
this.colorSpace});
@JsonKey(name: 'type')
final VideoPixelFormat? type;
@JsonKey(name: 'width')
final int? width;
@JsonKey(name: 'height')
final int? height;
@JsonKey(name: 'yStride')
final int? yStride;
@JsonKey(name: 'uStride')
final int? uStride;
@JsonKey(name: 'vStride')
final int? vStride;
@JsonKey(name: 'yBuffer', ignore: true)
final Uint8List? yBuffer;
@JsonKey(name: 'uBuffer', ignore: true)
final Uint8List? uBuffer;
@JsonKey(name: 'vBuffer', ignore: true)
final Uint8List? vBuffer;
@JsonKey(name: 'rotation')
final int? rotation;
@JsonKey(name: 'renderTimeMs')
final int? renderTimeMs;
@JsonKey(name: 'avsync_type')
final int? avsyncType;
@JsonKey(name: 'metadata_buffer', ignore: true)
final Uint8List? metadataBuffer;
@JsonKey(name: 'metadata_size')
final int? metadataSize;
@JsonKey(name: 'textureId')
final int? textureId;
@JsonKey(name: 'matrix')
final List<double>? matrix;
@JsonKey(name: 'alphaBuffer', ignore: true)
final Uint8List? alphaBuffer;
@JsonKey(name: 'alphaStitchMode')
final AlphaStitchMode? alphaStitchMode;
@JsonKey(name: 'pixelBuffer', ignore: true)
final Uint8List? pixelBuffer;
@VideoFrameMetaInfoConverter()
@JsonKey(name: 'metaInfo')
final VideoFrameMetaInfo? metaInfo;
@JsonKey(name: 'colorSpace')
final ColorSpace? colorSpace;
factory VideoFrame.fromJson(Map<String, dynamic> json) =>
_$VideoFrameFromJson(json);
Map<String, dynamic> toJson() => _$VideoFrameToJson(this);
}缓冲区给出的是指向指针的指针,该接口不能修改缓冲区的指针,只能修改缓冲区的内容。
属性
| 参数名 | 描述 |
|---|---|
type | 像素格式。详见 VideoPixelFormat。 |
width | |
height | |
yStride | |
uStride | |
vStride | |
yBuffer | |
uBuffer | |
vBuffer | |
rotation | |
renderTimeMs | |
avsyncType | |
metadataBuffer | |
metadataSize | |
textureId | |
matrix | |
colorSpace | 视频帧的色彩空间属性,默认情况下会应用 Full Range 和 BT.709 标准配置。你可以根据自定义采集、自定义渲染的业务需求进行自定义设置,详见 VideoColorSpace。 |
alphaBuffer | |
alphaStitchMode | 当视频帧中包含 Alpha 通道数据时,设置 |
metaInfo | 视频帧中的元信息。该参数需要联系技术支持使用。 |