Expand description
The shared pixel-format contract between g2g and the gst-python-ml backend.
gst-python-ml’s tasks/frame_format.py and its FrameIO.read_frame(s)
speak GStreamer-style format strings ("RGBA", "NV12", …). g2g speaks
RawVideoFormat. Caps negotiation (which format the link carries) and the
per-frame call (which fmt string Python is handed) must agree, so the
mapping lives in one place here rather than being re-derived on each side.
Only the formats g2g currently models are mapped; an unmapped string from the Python side is a negotiation error, not a silent guess.
Functions§
- format_
from_ py - Parse a gst-python-ml format string back into a g2g
RawVideoFormat. ReturnsNonefor a format g2g does not model.YUYVis accepted as an alias forYUY2(V4L2 vs GStreamer spelling of the same packed 4:2:2). - format_
to_ py - The GStreamer-style format string for a g2g raw-video format, as the
gst-python-ml
FrameIO/frame_formatcode expects it. - frame_
bytes - Bytes one
widthxheightframe offmtoccupies, for allocating a blank source buffer. Packed formats are exact; the fully-planar YUV family derives its size from the format’s own subsampling and sample depth.