FrameSource class sealed
Sealed: every frame handed to an encoder is one of the variants below.
Use the named factories — never extend this class outside the package.
Constructors
-
FrameSource.cpu({required Uint8List bytes, required MiniAVPixelFormat pixelFormat, required int width, required int height, List<
int> ? strideBytes, int timestampUs}) -
CPU bytes (always supported, may incur upload to GPU encoder).
factory
- FrameSource.cvPixelBuffer({required int cvPixelBufferPtr, required int width, required int height, required MiniAVPixelFormat pixelFormat, int timestampUs})
-
Raw CVPixelBuffer (macOS / iOS escape hatch).
factory
- FrameSource.d3d11Texture({required int texturePtr, required int width, required int height, required MiniAVPixelFormat pixelFormat, int subresourceIndex, MiniAVNativeFence fence, int timestampUs})
-
Raw D3D11 texture pointer (Windows escape hatch).
factory
-
FrameSource.dmabuf({required List<
int> fds, required List<int> strides, required List<int> offsets, required int modifier, required int width, required int height, required MiniAVPixelFormat pixelFormat, int timestampUs}) -
Raw Linux dmabuf (escape hatch).
factory
- FrameSource.gpuTexture({required Object platformVideoTexture, required int width, required int height, required ExternalPixelFormat externalPixelFormat, int timestampUs})
-
A minigpu video texture (e.g. from
gpu.importVideoFrame).factory - FrameSource.miniavBuffer(MiniAVBuffer buffer)
-
A miniav-produced buffer — backend extracts native handle for zero-copy
when possible.
factory
- FrameSource.webVideoFrame({required Object videoFrame, required int width, required int height, required MiniAVPixelFormat pixelFormat, int timestampUs})
-
A browser WebCodecs
VideoFrame— zero-copy path intoVideoEncoder.factory - FrameSource.yuv420p({required Uint8List yPlane, required Uint8List uPlane, required Uint8List vPlane, required int width, required int height, int timestampUs})
-
Pre-converted planar YUV420P (I420): a full-resolution
yPlaneplus 2×2-subsampleduPlane/vPlane. Lets a GPU color-conversion step feed planes straight to a YUV420P encoder with no further conversion. Each plane must be tightly packed (Y: widthheight, U/V: (width/2)(height/2)).factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
Frame height in pixels.
no setter
- kind → FrameSourceKind
-
What kind this is, for backend capability checks.
no setter
- pixelFormat → MiniAVPixelFormat
-
Pixel format. Backends may need to perform color-space conversion.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timestampUs → int
-
Presentation timestamp in microseconds. May be 0 if unknown.
no setter
- width → int
-
Frame width in pixels.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited