Skip to content

Commit 2f79a4a

Browse files
committed
page: add custom plugin section
1 parent cdb2e28 commit 2f79a4a

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

docs/index.html

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@
887887
<li><a href="#features">Features</a></li>
888888
<li><a href="#pipelines">Pipelines</a></li>
889889
<li><a href="#install">Install</a></li>
890+
<li><a href="#custom-plugins">Extend</a></li>
890891
<li><a href="https://github.com/collabora/gst-python-ml" class="nav-btn-ghost">GitHub</a></li>
891892
<li><a href="#install" class="nav-btn-green">Get Started</a></li>
892893
</ul>
@@ -941,7 +942,7 @@ <h3>12</h3>
941942
<p>ML Engines</p>
942943
</div>
943944
<div class="stat-cell">
944-
<h3>35+</h3>
945+
<h3>39</h3>
945946
<p>GStreamer Elements</p>
946947
</div>
947948
<div class="stat-cell">
@@ -1669,6 +1670,57 @@ <h2 class="section-title">Up and Running in Minutes</h2>
16691670
</div>
16701671
</section>
16711672

1673+
<!-- ═══ CUSTOM PLUGINS ═══ -->
1674+
<section id="custom-plugins">
1675+
<div class="section-inner">
1676+
<span class="section-label">Extensibility</span>
1677+
<h2 class="section-title">Build Your Own Plugins</h2>
1678+
<p class="section-desc">Create custom GStreamer elements that inherit from gst-python-ml base classes. Full access to the engine abstraction, model loading, and pipeline integration.</p>
1679+
1680+
<div class="code-block fade-in" style="margin-top: 40px;">
1681+
<div class="code-header">
1682+
<span>my_plugins/python/my_detector.py</span>
1683+
</div>
1684+
<pre><span class="kw">from</span> base_objectdetector <span class="kw">import</span> BaseObjectDetector
1685+
<span class="kw">from</span> gi.repository <span class="kw">import</span> GObject, Gst
1686+
1687+
<span class="kw">class</span> <span class="str">MyDetector</span>(BaseObjectDetector):
1688+
__gstmetadata__ = (
1689+
<span class="str">"My Custom Detector"</span>, <span class="str">"Video/Filter"</span>,
1690+
<span class="str">"A custom object detector"</span>, <span class="str">"Your Name"</span>,
1691+
)
1692+
1693+
GObject.type_register(MyDetector)
1694+
__gstelementfactory__ = (<span class="str">"my_detector"</span>, Gst.Rank.NONE, MyDetector)</pre>
1695+
</div>
1696+
1697+
<div class="code-block fade-in" style="margin-top: 24px;">
1698+
<div class="code-header">
1699+
<span>Environment Setup</span>
1700+
</div>
1701+
<pre><span class="cmt"># Framework first (provides base classes on sys.path), custom second</span>
1702+
<span class="kw">export</span> GST_PLUGIN_PATH=<span class="str">$HOME/src/gst-python-ml/plugins:$HOME/my_plugins:$GST_PLUGIN_PATH</span>
1703+
<span class="kw">export</span> PYTHONPATH=<span class="str">$HOME/my_plugins/python:$PYTHONPATH</span>
1704+
1705+
<span class="cmt"># Verify your element</span>
1706+
gst-inspect-1.0 my_detector</pre>
1707+
</div>
1708+
1709+
<div class="pipeline-grid fade-in" style="margin-top: 40px;">
1710+
<div class="pipeline-card">
1711+
<span class="pipe-tag">Base Classes</span>
1712+
<h3>Available for Inheritance</h3>
1713+
<p><code>BaseObjectDetector</code> &middot; <code>BaseTransform</code> &middot; <code>BaseClassifier</code> &middot; <code>BaseCaption</code> &middot; <code>BaseLLM</code> &middot; <code>BaseTranscribe</code> &middot; <code>BaseTranslate</code> &middot; <code>BaseTTS</code> &middot; <code>BaseSeparate</code></p>
1714+
</div>
1715+
<div class="pipeline-card">
1716+
<span class="pipe-tag">Inherited Features</span>
1717+
<h3>Zero Boilerplate</h3>
1718+
<p>Engine selection &middot; model loading &middot; device management &middot; buffer handling &middot; metadata propagation &middot; all GObject properties</p>
1719+
</div>
1720+
</div>
1721+
</div>
1722+
</section>
1723+
16721724
<!-- ═══ DEPLOYMENT ═══ -->
16731725
<section id="deploy">
16741726
<div class="section-inner">

0 commit comments

Comments
 (0)