Print links pipeline (for informational purposes)
This commit is contained in:
parent
d688f7127f
commit
887b88fdda
@ -20,6 +20,8 @@ camera_t *camera_open(camera_options_t *options)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
links_dump(camera->links);
|
||||||
|
|
||||||
return camera;
|
return camera;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -15,8 +15,8 @@ static const char *jpeg_names[2] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static link_callbacks_t jpeg_callbacks[2] = {
|
static link_callbacks_t jpeg_callbacks[2] = {
|
||||||
{ http_jpeg_capture, http_jpeg_needs_buffer },
|
{ "JPEG-CAPTURE", http_jpeg_capture, http_jpeg_needs_buffer },
|
||||||
{ http_jpeg_lowres_capture, http_jpeg_needs_buffer }
|
{ "JPEG-LOW-CAPTURE", http_jpeg_lowres_capture, http_jpeg_needs_buffer }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *h264_names[2] = {
|
static const char *h264_names[2] = {
|
||||||
@ -25,8 +25,8 @@ static const char *h264_names[2] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static link_callbacks_t h264_callbacks[2] = {
|
static link_callbacks_t h264_callbacks[2] = {
|
||||||
{ http_h264_capture, http_h264_needs_buffer },
|
{ "H264-CAPTURE", http_h264_capture, http_h264_needs_buffer },
|
||||||
{ http_h264_lowres_capture, http_h264_needs_buffer }
|
{ "H264-LOW-CAPTURE", http_h264_lowres_capture, http_h264_needs_buffer }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int camera_configure_h264_output(camera_t *camera, buffer_list_t *src_capture, int res)
|
static int camera_configure_h264_output(camera_t *camera, buffer_list_t *src_capture, int res)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "device/buffer.h"
|
#include "device/buffer.h"
|
||||||
#include "device/buffer_list.h"
|
#include "device/buffer_list.h"
|
||||||
#include "opts/log.h"
|
#include "opts/log.h"
|
||||||
|
#include "opts/fourcc.h"
|
||||||
|
|
||||||
#define N_FDS 50
|
#define N_FDS 50
|
||||||
#define QUEUE_ON_CAPTURE // seems to provide better latency
|
#define QUEUE_ON_CAPTURE // seems to provide better latency
|
||||||
@ -273,3 +274,40 @@ int links_loop(link_t *all_links, bool *running)
|
|||||||
links_stream(all_links, false);
|
links_stream(all_links, false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void links_dump_buf_list(char *output, buffer_list_t *buf_list)
|
||||||
|
{
|
||||||
|
sprintf(output + strlen(output), "%s[%dx%d/%s/%d]", \
|
||||||
|
buf_list->name, buf_list->fmt.width, buf_list->fmt.height, \
|
||||||
|
fourcc_to_string(buf_list->fmt.format).buf, buf_list->fmt.nbufs);
|
||||||
|
}
|
||||||
|
|
||||||
|
void links_dump(link_t *all_links)
|
||||||
|
{
|
||||||
|
char line[4096];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
for (n = 0; all_links[n].source; n++) {
|
||||||
|
link_t *link = &all_links[n];
|
||||||
|
|
||||||
|
line[0] = 0;
|
||||||
|
links_dump_buf_list(line, link->source);
|
||||||
|
strcat(line, " => [");
|
||||||
|
for (int j = 0; link->sinks[j]; j++) {
|
||||||
|
if (j > 0)
|
||||||
|
strcat(line, ", ");
|
||||||
|
links_dump_buf_list(line, link->sinks[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (link->callbacks.callback_name) {
|
||||||
|
if (link->sinks[0])
|
||||||
|
strcat(line, ", ");
|
||||||
|
strcat(line, link->callbacks.callback_name);
|
||||||
|
}
|
||||||
|
strcat(line, "]");
|
||||||
|
|
||||||
|
LOG_INFO(NULL, "Link %d: %s", n, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG_INFO(NULL, "%d links.", n);
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ typedef bool (*link_check_streaming)();
|
|||||||
typedef bool (*link_validate_buffer)(struct link_s *link, buffer_t *buf);
|
typedef bool (*link_validate_buffer)(struct link_s *link, buffer_t *buf);
|
||||||
|
|
||||||
typedef struct link_callbacks_s {
|
typedef struct link_callbacks_s {
|
||||||
|
const char *callback_name;
|
||||||
link_on_buffer on_buffer;
|
link_on_buffer on_buffer;
|
||||||
link_check_streaming check_streaming;
|
link_check_streaming check_streaming;
|
||||||
link_validate_buffer validate_buffer;
|
link_validate_buffer validate_buffer;
|
||||||
@ -28,3 +29,4 @@ typedef struct link_s {
|
|||||||
int links_init(link_t *all_links);
|
int links_init(link_t *all_links);
|
||||||
int links_step(link_t *all_links, int timeout_now_ms, int *timeout_next_ms);
|
int links_step(link_t *all_links, int timeout_now_ms, int *timeout_next_ms);
|
||||||
int links_loop(link_t *all_links, bool *running);
|
int links_loop(link_t *all_links, bool *running);
|
||||||
|
void links_dump(link_t *all_links);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user