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

Simple atomic frame swap structure. More...

#include <lib/video/video_frame.h>

Data Fields

atomic_uintptr_t current_frame
 Atomic pointer to current frame.
 
video_frame_t frame_a
 First pre-allocated frame.
 
video_frame_t frame_b
 Second pre-allocated frame.
 
atomic_bool use_frame_a
 Atomic flag: true = use frame_a next, false = use frame_b.
 

Detailed Description

Simple atomic frame swap structure.

Simplified frame management for basic use cases that don't need statistics. Uses atomic pointer swaps for lock-free frame updates. This is the pattern used by many video streaming services for simple frame delivery.

Note
This is a lighter-weight alternative to video_frame_buffer_t when statistics tracking is not needed.
Uses two pre-allocated frames that alternate on each update.
Atomic pointer swap enables lock-free operation.

Definition at line 261 of file video_frame.h.

Field Documentation

◆ current_frame

atomic_uintptr_t simple_frame_swap_t::current_frame

Atomic pointer to current frame.

Definition at line 262 of file video_frame.h.

Referenced by simple_frame_swap_create(), simple_frame_swap_get(), and simple_frame_swap_update().

◆ frame_a

video_frame_t simple_frame_swap_t::frame_a

First pre-allocated frame.

Definition at line 263 of file video_frame.h.

Referenced by simple_frame_swap_create(), simple_frame_swap_destroy(), and simple_frame_swap_update().

◆ frame_b

video_frame_t simple_frame_swap_t::frame_b

Second pre-allocated frame.

Definition at line 264 of file video_frame.h.

Referenced by simple_frame_swap_create(), simple_frame_swap_destroy(), and simple_frame_swap_update().

◆ use_frame_a

atomic_bool simple_frame_swap_t::use_frame_a

Atomic flag: true = use frame_a next, false = use frame_b.

Definition at line 265 of file video_frame.h.

Referenced by simple_frame_swap_create(), and simple_frame_swap_update().


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