Add reconciler and ingest modules with CLI driver
reconciler: generic resource state machine — BFS pathfinding from current to wanted state, dependency constraints, event/periodic tick model. reconciler_cli exercises it with simulated device/transport/stream resources. ingest: V4L2 capture module — open device, negotiate MJPEG format, MMAP buffer pool, capture thread with on_frame callback. start/stop lifecycle designed for reconciler management. Transport-agnostic: caller wires on_frame to proto_write_video_frame. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ CONFIG_OBJ = $(BUILD)/config/config.o
|
||||
PROTOCOL_OBJ = $(BUILD)/protocol/protocol.o
|
||||
TEST_IMAGE_OBJ = $(BUILD)/test_image/test_image.o
|
||||
XORG_OBJ = $(BUILD)/xorg/xorg.o
|
||||
RECONCILER_OBJ = $(BUILD)/reconciler/reconciler.o
|
||||
|
||||
CLI_SRCS = \
|
||||
media_ctrl_cli.c \
|
||||
@@ -25,7 +26,8 @@ CLI_SRCS = \
|
||||
xorg_cli.c \
|
||||
v4l2_view_cli.c \
|
||||
stream_send_cli.c \
|
||||
stream_recv_cli.c
|
||||
stream_recv_cli.c \
|
||||
reconciler_cli.c
|
||||
|
||||
CLI_OBJS = $(CLI_SRCS:%.c=$(CLI_BUILD)/%.o)
|
||||
|
||||
@@ -43,7 +45,8 @@ all: \
|
||||
$(CLI_BUILD)/xorg_cli \
|
||||
$(CLI_BUILD)/v4l2_view_cli \
|
||||
$(CLI_BUILD)/stream_send_cli \
|
||||
$(CLI_BUILD)/stream_recv_cli
|
||||
$(CLI_BUILD)/stream_recv_cli \
|
||||
$(CLI_BUILD)/reconciler_cli
|
||||
|
||||
# Module objects delegate to their sub-makes.
|
||||
$(COMMON_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/common
|
||||
@@ -56,6 +59,7 @@ $(CONFIG_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/config
|
||||
$(PROTOCOL_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/protocol
|
||||
$(TEST_IMAGE_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/test_image
|
||||
$(XORG_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/xorg
|
||||
$(RECONCILER_OBJ): ; $(MAKE) -C $(ROOT)/src/modules/reconciler
|
||||
|
||||
# Compile each CLI source to its own .o (generates .d alongside).
|
||||
$(CLI_BUILD)/%.o: %.c | $(CLI_BUILD)
|
||||
@@ -98,6 +102,9 @@ $(CLI_BUILD)/stream_send_cli: $(CLI_BUILD)/stream_send_cli.o $(COMMON_OBJ) $(SER
|
||||
$(CLI_BUILD)/stream_recv_cli: $(CLI_BUILD)/stream_recv_cli.o $(COMMON_OBJ) $(SERIAL_OBJ) $(TRANSPORT_OBJ) $(PROTOCOL_OBJ) $(XORG_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lpthread $(PKG_LDFLAGS)
|
||||
|
||||
$(CLI_BUILD)/reconciler_cli: $(CLI_BUILD)/reconciler_cli.o $(RECONCILER_OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
$(CLI_BUILD):
|
||||
mkdir -p $@
|
||||
|
||||
@@ -116,6 +123,7 @@ clean:
|
||||
$(CLI_BUILD)/xorg_cli \
|
||||
$(CLI_BUILD)/v4l2_view_cli \
|
||||
$(CLI_BUILD)/stream_send_cli \
|
||||
$(CLI_BUILD)/stream_recv_cli
|
||||
$(CLI_BUILD)/stream_recv_cli \
|
||||
$(CLI_BUILD)/reconciler_cli
|
||||
|
||||
-include $(CLI_OBJS:%.o=%.d)
|
||||
|
||||
Reference in New Issue
Block a user