Skip to content

Commit

Permalink
Adding a small footprint mDNS responder service
Browse files Browse the repository at this point in the history
  • Loading branch information
wberube committed Aug 5, 2024
1 parent 2affde1 commit 2bff5bc
Show file tree
Hide file tree
Showing 9 changed files with 2,144 additions and 32 deletions.
13 changes: 3 additions & 10 deletions divinus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ isp:
osd:
enable: true

mdns:
enable: false

night_mode:
enable: false
ir_sensor_pin: 62
Expand All @@ -28,16 +31,6 @@ night_mode:
adc_device: /dev/sar_adc_drv
adc_threshold: 128

record:
enable: false
path: /sdcard/records
file_duration: 10
width: 3840
height: 2160
fps: 20
bitrate: 1024
profile: 2

http_post:
enable: false
host: <your host>
Expand Down
38 changes: 35 additions & 3 deletions src/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The following software is included in this product under src/lib: @tomolt/libschrift.
A copy of the original source code may be downloaded from git+https://github.com/tomolt/libschrift.
It contains the following license and notice below:
It is accompanied by the following license and notice below:

ISC License

Expand All @@ -20,9 +20,41 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---

The forked tinysvcmdns component from @mikebrady/shairport-sync is included under src/lib.
A copy of the original source code may be downloaded from git+https://github.com/mikebrady/shairport-sync.
It is accompanied by the following license and notice:

tinysvcmdns - a tiny MDNS implementation for publishing services
Copyright (C) 2011 Darell Tan
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

---

The following software is included in this product under src/rtsp: @ykst/librtsp.
A copy of the original source code may be downloaded from git+https://github.com/ykst/librtsp.
It contains the following license and notice below:
It is accompanied by the following license and notice below:

Copyright (c) 2014 Yohsuke YUKISHITA, https://github.com/ykst

Expand All @@ -49,7 +81,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The following software is included in this product under lib/shine: @toots/shine.
A copy of the original source code may be downloaded from git+https://github.com/toots/shine
It contains the following license and notice below:
It is accompanied by following license and notice below:

GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Expand Down
4 changes: 3 additions & 1 deletion src/app_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ enum ConfigError parse_app_config(void) {
app_config.web_server_thread_stack_size = 32 * 1024;
app_config.watchdog = 0;

app_config.motion_detect_enable = false;
app_config.osd_enable = false;
app_config.rtsp_enable = false;
app_config.mdns_enable = false;

app_config.sensor_config[0] = 0;
app_config.audio_enable = false;
Expand Down Expand Up @@ -136,6 +136,8 @@ enum ConfigError parse_app_config(void) {
if (err != CONFIG_OK)
goto RET_ERR;

parse_bool(&ini, "mdns", "enable", &app_config.mdns_enable);

parse_bool(&ini, "audio", "enable", &app_config.audio_enable);
if (app_config.audio_enable) {
parse_int(&ini, "audio", "bitrate", 32, 320, &app_config.audio_bitrate);
Expand Down
36 changes: 18 additions & 18 deletions src/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,31 @@ struct AppConfig {
unsigned int web_server_thread_stack_size;
unsigned int watchdog;

bool motion_detect_enable;
// [night_mode]
bool night_mode_enable;
unsigned int ir_cut_pin1;
unsigned int ir_cut_pin2;
unsigned int ir_sensor_pin;
unsigned int check_interval_s;
unsigned int pin_switch_delay_us;
char adc_device[128];
int adc_threshold;

// [isp]
bool mirror;
bool flip;
int antiflicker;

bool osd_enable;
bool rtsp_enable;
bool mdns_enable;

// [audio]
bool audio_enable;
unsigned int audio_bitrate;
unsigned int audio_srate;

// [video_0]
// [mp4]
bool mp4_enable;
bool mp4_codecH265;
unsigned int mp4_mode;
Expand All @@ -49,7 +64,7 @@ struct AppConfig {
unsigned int mjpeg_height;
unsigned int mjpeg_bitrate;

// [http_post_jpeg]
// [http_post]
bool http_post_enable;
char http_post_host[128];
char http_post_url[128];
Expand All @@ -59,21 +74,6 @@ struct AppConfig {
unsigned int http_post_height;
unsigned int http_post_qfactor;
unsigned int http_post_interval;

// [isp]
bool mirror;
bool flip;
int antiflicker;

// [night_mode]
bool night_mode_enable;
unsigned int ir_cut_pin1;
unsigned int ir_cut_pin2;
unsigned int ir_sensor_pin;
unsigned int check_interval_s;
unsigned int pin_switch_delay_us;
char adc_device[128];
int adc_threshold;
};

extern struct AppConfig app_config;
Expand Down
Loading

0 comments on commit 2bff5bc

Please sign in to comment.