Skip to content

Commit

Permalink
Multi-stream support
Browse files Browse the repository at this point in the history
  • Loading branch information
abratchik committed Jan 10, 2023
1 parent 2f19f4b commit 275fba0
Show file tree
Hide file tree
Showing 40 changed files with 742 additions and 763 deletions.
9 changes: 3 additions & 6 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ array reflects the command code while the rest of bytes can host additional para
The following commands are supported:
- 's' - starts the stream. Once the command is issued, the server will start pushing the frames to the client
according to the camera settings. The server will switch to the video mode.
- 'p' - similar to the previous command but there will be only one frame taken and pushed to the client. The
server will switch to the photo mode.
- 'u' - similar to the previous two commands. The server will either start stream or take a still photo,
depending on the current mode of the server.
- 't' - terminates the stream. Only makes sense after 's' or 'u' commands.
according to the camera settings.
- 'p' - similar to the previous command but there will be only one frame taken and pushed to the client.
- 't' - terminates the stream. Only makes sense after 's' commands.
- 'c' - tells the server that this websocket will be used for PWM control commands.
- 'w' - writes the PWM duty value to the pin. This command has additional parameters passed in the bytes of the
`command` array, as follows:
Expand Down
16 changes: 16 additions & 0 deletions Docs/html/app__config_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
<tr class="separator:a7409e001dcdfa6d62c7266224556e6a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe5fef12849f59923de575b49a6e222c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="app__config_8h.html#abe5fef12849f59923de575b49a6e222c">WIFI_WATCHDOG</a>&#160;&#160;&#160;15000</td></tr>
<tr class="separator:abe5fef12849f59923de575b49a6e222c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89c4bd6eb5b3902b7fc8f84aec7f51de"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="app__config_8h.html#a89c4bd6eb5b3902b7fc8f84aec7f51de">MAX_VIDEO_STREAMS</a>&#160;&#160;&#160;2</td></tr>
<tr class="separator:a89c4bd6eb5b3902b7fc8f84aec7f51de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3ad6cce87c9d1876247f85e3cece96e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="app__config_8h.html#af3ad6cce87c9d1876247f85e3cece96e">CAMERA_MODEL_AI_THINKER</a></td></tr>
<tr class="separator:af3ad6cce87c9d1876247f85e3cece96e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
Expand Down Expand Up @@ -128,6 +130,20 @@ <h2 class="memtitle"><span class="permalink"><a href="#af3ad6cce87c9d1876247f85e
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a89c4bd6eb5b3902b7fc8f84aec7f51de" name="a89c4bd6eb5b3902b7fc8f84aec7f51de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89c4bd6eb5b3902b7fc8f84aec7f51de">&#9670;&nbsp;</a></span>MAX_VIDEO_STREAMS</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MAX_VIDEO_STREAMS&#160;&#160;&#160;2</td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="abe5fef12849f59923de575b49a6e222c" name="abe5fef12849f59923de575b49a6e222c"></a>
Expand Down
61 changes: 30 additions & 31 deletions Docs/html/app__config_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,38 +99,37 @@
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// Uncomment to disable the notification LED on the module</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// #define LED_DISABLE</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">// Uncomment to enable MJPEG streaming support</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="comment">// This mode is still under development and is not very stable / not recommended</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment">// #define STREAM_MJPEG</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// Uncomment this line to use LittleFS instead of SD. </span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// NOTE!</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// LittleFS is still experimental, not recommended. The &#39;official&#39; library installed from the Library Manager </span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// seems to be broken, but fixed in this PR: https://github.com/lorol/LITTLEFS/pull/56 </span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// To install it, please navigate to you /libraries sub-folder of your sketch location and then execute </span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">// git clone https://github.com/Michael2MacDonald/LITTLEFS.</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">// #define USE_LittleFS</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/*</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> * Camera Hardware Selection</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment"> *</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"> * You must uncomment one, and only one, of the lines below to select your board model.</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> * Remember to also select the board in the Boards Manager</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> * This is not optional</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"> */</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="app__config_8h.html#af3ad6cce87c9d1876247f85e3cece96e"> 49</a></span><span class="preprocessor">#define CAMERA_MODEL_AI_THINKER </span><span class="comment">// default</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment">// #define CAMERA_MODEL_WROVER_KIT</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// #define CAMERA_MODEL_ESP_EYE</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">// #define CAMERA_MODEL_M5STACK_PSRAM</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">// #define CAMERA_MODEL_M5STACK_V2_PSRAM</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">// #define CAMERA_MODEL_M5STACK_WIDE</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment">// #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment">// #define CAMERA_MODEL_TTGO_T_JOURNAL</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span><span class="comment">// #define CAMERA_MODEL_ARDUCAM_ESP32S_UNO</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="comment">// Changing this parameter will increase the number of parallel video streams</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="app__config_8h.html#a89c4bd6eb5b3902b7fc8f84aec7f51de"> 30</a></span><span class="preprocessor">#define MAX_VIDEO_STREAMS 2</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment">// Uncomment this line to use LittleFS instead of SD. </span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// NOTE!</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// LittleFS is still experimental, not recommended. The &#39;official&#39; library installed from the Library Manager </span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// seems to be broken, but fixed in this PR: https://github.com/lorol/LITTLEFS/pull/56 </span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// To install it, please navigate to you /libraries sub-folder of your sketch location and then execute </span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// git clone https://github.com/Michael2MacDonald/LITTLEFS.</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">// #define USE_LittleFS</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/*</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment"> * Camera Hardware Selection</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> *</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment"> * You must uncomment one, and only one, of the lines below to select your board model.</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"> * Remember to also select the board in the Boards Manager</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> * This is not optional</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> */</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="app__config_8h.html#af3ad6cce87c9d1876247f85e3cece96e"> 48</a></span><span class="preprocessor">#define CAMERA_MODEL_AI_THINKER </span><span class="comment">// default</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment">// #define CAMERA_MODEL_WROVER_KIT</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment">// #define CAMERA_MODEL_ESP_EYE</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// #define CAMERA_MODEL_M5STACK_PSRAM</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">// #define CAMERA_MODEL_M5STACK_V2_PSRAM</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">// #define CAMERA_MODEL_M5STACK_WIDE</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">// #define CAMERA_MODEL_M5STACK_ESP32CAM // Originally: CAMERA_MODEL_M5STACK_NO_PSRAM</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment">// #define CAMERA_MODEL_TTGO_T_JOURNAL</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span><span class="comment">// #define CAMERA_MODEL_ARDUCAM_ESP32S_UNO</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
Loading

0 comments on commit 275fba0

Please sign in to comment.