Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camera_common: rename create_thumbnail to publish_thumbnail #19920

Merged
merged 2 commits into from
Jan 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions selfdrive/camerad/cameras/camera_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
deanlee marked this conversation as resolved.
Show resolved Hide resolved
s->pm->send("thumbnail", msg);
}
pm->send("thumbnail", msg);
free(thumbnail_buffer);
}

Expand Down Expand Up @@ -350,7 +348,7 @@ void *processing_thread(MultiCameraState *cameras, const char *tname,

if (cs == &(cameras->rear) && cnt % 100 == 3) {
// this takes 10ms???
create_thumbnail(cameras, &(cs->buf));
publish_thumbnail(cameras->pm, &(cs->buf));
}
cs->buf.release();
}
Expand Down