1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[]
= "g2g-python"
= "Host gst-python-ml elements as first-class glass2glass elements (embedded CPython via pyo3)."
= true
= "README.md"
= ["multimedia", "python", "pyo3", "inference", "video"]
= ["multimedia", "api-bindings"]
= true
= true
= true
= true
= true
[]
= ["std"]
# `runtime` pulls the async runner + `spin` (g2g-core's `log` module needs it);
# hosting an element in a graph wants it anyway.
= ["g2g-core/std", "g2g-core/runtime"]
# Embed CPython and host gst-python-ml element shells in-process via pyo3
# (DESIGN.md, the Python-element track). OS-coupled: needs libpython at build
# and run time, so it is off the no_std / RTOS baseline and implies std. The
# default build negotiates caps but cannot run frames (the per-frame Python
# call lives behind this feature).
= ["std", "dep:pyo3"]
# Route the hosted element's detections into the frame's typed metadata graph.
# A `g2g.MetaSink` passed to `g2g_process` collects add_object / add_classification
# calls (the `AnalyticsBackend` mirror); the host materializes them into
# `Frame::meta` as an `AnalyticsMeta`. Pulls g2g-core's `metadata` feature (so
# `FrameMetaSet` is the real typed container, not the ZST) and implies `python`.
= ["python", "g2g-core/metadata"]
# Build the `g2g-launch-py` binary: a `gst-launch` analog that registers the
# g2g-plugins elements PLUS the hosted Python elements (`pyelement` / `pysrc` /
# `pyaggregator`), so a single text pipeline can run a gst-python-ml detector ->
# `analyticsoverlay` -> `autovideosink` end to end in pure g2g. Pulls g2g-plugins
# (a normal, no longer dev-only edge; g2g-plugins still does not depend on us, so
# it stays acyclic) with the host Linux media features, plus a tokio runtime.
= [
"analytics",
"dep:tokio",
"dep:g2g-plugins",
"g2g-plugins/ffmpeg",
"g2g-plugins/v4l2",
"g2g-plugins/wayland-sink",
"g2g-plugins/analytics",
# Audio capture and playback: a gst-python-ml transcribe / separate / TTS
# line starts at a microphone or ends at a speaker.
"g2g-plugins/pulse-src",
"g2g-plugins/pulse-sink",
]
# Also register the native Rust inference elements (`ortinfer` /
# `detectionpostprocess` / ...) in `g2g-launch-py`, so one launch line can run a
# detector with no Python in it at all. It lands here rather than in `g2g-launch`
# because g2g-ml already depends on g2g-plugins, so g2g-plugins cannot depend
# back on g2g-ml; this crate can depend on both.
= ["launch", "dep:g2g-ml", "g2g-ml/launch", "g2g-ml/ort", "g2g-ml/analytics"]
# `ortinfer execution-provider=cuda` on top of `ml`. Separate because it pulls
# the CUDA execution provider and its runtime libraries, which a machine without
# an NVIDIA GPU should not have to build or ship.
= ["ml", "g2g-ml/cuda"]
[[]]
= "g2g-launch-py"
= ["launch"]
[]
= { = true }
# Embedded CPython bridge (python feature). `auto-initialize` starts the
# interpreter on first GIL acquisition. 0.26+ supports CPython 3.14 (the Fedora
# 43 system Python). Zero-copy frame access uses the Python buffer protocol, so
# the host hands Python a writable buffer and Python's own numpy consumes it via
# `np.frombuffer`, no Rust-side numpy crate needed.
= { = "0.26", = true, = ["auto-initialize"] }
# The `launch` feature only (the `g2g-launch-py` binary). g2g-plugins supplies
# `default_registry` + `WallClock`; tokio drives the run loop. Both optional so
# the library / host build keeps its lean dependency set.
= { = "1", = ["rt", "macros", "time"], = true }
= { = true, = true }
# The `ml` feature only: the native inference elements registered alongside the
# hosted Python ones.
= { = true, = true }
[]
= { = "1", = ["rt", "macros"] }
# `default_registry` + the videotestsrc / videoconvert / fakesink elements the
# `pyelement` launch-registry test parses a pipeline around. g2g-plugins does not
# depend on g2g-python, so this dev-only edge is acyclic (same pattern as g2g-ml).
= { = true, = ["std"] }
[]
= true
# Default features only: `python` embeds CPython (libpython at build time) and
# `launch` pulls the host media features (ffmpeg, V4L2, Wayland).
[]
= ["std"]