Fix connect accumulation; add display sinks to enum-devices
- controller_cli: drain semaphore and reset pending_cmd in do_connect so stale posts from old connection don't unblock the next command - protocol: add Proto_Display_Device_Info; extend proto_write_enum_devices_response and proto_read_enum_devices_response with display section; backward-compatible (absent in older messages) - node: handle_enum_devices snapshots active Display_Slots under mutex and includes them in the response - controller_cli: on_display callback prints display window info in enum-devices output - query_cli: updated to pass NULL on_display (no display interest) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,18 @@ struct Proto_Standalone_Device_Info {
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/*
|
||||
* An active display window (video sink role).
|
||||
* stream_id is the stream being displayed; win_* are current geometry.
|
||||
*/
|
||||
struct Proto_Display_Device_Info {
|
||||
uint16_t stream_id;
|
||||
int16_t win_x, win_y;
|
||||
uint16_t win_w, win_h;
|
||||
uint8_t scale;
|
||||
uint8_t anchor;
|
||||
};
|
||||
|
||||
struct Proto_Monitor_Info {
|
||||
int32_t x, y;
|
||||
uint32_t width, height;
|
||||
@@ -362,7 +374,8 @@ struct App_Error proto_write_control_response(struct Transport_Conn *conn,
|
||||
struct App_Error proto_write_enum_devices_response(struct Transport_Conn *conn,
|
||||
uint16_t request_id, uint16_t status,
|
||||
const struct Proto_Media_Device_Info *media_devices, uint16_t media_count,
|
||||
const struct Proto_Standalone_Device_Info *standalone, uint16_t standalone_count);
|
||||
const struct Proto_Standalone_Device_Info *standalone, uint16_t standalone_count,
|
||||
const struct Proto_Display_Device_Info *displays, uint16_t display_count);
|
||||
|
||||
/* CONTROL_RESPONSE: ENUM_CONTROLS */
|
||||
struct App_Error proto_write_enum_controls_response(struct Transport_Conn *conn,
|
||||
@@ -481,6 +494,12 @@ struct App_Error proto_read_enum_devices_response(
|
||||
const char *path, uint8_t path_len,
|
||||
const char *name, uint8_t name_len,
|
||||
void *userdata),
|
||||
void (*on_display)(
|
||||
uint16_t stream_id,
|
||||
int16_t win_x, int16_t win_y,
|
||||
uint16_t win_w, uint16_t win_h,
|
||||
uint8_t scale, uint8_t anchor,
|
||||
void *userdata),
|
||||
void *userdata);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user