Skip to content

Commit 275fba0

Browse files
committed
Multi-stream support
1 parent 2f19f4b commit 275fba0

40 files changed

+742
-763
lines changed

API.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,9 @@ array reflects the command code while the rest of bytes can host additional para
164164
The following commands are supported:
165165
166166
- 's' - starts the stream. Once the command is issued, the server will start pushing the frames to the client
167-
according to the camera settings. The server will switch to the video mode.
168-
- 'p' - similar to the previous command but there will be only one frame taken and pushed to the client. The
169-
server will switch to the photo mode.
170-
- 'u' - similar to the previous two commands. The server will either start stream or take a still photo,
171-
depending on the current mode of the server.
172-
- 't' - terminates the stream. Only makes sense after 's' or 'u' commands.
167+
according to the camera settings.
168+
- 'p' - similar to the previous command but there will be only one frame taken and pushed to the client.
169+
- 't' - terminates the stream. Only makes sense after 's' commands.
173170
- 'c' - tells the server that this websocket will be used for PWM control commands.
174171
- 'w' - writes the PWM duty value to the pin. This command has additional parameters passed in the bytes of the
175172
`command` array, as follows:

Docs/html/app__config_8h.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
<tr class="separator:a7409e001dcdfa6d62c7266224556e6a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
8585
<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>
8686
<tr class="separator:abe5fef12849f59923de575b49a6e222c"><td class="memSeparator" colspan="2">&#160;</td></tr>
87+
<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>
88+
<tr class="separator:a89c4bd6eb5b3902b7fc8f84aec7f51de"><td class="memSeparator" colspan="2">&#160;</td></tr>
8789
<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>
8890
<tr class="separator:af3ad6cce87c9d1876247f85e3cece96e"><td class="memSeparator" colspan="2">&#160;</td></tr>
8991
</table>
@@ -128,6 +130,20 @@ <h2 class="memtitle"><span class="permalink"><a href="#af3ad6cce87c9d1876247f85e
128130
</table>
129131
</div><div class="memdoc">
130132

133+
</div>
134+
</div>
135+
<a id="a89c4bd6eb5b3902b7fc8f84aec7f51de" name="a89c4bd6eb5b3902b7fc8f84aec7f51de"></a>
136+
<h2 class="memtitle"><span class="permalink"><a href="#a89c4bd6eb5b3902b7fc8f84aec7f51de">&#9670;&nbsp;</a></span>MAX_VIDEO_STREAMS</h2>
137+
138+
<div class="memitem">
139+
<div class="memproto">
140+
<table class="memname">
141+
<tr>
142+
<td class="memname">#define MAX_VIDEO_STREAMS&#160;&#160;&#160;2</td>
143+
</tr>
144+
</table>
145+
</div><div class="memdoc">
146+
131147
</div>
132148
</div>
133149
<a id="abe5fef12849f59923de575b49a6e222c" name="abe5fef12849f59923de575b49a6e222c"></a>

Docs/html/app__config_8h_source.html

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -99,38 +99,37 @@
9999
<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>
100100
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment">// #define LED_DISABLE</span></div>
101101
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
102-
<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>
103-
<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>
104-
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="comment">// #define STREAM_MJPEG</span></div>
105-
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
106-
<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>
107-
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// NOTE!</span></div>
108-
<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>
109-
<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>
110-
<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>
111-
<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>
112-
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> </div>
113-
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span><span class="comment">// #define USE_LittleFS</span></div>
114-
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
115-
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment">/*</span></div>
116-
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> * Camera Hardware Selection</span></div>
117-
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span><span class="comment"> *</span></div>
118-
<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>
119-
<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>
120-
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> * This is not optional</span></div>
121-
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span><span class="comment"> */</span></div>
122-
<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>
123-
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment">// #define CAMERA_MODEL_WROVER_KIT</span></div>
124-
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// #define CAMERA_MODEL_ESP_EYE</span></div>
125-
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span><span class="comment">// #define CAMERA_MODEL_M5STACK_PSRAM</span></div>
126-
<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>
127-
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment">// #define CAMERA_MODEL_M5STACK_WIDE</span></div>
128-
<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>
129-
<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>
130-
<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>
102+
<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>
103+
<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>
104+
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
105+
<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>
106+
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// NOTE!</span></div>
107+
<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>
108+
<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>
109+
<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>
110+
<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>
111+
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
112+
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment">// #define USE_LittleFS</span></div>
113+
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
114+
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span><span class="comment">/*</span></div>
115+
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span><span class="comment"> * Camera Hardware Selection</span></div>
116+
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> *</span></div>
117+
<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>
118+
<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>
119+
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> * This is not optional</span></div>
120+
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span><span class="comment"> */</span></div>
121+
<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>
122+
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span><span class="comment">// #define CAMERA_MODEL_WROVER_KIT</span></div>
123+
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span><span class="comment">// #define CAMERA_MODEL_ESP_EYE</span></div>
124+
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span><span class="comment">// #define CAMERA_MODEL_M5STACK_PSRAM</span></div>
125+
<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>
126+
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span><span class="comment">// #define CAMERA_MODEL_M5STACK_WIDE</span></div>
127+
<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>
128+
<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>
129+
<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>
130+
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
131131
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
132-
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
133-
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="preprocessor">#endif</span></div>
132+
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span><span class="preprocessor">#endif</span></div>
134133
</div><!-- fragment --></div><!-- contents -->
135134
<!-- start footer part -->
136135
<hr class="footer"/><address class="footer"><small>

0 commit comments

Comments
 (0)