Fix compilation errors
Resolves: https://github.com/ayufan-research/camera-streamer/issues/2
This commit is contained in:
parent
950643cff3
commit
ff95a28977
@ -4,6 +4,7 @@
|
|||||||
#include "opts/log.h"
|
#include "opts/log.h"
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
pthread_mutex_t buffer_lock = PTHREAD_MUTEX_INITIALIZER;
|
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);
|
memcpy(buf->start, dma_buf->start, dma_buf->used);
|
||||||
uint64_t after = get_monotonic_time_us(NULL, NULL);
|
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);
|
buf->start, dma_buf->start, dma_buf->name, dma_buf->used, buf->length, after-before);
|
||||||
} else {
|
} else {
|
||||||
LOG_DEBUG(buf, "dmabuf copy: dest=%p, src=%p (%s, dma_fd=%d), size=%zu",
|
LOG_DEBUG(buf, "dmabuf copy: dest=%p, src=%p (%s, dma_fd=%d), size=%zu",
|
||||||
|
@ -78,7 +78,7 @@ int http_video_buf_part(buffer_lock_t *buf_lock, buffer_t *buf, int frame, http_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!status->wrote_header) {
|
if (!status->wrote_header) {
|
||||||
fprintf(status->stream, VIDEO_HEADER);
|
fputs(VIDEO_HEADER, status->stream);
|
||||||
status->wrote_header = true;
|
status->wrote_header = true;
|
||||||
}
|
}
|
||||||
if (!fwrite(buf->start, buf->used, 1, status->stream)) {
|
if (!fwrite(buf->start, buf->used, 1, status->stream)) {
|
||||||
|
@ -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)
|
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;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!fprintf(stream, STREAM_PART, buf->used)) {
|
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)) {
|
if (!fwrite(buf->start, buf->used, 1, stream)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!fprintf(stream, STREAM_BOUNDARY)) {
|
if (!fputs(STREAM_BOUNDARY, stream)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user