From fb859712f36254ca9c34773b82618a09626c8cd9 Mon Sep 17 00:00:00 2001 From: Mikhail Burakov Date: Sun, 11 Jun 2023 20:36:29 +0200 Subject: Introduce communication proto for video stream --- encode.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'encode.c') diff --git a/encode.c b/encode.c index be920d1..1c45e63 100644 --- a/encode.c +++ b/encode.c @@ -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))) { -- cgit v1.2.3