From ff95a2897788efeb2d958d680c93e5b3bc9d8ac1 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 4 Jul 2022 17:44:29 +0000 Subject: [PATCH] Fix compilation errors Resolves: https://github.com/ayufan-research/camera-streamer/issues/2 --- device/buffer_queue.c | 3 ++- http/http_h264.c | 2 +- http/http_jpeg.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/device/buffer_queue.c b/device/buffer_queue.c index e379130..51ae685 100644 --- a/device/buffer_queue.c +++ b/device/buffer_queue.c @@ -4,6 +4,7 @@ #include "opts/log.h" #include +#include pthread_mutex_t buffer_lock = PTHREAD_MUTEX_INITIALIZER; @@ -127,7 +128,7 @@ int buffer_list_enqueue(buffer_list_t *buf_list, buffer_t *dma_buf) memcpy(buf->start, dma_buf->start, dma_buf->used); uint64_t after = get_monotonic_time_us(NULL, NULL); - LOG_DEBUG(buf, "mmap copy: dest=%p, src=%p (%s), size=%zu, space=%zu, time=%luus", + LOG_DEBUG(buf, "mmap copy: dest=%p, src=%p (%s), size=%zu, space=%zu, time=%" PRIu64 "us", buf->start, dma_buf->start, dma_buf->name, dma_buf->used, buf->length, after-before); } else { LOG_DEBUG(buf, "dmabuf copy: dest=%p, src=%p (%s, dma_fd=%d), size=%zu", diff --git a/http/http_h264.c b/http/http_h264.c index cff44d5..c3d5739 100644 --- a/http/http_h264.c +++ b/http/http_h264.c @@ -78,7 +78,7 @@ int http_video_buf_part(buffer_lock_t *buf_lock, buffer_t *buf, int frame, http_ } if (!status->wrote_header) { - fprintf(status->stream, VIDEO_HEADER); + fputs(VIDEO_HEADER, status->stream); status->wrote_header = true; } if (!fwrite(buf->start, buf->used, 1, status->stream)) { diff --git a/http/http_jpeg.c b/http/http_jpeg.c index 51c2777..632347d 100644 --- a/http/http_jpeg.c +++ b/http/http_jpeg.c @@ -67,7 +67,7 @@ void http_snapshot(http_worker_t *worker, FILE *stream) int http_stream_buf_part(buffer_lock_t *buf_lock, buffer_t *buf, int frame, FILE *stream) { - if (!frame && !fprintf(stream, STREAM_HEADER)) { + if (!frame && !fputs(STREAM_HEADER, stream)) { return -1; } if (!fprintf(stream, STREAM_PART, buf->used)) { @@ -76,7 +76,7 @@ int http_stream_buf_part(buffer_lock_t *buf_lock, buffer_t *buf, int frame, FILE if (!fwrite(buf->start, buf->used, 1, stream)) { return -1; } - if (!fprintf(stream, STREAM_BOUNDARY)) { + if (!fputs(STREAM_BOUNDARY, stream)) { return -1; }