camera_common: rename create_thumbnail to publish_thumbnail (#19920)

* rename create_thumbnail to publish_thumbnail

* check pm
old-commit-hash: 90994baab0
vw-mqb-aeb
Dean Lee 4 years ago committed by GitHub
parent 8c963586f8
commit 8e0dc47f2e
  1. 10
      selfdrive/camerad/cameras/camera_common.cc

@ -237,7 +237,7 @@ void fill_frame_image(cereal::FrameData::Builder &framed, const CameraBuf *b) {
delete[] resized_dat;
}
static void create_thumbnail(MultiCameraState *s, const CameraBuf *b) {
static void publish_thumbnail(PubMaster *pm, const CameraBuf *b) {
uint8_t* thumbnail_buffer = NULL;
unsigned long thumbnail_len = 0;
@ -295,9 +295,7 @@ static void create_thumbnail(MultiCameraState *s, const CameraBuf *b) {
thumbnaild.setTimestampEof(b->cur_frame_data.timestamp_eof);
thumbnaild.setThumbnail(kj::arrayPtr((const uint8_t*)thumbnail_buffer, thumbnail_len));
if (s->pm != NULL) {
s->pm->send("thumbnail", msg);
}
pm->send("thumbnail", msg);
free(thumbnail_buffer);
}
@ -348,9 +346,9 @@ void *processing_thread(MultiCameraState *cameras, const char *tname,
callback(cameras, cs, cnt);
if (cs == &(cameras->rear) && cnt % 100 == 3) {
if (cs == &(cameras->rear) && cameras->pm && cnt % 100 == 3) {
// this takes 10ms???
create_thumbnail(cameras, &(cs->buf));
publish_thumbnail(cameras->pm, &(cs->buf));
}
cs->buf.release();
}

Loading…
Cancel
Save