mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-02 05:36:31 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acc8628f3d | ||
|
|
46e99be201 | ||
|
|
7fbeca41fa |
@@ -1,7 +1,7 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
current_version = 0.61
|
current_version = 0.62
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
||||||
serialize =
|
serialize =
|
||||||
{major}.{minor}
|
{major}.{minor}
|
||||||
|
|||||||
2
PKGBUILD
2
PKGBUILD
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
pkgname=ustreamer
|
pkgname=ustreamer
|
||||||
pkgver=0.61
|
pkgver=0.62
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
||||||
url="https://github.com/pi-kvm/ustreamer"
|
url="https://github.com/pi-kvm/ustreamer"
|
||||||
|
|||||||
@@ -22,4 +22,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION "0.61"
|
#define VERSION "0.62"
|
||||||
|
|||||||
@@ -25,16 +25,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/syscall.h>
|
|
||||||
|
|
||||||
#include "tools.h"
|
#include "tools.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +68,7 @@ pthread_mutex_t log_mutex;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define LOG_PRINTF_NOLOCK(_label, _msg, ...) { \
|
#define LOG_PRINTF_NOLOCK(_label, _msg, ...) { \
|
||||||
printf("-- " _label " [%.03Lf tid=%ld] -- " _msg "\n", get_now_monotonic(), syscall(SYS_gettid), ##__VA_ARGS__); \
|
printf("-- " _label " [%.03Lf tid=%d] -- " _msg "\n", get_now_monotonic(), get_thread_id(), ##__VA_ARGS__); \
|
||||||
fflush(stdout); \
|
fflush(stdout); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,9 +80,9 @@ pthread_mutex_t log_mutex;
|
|||||||
|
|
||||||
#define LOG_PERROR(_msg, ...) { \
|
#define LOG_PERROR(_msg, ...) { \
|
||||||
char _buf[1024] = ""; \
|
char _buf[1024] = ""; \
|
||||||
char *_ptr = strerror_r(errno, _buf, 1024); \
|
char *_ptr = errno_to_string(_buf, 1024); \
|
||||||
LOGGING_LOCK; \
|
LOGGING_LOCK; \
|
||||||
printf("-- ERROR [%.03Lf tid=%ld] -- " _msg ": %s\n", get_now_monotonic(), syscall(SYS_gettid), ##__VA_ARGS__, _ptr); \
|
printf("-- ERROR [%.03Lf tid=%d] -- " _msg ": %s\n", get_now_monotonic(), get_thread_id(), ##__VA_ARGS__, _ptr); \
|
||||||
fflush(stdout); \
|
fflush(stdout); \
|
||||||
LOGGING_UNLOCK; \
|
LOGGING_UNLOCK; \
|
||||||
}
|
}
|
||||||
@@ -124,3 +120,13 @@ pthread_mutex_t log_mutex;
|
|||||||
LOGGING_UNLOCK; \
|
LOGGING_UNLOCK; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INLINE char *errno_to_string(char *buf, size_t size) {
|
||||||
|
#if defined(__GLIBC__) && defined(_GNU_SOURCE)
|
||||||
|
return strerror_r(errno, buf, size);
|
||||||
|
#else
|
||||||
|
strerror_r(errno, buf, size);
|
||||||
|
return buf;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,12 +25,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
@@ -102,3 +104,7 @@ INLINE long double get_now_real(void) {
|
|||||||
get_now(CLOCK_REALTIME, &sec, &msec);
|
get_now(CLOCK_REALTIME, &sec, &msec);
|
||||||
return (long double)sec + ((long double)msec) / 1000;
|
return (long double)sec + ((long double)msec) / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INLINE pid_t get_thread_id(void) {
|
||||||
|
return syscall(SYS_gettid);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user