diff options
author | Mikhail Burakov <mburakov@mailbox.org> | 2023-06-11 20:36:29 +0200 |
---|---|---|
committer | Mikhail Burakov <mburakov@mailbox.org> | 2023-06-11 20:36:29 +0200 |
commit | fb859712f36254ca9c34773b82618a09626c8cd9 (patch) | |
tree | 084ffbfc579a5381a62d04556a9f9eb4a09767c8 /encode.c | |
parent | 0ff0bb25a887259e84c25e8722ff850e0e39bcd6 (diff) |
Introduce communication proto for video stream
Diffstat (limited to 'encode.c')
-rw-r--r-- | encode.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -32,6 +32,7 @@ #include "bitstream.h" #include "gpu.h" #include "hevc.h" +#include "proto.h" #include "toolbox/utils.h" struct EncodeContext { @@ -922,8 +923,14 @@ bool EncodeContextEncodeFrame(struct EncodeContext* encode_context, int fd) { abort(); } + struct Proto proto = { + .size = segment->size, + .type = PROTO_TYPE_VIDEO, + .flags = idr ? PROTO_FLAG_KEYFRAME : 0, + .latency = 0, + }; struct iovec iovec[] = { - {.iov_base = &segment->size, .iov_len = sizeof(segment->size)}, + {.iov_base = &proto, .iov_len = sizeof(proto)}, {.iov_base = segment->buf, .iov_len = segment->size}, }; if (!DrainBuffers(fd, iovec, LENGTH(iovec))) { |