mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-13 02:53:42 +00:00
last_id
This commit is contained in:
@@ -102,7 +102,8 @@ int memsink_server_put(memsink_s *sink, const frame_s *frame) {
|
|||||||
LOG_VERBOSE("%s-sink: >>>>> Exposing new frame ...", sink->name);
|
LOG_VERBOSE("%s-sink: >>>>> Exposing new frame ...", sink->name);
|
||||||
|
|
||||||
# define COPY(_field) sink->mem->_field = frame->_field
|
# define COPY(_field) sink->mem->_field = frame->_field
|
||||||
sink->mem->id = get_now_id();
|
sink->last_id = get_now_id();
|
||||||
|
sink->mem->id = sink->last_id;
|
||||||
COPY(used);
|
COPY(used);
|
||||||
COPY(width);
|
COPY(width);
|
||||||
COPY(height);
|
COPY(height);
|
||||||
@@ -145,11 +146,11 @@ int memsink_client_get(memsink_s *sink, frame_s *frame) { // cppcheck-suppress u
|
|||||||
|
|
||||||
bool same = false;
|
bool same = false;
|
||||||
|
|
||||||
if (sink->mem->id == sink->consumed_id) {
|
if (sink->mem->id == sink->last_id) {
|
||||||
same = true;
|
same = true;
|
||||||
} else {
|
} else {
|
||||||
# define COPY(_field) frame->_field = sink->mem->_field
|
# define COPY(_field) frame->_field = sink->mem->_field
|
||||||
sink->consumed_id = sink->mem->id;
|
sink->last_id = sink->mem->id;
|
||||||
COPY(width);
|
COPY(width);
|
||||||
COPY(height);
|
COPY(height);
|
||||||
COPY(format);
|
COPY(format);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ typedef struct {
|
|||||||
|
|
||||||
int fd;
|
int fd;
|
||||||
memsink_shared_s *mem;
|
memsink_shared_s *mem;
|
||||||
uint64_t consumed_id; // Client only
|
uint64_t last_id;
|
||||||
} memsink_s;
|
} memsink_s;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user