ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
image_source_t Struct Reference

Image source structure for multi-client video mixing. More...

Data Fields

image_timage
 Pointer to client's current video frame (owned by buffer system)
 
uint32_t client_id
 Unique client identifier for this source.
 
bool has_video
 Whether this client has active video stream.
 

Detailed Description

Image source structure for multi-client video mixing.

Represents a single video source (client) in the video mixing pipeline. This structure is used to collect video frames from all active clients before creating composite layouts for multi-user display.

CORE FIELDS:

  • 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 229 of file stream.c.

Field Documentation

◆ client_id

uint32_t image_source_t::client_id

Unique client identifier for this source.

Definition at line 233 of file stream.c.

◆ has_video

bool image_source_t::has_video

Whether this client has active video stream.

Definition at line 235 of file stream.c.

◆ image

image_t* image_source_t::image

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

Definition at line 231 of file stream.c.


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