Skip to content

Commit

Permalink
Removing useless HTTP endpoints now we have a single-file app, updati…
Browse files Browse the repository at this point in the history
…ng the README for hisi-gen1
  • Loading branch information
wberube committed Aug 8, 2024
1 parent 4421f90 commit d7e4b62
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 82 deletions.
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,39 @@ In spite of these design choices, Divinus boasts numerous features that cater to
|-------------------------|:------------:|:-------------:|:-----------:|:-----------:|:------------------:|
| GM813x || ✔️ | ✔️ | ✔️ ||
| Hi3516AV100[^1] || ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV200[^2] || ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV300[^3] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV500[^4] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516EV200[^5] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| GK7205V200[^6] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3519V100[^7] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV100[^2] ||||||
| Hi3516CV200[^3] || ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV300[^4] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516CV500[^5] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3516EV200[^6] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| GK7205V200[^7] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3519V100[^8] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3519AV100 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| Hi3559AV100 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| T31 series | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6[^8] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6b0[^9] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6e[^10] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6c[^11] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6f[^12] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6[^9] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6b0[^10] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6e[^11] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6c[^12] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| infinity6f[^13] | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

_✔️ - supported, ↻ - in development, ✗ - unsupported, ⁿ/ₐ - not supported by hardware_

_* At the moment, only text, 24-bit and 32-bit RGB overlays are handled, matricial formats and covers are to follow_

[^1]: Hi3516AV100 and Hi3516DV100
[^2]: Hi3516CV200 and Hi3518EV20\[0/1\]
[^3]: Hi3516CV300 and Hi3516EV100
[^4]: Hi3516AV300, Hi3516CV500 and Hi3516DV300
[^5]: Hi3516DV200, Hi3516EV200/300 and Hi3518EV300
[^6]: GK7202V300, GK7205V200/300 and GK7605V100
[^7]: Hi3516AV200 and Hi3519V101
[^8]: SSC323, SSC325(D/DE) and SSC327(D/DE/Q)
[^9]: SSC333/35/37(DE)
[^10]: SSC30K\[D/Q\], SSC336\[D/Q\], SSC338\[D/G/Q\] and SSC339G
[^11]: SSC377(D/DE/QE) or SSC378\[DE/QE\]
[^12]: SSC379G
[^2]: Hi3516CV100, Hi3518CV100, Hi3518EV100 and Hi3518AV100
[^3]: Hi3516CV200 and Hi3518EV20\[0/1\]
[^4]: Hi3516CV300 and Hi3516EV100
[^5]: Hi3516AV300, Hi3516CV500 and Hi3516DV300
[^6]: Hi3516DV200, Hi3516EV200/300 and Hi3518EV300
[^7]: GK7202V300, GK7205V200/300 and GK7605V100
[^8]: Hi3516AV200 and Hi3519V101
[^9]: SSC323, SSC325(D/DE) and SSC327(D/DE/Q)
[^10]: SSC333/35/37(DE)
[^11]: SSC30K\[D/Q\], SSC336\[D/Q\], SSC338\[D/G/Q\] and SSC339G
[^12]: SSC377(D/DE/QE) or SSC378\[DE/QE\]
[^13]: SSC379G


### Documentation
Expand Down
61 changes: 1 addition & 60 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,53 +380,6 @@ int send_html(const int client_fd, const char *data) {
return 1;
}

int send_mjpeg_html(const int client_fd) {
char html[] = "<html>\n"
" <head>\n"
" <title>Live stream - MJPEG</title>\n"
" </head>\n"
" <body>\n"
" <center>\n"
" <img src=\"mjpeg\" />\n"
" </center>\n"
" </body>\n"
"</html>";
char buf[1024];
int buf_len = sprintf(
buf,
"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nContent-Length: "
"%lu\r\nConnection: close\r\n\r\n%s",
strlen(html), html);
buf[buf_len++] = 0;
send_to_fd(client_fd, buf, buf_len);
close_socket_fd(client_fd);
return 1;
}

int send_video_html(const int client_fd) {
char html[] = "<html>\n"
" <head>\n"
" <title>Live stream - fMP4</title>\n"
" </head>\n"
" <body>\n"
" <center>\n"
" <video width=\"700\" src=\"video.mp4\" autoplay "
"controls />\n"
" </center>\n"
" </body>\n"
"</html>";
char buf[1024];
int buf_len = sprintf(
buf,
"HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nContent-Length: "
"%lu\r\nConnection: close\r\n\r\n%s",
strlen(html), html);
buf[buf_len++] = 0;
send_to_fd(client_fd, buf, buf_len);
close_socket_fd(client_fd);
return 1;
}

#define REQSIZE 512 * 1024
char response[256];
char *method, *payload, *prot, *request, *query, *uri;
Expand Down Expand Up @@ -610,23 +563,11 @@ void *server_thread(void *vargp) {
break;
}

if (equals(uri, "/index.html")) {
if (equals(uri, "/") || equals(uri, "/index.htm") || equals(uri, "/index.html")) {
send_html(client_fd, indexhtml);
continue;
}

if (equals(uri, "/mjpeg.html") &&
app_config.mjpeg_enable) {
send_mjpeg_html(client_fd);
continue;
}

if (equals(uri, "/video.html") &&
app_config.mp4_enable) {
send_video_html(client_fd);
continue;
}

if (app_config.audio_enable && equals(uri, "/audio.mp3")) {
int respLen = sprintf(
response, "HTTP/1.1 200 OK\r\nContent-Type: "
Expand Down

0 comments on commit d7e4b62

Please sign in to comment.