Skip to content

Commit

Permalink
Deployed d835a4d with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagocoutinho committed Dec 16, 2023
1 parent 5f76127 commit f916075
Show file tree
Hide file tree
Showing 6 changed files with 403 additions and 14 deletions.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,52 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/develop/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/api/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/api/input/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/api/midi/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/api/video/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/user_guide/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/user_guide/input/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/user_guide/midi/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://tiagocoutinho.github.io/linuxpy/user_guide/video/</loc>
<lastmod>2023-12-15</lastmod>
<lastmod>2023-12-16</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
307 changes: 307 additions & 0 deletions user_guide/video.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions user_guide/video/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@

<h1 id="video">Video<a class="headerlink" href="#video" title="Permanent link">&para;</a></h1>
<p>Human friendly interface to the Video for Linux 2 (V4L2) subsystem.</p>
<p><img alt="V4L2 demo" src="../video.svg" /></p>
<p>Without further ado:</p>
<div class="termy" data-ty-macos>
<span data-ty="input" data-ty-prompt="$">python</span>
Expand Down Expand Up @@ -837,12 +838,26 @@ <h2 id="device-creation">Device creation<a class="headerlink" href="#device-crea
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&quot;/dev/video10&quot;</span><span class="p">,</span> <span class="s2">&quot;rb+&quot;</span><span class="p">,</span> <span class="n">buffering</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="k">as</span> <span class="n">fd</span><span class="p">:</span>
<span class="n">camera</span> <span class="o">=</span> <span class="n">Device</span><span class="p">(</span><span class="n">fd</span><span class="p">)</span>
</code></pre></div>
<p>Before using video <code>Device</code> object you need to open it.
<p>Before using video <code>Device</code> object you need to open it (except in the
example directly above when creating a device from a file object).
You can either use the device object as a context manager (prefered):</p>
<div class="highlight"><pre><span></span><code><span class="k">with</span> <span class="n">Device</span><span class="o">.</span><span class="n">from_id</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="k">as</span> <span class="n">camera</span><span class="p">:</span>
<span class="o">...</span>
</code></pre></div>
<p>... or manage call <code>Device.open()</code>/<code>Device.close()</code> manually:</p>
<p>The Device object is a reusable, reentrant but <strong>not</strong> thread safe context
manager. This means that Device object can not only be used in multiple with
statements, but may also be used inside a with statement that is already
using the same context manager.</p>
<p>So the following examples will work just fine:</p>
<div class="highlight"><pre><span></span><code><span class="k">with</span> <span class="n">Device</span><span class="o">.</span><span class="n">from_id</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span> <span class="k">as</span> <span class="n">camera</span><span class="p">:</span>
<span class="o">...</span>
<span class="k">with</span> <span class="n">camera</span><span class="p">:</span>
<span class="o">...</span>

<span class="k">with</span> <span class="n">camera</span><span class="p">:</span>
<span class="o">...</span>
</code></pre></div>
<p>Alternatively, you can manage calls <code>Device.open()</code>/<code>Device.close()</code> manually:</p>
<div class="highlight"><pre><span></span><code><span class="n">camera</span> <span class="o">=</span> <span class="n">Device</span><span class="o">.</span><span class="n">from_id</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
<span class="n">camera</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
<span class="k">try</span><span class="p">:</span>
Expand Down Expand Up @@ -872,7 +887,7 @@ <h2 id="capture">Capture<a class="headerlink" href="#capture" title="Permanent l
<span class="o">...</span>
</code></pre></div>
<p>Note that <code>VideoCapture</code> configuration must be done <strong>before</strong> the capture is started
(ie, the the <code>with capture:</code> statement.)</p>
(ie, the <code>with capture:</code> statement.)</p>
<p>By default, VideoCapture will use memory map if the device has STREAMING
capability and falls back to standard read if not. It is also possible to
force a specific reader:</p>
Expand Down
67 changes: 67 additions & 0 deletions user_guide/video_demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f916075

Please sign in to comment.