ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
image_source_t Struct Reference

One client's video input as seen by the compositor. More...

Data Fields

image_t * image
 Pointer to client's current video frame (owned by buffer system).
char client_id [MAX_CLIENT_ID_LEN]
 Unique client identifier for this source.
bool has_video
 Whether this client has active video stream.

Detailed Description

One client's video input as seen by the compositor.

Holds the current buffer-backed image, the stable client identifier used for layout labels, and whether that client is actively sending video. The image pointer is borrowed from the client's frame-buffer system; this record does not free the pixels. This structure is used to collect video frames from all active clients

before creating composite layouts for multi-user display.

  • image: Pointer to the client's current video frame (image_t structure)
  • client_id: Unique identifier for this client
  • has_video: Whether this client is actively sending video

USAGE PATTERN:

  1. Collect video sources: collect_video_sources() fills array with active clients
  2. Filter sources: Only sources with has_video=true are used in composite
  3. Create composite: generate_composite_frame() uses sources to create layout
  4. Free sources: Sources are automatically cleaned up after composite generation

VIDEO MIXING:

This structure is central to the multi-client video mixing system:

  • Single client: One source, full-screen display
  • Multiple clients: Multiple sources, grid layout (2x2, 3x3, etc.)
  • Grid layout: Each source occupies one cell in the grid
  • Aspect ratio: Each source maintains its aspect ratio within cell

MEMORY MANAGEMENT:

  • image pointer points to frame data managed by video_frame_buffer_t
  • Frame data is owned by the double-buffer system, not this structure
  • No manual memory management needed (automatic via buffer system)
Note
image pointer is valid only when has_video is true.
image pointer may be NULL if client stopped sending video.
client_id is used to identify which client this source represents.

Definition at line 214 of file src/server/stream.c.

Field Documentation

◆ client_id

char image_source_t::client_id[MAX_CLIENT_ID_LEN]

Unique client identifier for this source.

Definition at line 218 of file src/server/stream.c.

◆ has_video

bool image_source_t::has_video

Whether this client has active video stream.

Definition at line 220 of file src/server/stream.c.

◆ image

image_t* image_source_t::image

Pointer to client's current video frame (owned by buffer system).

Definition at line 216 of file src/server/stream.c.


The documentation for this struct was generated from the following file: