mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-28 04:36:33 +00:00
pass online flag to rawsink
This commit is contained in:
@@ -133,7 +133,7 @@ int rawsink_server_put(
|
||||
rawsink_s *rawsink,
|
||||
const uint8_t *data, size_t size,
|
||||
unsigned format, unsigned width, unsigned height,
|
||||
long double grab_ts) {
|
||||
long double grab_ts, bool online) {
|
||||
|
||||
long double now = get_now_monotonic();
|
||||
|
||||
@@ -157,6 +157,7 @@ int rawsink_server_put(
|
||||
COPY(width);
|
||||
COPY(height);
|
||||
COPY(grab_ts);
|
||||
COPY(online);
|
||||
COPY(size);
|
||||
memcpy(rawsink->mem->data, data, size);
|
||||
# undef COPY
|
||||
@@ -185,7 +186,7 @@ int rawsink_client_get(
|
||||
rawsink_s *rawsink,
|
||||
char *data, size_t *size,
|
||||
unsigned *format, unsigned *width, unsigned *height,
|
||||
long double *grab_ts) {
|
||||
long double *grab_ts, bool *online) {
|
||||
|
||||
assert(!rawsink->server); // Client only
|
||||
|
||||
@@ -209,6 +210,7 @@ int rawsink_client_get(
|
||||
COPY(width);
|
||||
COPY(height);
|
||||
COPY(grab_ts);
|
||||
COPY(online);
|
||||
COPY(size);
|
||||
memcpy(data, rawsink->mem->data, *size);
|
||||
# undef COPY
|
||||
|
||||
@@ -50,6 +50,7 @@ typedef struct {
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
long double grab_ts;
|
||||
bool online;
|
||||
size_t size;
|
||||
uint8_t data[RAWSINK_MAX_DATA];
|
||||
} rawsink_shared_s;
|
||||
@@ -75,10 +76,10 @@ int rawsink_server_put(
|
||||
rawsink_s *rawsink,
|
||||
const uint8_t *data, size_t size,
|
||||
unsigned format, unsigned witdh, unsigned height,
|
||||
long double grab_ts);
|
||||
long double grab_ts, bool online);
|
||||
|
||||
int rawsink_client_get(
|
||||
rawsink_s *rawsink,
|
||||
char *data, size_t *size,
|
||||
unsigned *format, unsigned *width, unsigned *height,
|
||||
long double *grab_ts);
|
||||
long double *grab_ts, bool *online);
|
||||
|
||||
@@ -212,7 +212,7 @@ void stream_loop(stream_s *stream) {
|
||||
# define HW(_next) DEV(run->hw_buffers[buf_index]._next)
|
||||
if (stream->rawsink && rawsink_server_put(
|
||||
stream->rawsink, HW(data), HW(used), HW(format),
|
||||
HW(width), HW(height), HW(grab_ts)
|
||||
HW(width), HW(height), HW(grab_ts), true
|
||||
) < 0) {
|
||||
stream->rawsink = NULL;
|
||||
LOG_ERROR("RAW sink completely disabled due error");
|
||||
@@ -273,7 +273,7 @@ static _pool_s *_stream_init_loop(stream_s *stream) {
|
||||
# define BLANK(_next) stream->blank->_next
|
||||
if (stream->rawsink && rawsink_server_put(
|
||||
stream->rawsink, BLANK(data), BLANK(used), V4L2_PIX_FMT_JPEG,
|
||||
BLANK(width), BLANK(height), BLANK(grab_ts)
|
||||
BLANK(width), BLANK(height), BLANK(grab_ts), false
|
||||
) < 0) {
|
||||
stream->rawsink = NULL;
|
||||
LOG_ERROR("RAW sink completely disabled due error");
|
||||
|
||||
Reference in New Issue
Block a user