@@ -14,21 +14,21 @@ VideoEncoder::VideoEncoder(const EncoderInfo &encoder_info, int in_width, int in
14
14
pm.reset (new PubMaster (pubs));
15
15
}
16
16
17
- void VideoEncoder::publisher_publish (VideoEncoder *e, int segment_num, uint32_t idx, VisionIpcBufExtra &extra,
17
+ void VideoEncoder::publisher_publish (int segment_num, uint32_t idx, VisionIpcBufExtra &extra,
18
18
unsigned int flags, kj::ArrayPtr<capnp::byte> header, kj::ArrayPtr<capnp::byte> dat) {
19
19
// broadcast packet
20
20
MessageBuilder msg;
21
21
auto event = msg.initEvent (true );
22
- auto edat = (event.*(e-> encoder_info .init_encode_data_func ))();
22
+ auto edat = (event.*(encoder_info.init_encode_data_func ))();
23
23
auto edata = edat.initIdx ();
24
24
struct timespec ts;
25
25
timespec_get (&ts, TIME_UTC);
26
26
edat.setUnixTimestampNanos ((uint64_t )ts.tv_sec *1000000000 + ts.tv_nsec );
27
27
edata.setFrameId (extra.frame_id );
28
28
edata.setTimestampSof (extra.timestamp_sof );
29
29
edata.setTimestampEof (extra.timestamp_eof );
30
- edata.setType (e-> encoder_info .encode_type );
31
- edata.setEncodeId (e-> cnt ++);
30
+ edata.setType (encoder_info.encode_type );
31
+ edata.setEncodeId (cnt++);
32
32
edata.setSegmentNum (segment_num);
33
33
edata.setSegmentId (idx);
34
34
edata.setFlags (flags);
@@ -39,21 +39,21 @@ void VideoEncoder::publisher_publish(VideoEncoder *e, int segment_num, uint32_t
39
39
if (flags & V4L2_BUF_FLAG_KEYFRAME) edat.setHeader (header);
40
40
41
41
uint32_t bytes_size = capnp::computeSerializedSizeInWords (msg) * sizeof (capnp::word);
42
- if (e-> msg_cache .size () < bytes_size) {
43
- e-> msg_cache .resize (bytes_size);
42
+ if (msg_cache.size () < bytes_size) {
43
+ msg_cache.resize (bytes_size);
44
44
}
45
- kj::ArrayOutputStream output_stream (kj::ArrayPtr<capnp::byte>(e-> msg_cache .data (), bytes_size));
45
+ kj::ArrayOutputStream output_stream (kj::ArrayPtr<capnp::byte>(msg_cache.data (), bytes_size));
46
46
capnp::writeMessage (output_stream, msg);
47
- e-> pm ->send (e-> encoder_info .publish_name , e-> msg_cache .data (), bytes_size);
47
+ pm->send (encoder_info.publish_name , msg_cache.data (), bytes_size);
48
48
49
49
// Publish keyframe thumbnail
50
- if ((flags & V4L2_BUF_FLAG_KEYFRAME) && e-> encoder_info .thumbnail_name != NULL ) {
50
+ if ((flags & V4L2_BUF_FLAG_KEYFRAME) && encoder_info.thumbnail_name != NULL ) {
51
51
MessageBuilder tm;
52
52
auto thumbnail = tm.initEvent ().initThumbnail ();
53
53
thumbnail.setFrameId (extra.frame_id );
54
54
thumbnail.setTimestampEof (extra.timestamp_eof );
55
55
thumbnail.setThumbnail (dat);
56
56
thumbnail.setEncoding (cereal::Thumbnail::Encoding::KEYFRAME);
57
- pm->send (e-> encoder_info .thumbnail_name , tm);
57
+ pm->send (encoder_info.thumbnail_name , tm);
58
58
}
59
- }
59
+ }
0 commit comments