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