Skip to content

Commit

Permalink
Fix formatting for humble
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsowa committed Nov 11, 2024
1 parent a7f45b5 commit f87ddd0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions src/jpeg_streamers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ void JpegSnapshotStreamer::sendImage(
cv::imencode(".jpeg", img, encoded_buffer, encode_params);

char stamp[20];
snprintf(stamp, sizeof(stamp), "%.06lf",
std::chrono::duration_cast<std::chrono::duration<double>>(time.time_since_epoch()).count());
snprintf(
stamp, sizeof(stamp), "%.06lf",
std::chrono::duration_cast<std::chrono::duration<double>>(time.time_since_epoch()).count());
async_web_server_cpp::HttpReply::builder(async_web_server_cpp::HttpReply::ok)
.header("Connection", "close")
.header("Server", "web_video_server")
Expand Down
4 changes: 2 additions & 2 deletions src/libav_streamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ void LibavStreamer::sendImage(
std::size_t size;
uint8_t * output_buf;

double seconds = std::chrono::duration_cast<std::chrono::duration<double>>(time -
first_image_timestamp_.value()).count();
double seconds = std::chrono::duration_cast<std::chrono::duration<double>>(
time - first_image_timestamp_.value()).count();
// Encode video at 1/0.95 to minimize delay
pkt->pts = (int64_t)(seconds / av_q2d(video_stream_->time_base) * 0.95);
if (pkt->pts <= 0) {
Expand Down
9 changes: 5 additions & 4 deletions src/multipart_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ void MultipartStream::sendPartHeader(
size_t payload_size)
{
char stamp[20];
snprintf(stamp, sizeof(stamp), "%.06lf",
std::chrono::duration_cast<std::chrono::duration<double>>(time.time_since_epoch()).count());
snprintf(
stamp, sizeof(stamp), "%.06lf",
std::chrono::duration_cast<std::chrono::duration<double>>(time.time_since_epoch()).count());
std::shared_ptr<std::vector<async_web_server_cpp::HttpHeader>> headers(
new std::vector<async_web_server_cpp::HttpHeader>());
headers->push_back(async_web_server_cpp::HttpHeader("Content-type", type));
Expand Down Expand Up @@ -114,8 +115,8 @@ bool MultipartStream::isBusy()
pending_footers_.pop();
} else {
auto footer_time = pending_footers_.front().timestamp;
if (std::chrono::duration_cast<std::chrono::duration<double>>((current_time -
footer_time)).count() > 0.5)
if (std::chrono::duration_cast<std::chrono::duration<double>>(
(current_time - footer_time)).count() > 0.5)
{
pending_footers_.pop();
} else {
Expand Down

0 comments on commit f87ddd0

Please sign in to comment.