mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-04-26 08:26:13 +00:00
refactoring
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
# #
|
||||||
# uStreamer - Lightweight and fast MJPG-HTTP streamer. #
|
# uStreamer - Lightweight and fast MJPG-HTTP streamer. #
|
||||||
# #
|
# #
|
||||||
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
|
# Copyright (C) 2018 Maxim Devaev <mdevaev@gmail.com> #
|
||||||
|
|||||||
@@ -441,10 +441,10 @@ static int _device_apply_resolution(struct device_t *dev, const unsigned width,
|
|||||||
|
|
||||||
static const char *_format_to_string_auto(char *buf, const size_t size, const unsigned format) {
|
static const char *_format_to_string_auto(char *buf, const size_t size, const unsigned format) {
|
||||||
assert(size >= 8);
|
assert(size >= 8);
|
||||||
buf[0] = format & 0x7f;
|
buf[0] = format & 0x7F;
|
||||||
buf[1] = (format >> 8) & 0x7f;
|
buf[1] = (format >> 8) & 0x7F;
|
||||||
buf[2] = (format >> 16) & 0x7f;
|
buf[2] = (format >> 16) & 0x7F;
|
||||||
buf[3] = (format >> 24) & 0x7f;
|
buf[3] = (format >> 24) & 0x7F;
|
||||||
if (format & (1 << 31)) {
|
if (format & (1 << 31)) {
|
||||||
buf[4] = '-';
|
buf[4] = '-';
|
||||||
buf[5] = 'B';
|
buf[5] = 'B';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def main():
|
|||||||
for ch in jpg_data:
|
for ch in jpg_data:
|
||||||
if len(rows[-1]) > 20:
|
if len(rows[-1]) > 20:
|
||||||
rows.append([])
|
rows.append([])
|
||||||
rows[-1].append(hex(ch))
|
rows[-1].append("0x%.2X" % (ch))
|
||||||
|
|
||||||
text = ",\n\t".join(", ".join(row) for row in rows)
|
text = ",\n\t".join(", ".join(row) for row in rows)
|
||||||
text = "const unsigned char %s_JPG_DATA[] = {\n\t%s\n};\n" % (prefix, text)
|
text = "const unsigned char %s_JPG_DATA[] = {\n\t%s\n};\n" % (prefix, text)
|
||||||
|
|||||||
Reference in New Issue
Block a user