From d682a1c1739105c26a077fecb776e661a9eab15d Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Mon, 28 Sep 2020 13:54:38 +0300 Subject: [PATCH] added info about mjpg-streamer compat and prettify --- README.md | 1 + README.ru.md | 1 + linters/Dockerfile | 3 +++ linters/tox.ini | 6 +++++- src/http/data/index.html | 39 ++++++++++++++++++++++++-------------- src/http/data/index_html.h | 39 ++++++++++++++++++++++++-------------- 6 files changed, 60 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index eb004f2..f8dae2a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ | Option to serve files
with a built-in HTTP server | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Yes | ![#ffaa00](https://placehold.it/15/ffaa00/000000?text=+) Regular files only | | Signaling about the stream state
on GPIO using [libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about) | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Yes | ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) No | | Access to webcam controls (focus, servos)
and settings such as brightness via HTTP | ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) No | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Yes | +| Compatibility with mjpg-streamer's API | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Yes | :) | Footnotes: * ```1``` Long before µStreamer, I made a [patch](https://github.com/jacksonliam/mjpg-streamer/pull/164) to add DV-timings support to mjpg-streamer and to keep it from hanging up no device disconnection. Alas, the patch is far from perfect and I can't guarantee it will work every time - mjpg-streamer's source code is very complicated and its structure is hard to understand. With this in mind, along with needing multithreading and JPEG hardware acceleration in the future, I decided to make my own stream server from scratch instead of supporting legacy code. diff --git a/README.ru.md b/README.ru.md index f02eba9..208ea37 100644 --- a/README.ru.md +++ b/README.ru.md @@ -21,6 +21,7 @@ | Возможность сервить файлы встроенным
HTTP-сервером | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Есть | ![#ffaa00](https://placehold.it/15/ffaa00/000000?text=+) Нет каталогов | | Вывод сигналов о состоянии стрима на GPIO
с помощью [libgpiod](https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about) | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Есть | ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Нет | | Поддержка контролов веб-камер (фокус,
движение сервами) и всяких настроек,
типа яркости, через HTTP | ![#f03c15](https://placehold.it/15/f03c15/000000?text=+) Нет | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Есть | +| Совместимость с API mjpg-streamer'а | ![#00aa00](https://placehold.it/15/00aa00/000000?text=+) Есть | :) | Сносочки: * ```1``` Еще до написания µStreamer, я запилил [патч](https://github.com/jacksonliam/mjpg-streamer/pull/164), добавляющий в mjpg-streamer поддержку DV-таймингов и предотвращающий его зависание при отключении устройства. Однако патч, увы, далек от совершенства и я не гарантирую его стопроцентную работоспособность, поскольку код mjpg-streamer чрезвычайно запутан и очень плохо структурирован. Учитывая это, а также то, что в дальнейшем мне потребовались многопоточность и аппаратное кодирование JPEG, было принято решение написать свой стрим-сервер с нуля, чтобы не тратить силы на поддержку лишнего легаси. diff --git a/linters/Dockerfile b/linters/Dockerfile index 62d8bb6..b5411fe 100644 --- a/linters/Dockerfile +++ b/linters/Dockerfile @@ -16,6 +16,9 @@ RUN pacman -Syu --noconfirm \ python-pip \ python-tox \ cppcheck \ + npm \ && (pacman -Sc --noconfirm || true) +RUN npm install htmlhint -g + CMD /bin/bash diff --git a/linters/tox.ini b/linters/tox.ini index e6a09d6..c08492f 100644 --- a/linters/tox.ini +++ b/linters/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = cppcheck, flake8, pylint, mypy, vulture +envlist = cppcheck, flake8, pylint, mypy, vulture, htmlhint skipsdist = true [testenv] @@ -44,3 +44,7 @@ whitelist_externals = bash commands = bash -c 'vulture tools/*.py' deps = vulture + +[testenv:htmlhint] +whitelist_externals = htmlhint +commands = htmlhint src/http/data/*.html diff --git a/src/http/data/index.html b/src/http/data/index.html index 165df1a..bf55baf 100644 --- a/src/http/data/index.html +++ b/src/http/data/index.html @@ -4,6 +4,7 @@ uStreamer + @@ -11,46 +12,56 @@


diff --git a/src/http/data/index_html.h b/src/http/data/index_html.h index 425cb3d..614f75f 100644 --- a/src/http/data/index_html.h +++ b/src/http/data/index_html.h @@ -32,6 +32,7 @@ const char HTML_INDEX_PAGE[] = " \ \ \ uStreamer \ + \ \ \ \ @@ -39,46 +40,56 @@ const char HTML_INDEX_PAGE[] = " \
\ \
\
\