mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-18 02:55:46 +00:00
refactoring
This commit is contained in:
parent
9ca511d29d
commit
ce6184b8cd
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
/*****************************************************************************
|
||||
# #
|
||||
# uStreamer - Lightweight and fast MJPG-HTTP streamer. #
|
||||
# #
|
||||
# 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) {
|
||||
assert(size >= 8);
|
||||
buf[0] = format & 0x7f;
|
||||
buf[1] = (format >> 8) & 0x7f;
|
||||
buf[2] = (format >> 16) & 0x7f;
|
||||
buf[3] = (format >> 24) & 0x7f;
|
||||
buf[0] = format & 0x7F;
|
||||
buf[1] = (format >> 8) & 0x7F;
|
||||
buf[2] = (format >> 16) & 0x7F;
|
||||
buf[3] = (format >> 24) & 0x7F;
|
||||
if (format & (1 << 31)) {
|
||||
buf[4] = '-';
|
||||
buf[5] = 'B';
|
||||
|
||||
@ -42,7 +42,7 @@ def main():
|
||||
for ch in jpg_data:
|
||||
if len(rows[-1]) > 20:
|
||||
rows.append([])
|
||||
rows[-1].append(hex(ch))
|
||||
rows[-1].append("0x%.2X" % (ch))
|
||||
|
||||
text = ",\n\t".join(", ".join(row) for row in rows)
|
||||
text = "const unsigned char %s_JPG_DATA[] = {\n\t%s\n};\n" % (prefix, text)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user