ascii-chat
Binary v0.16.114-28-gf5913657f
Library lib/v0.3.2-3302-gf5913657f
Video chat in your terminal
Loading...
Searching...
No Matches

Three-thread render pipeline implementation. More...

Go to the source code of this file.

Data Structures

struct  pipeline_frame_t
struct  frame_slot_s
struct  frame_queue_s
struct  session_pipeline_s
 For session pipeline, this is the live record that ties capture_tid, encode_tid, input_tid, input_start_status together. The owning code creates it, updates it while work is active, and releases its handles and pointed-to storage before freeing the record. More...

Macros

#define PIPELINE_FRAME_SLOTS   3

Typedefs

typedef struct frame_slot_s frame_slot_t
typedef struct frame_queue_s frame_queue_t

Functions

asciichat_error_t session_pipeline_create (session_capture_ctx_t *capture, session_display_ctx_t *display, session_pipeline_t **out)
asciichat_error_t session_pipeline_run_main (session_pipeline_t *pipeline, session_should_exit_fn should_exit, session_keyboard_handler_fn keyboard_handler, void *user_data)
asciichat_error_t session_pipeline_destroy (session_pipeline_t *pipeline)

Variables

bool g_snapshot_first_frame_rendered

Detailed Description

Three-thread render pipeline implementation.

Definition in file pipeline.c.

Macro Definition Documentation

◆ PIPELINE_FRAME_SLOTS

#define PIPELINE_FRAME_SLOTS   3

Definition at line 77 of file pipeline.c.

Referenced by session_pipeline_create().

Typedef Documentation

◆ frame_queue_t

typedef struct frame_queue_s frame_queue_t

◆ frame_slot_t

typedef struct frame_slot_s frame_slot_t

Definition at line 42 of file pipeline.c.

Function Documentation

◆ session_pipeline_create()

asciichat_error_t session_pipeline_create ( session_capture_ctx_t * capture,
session_display_ctx_t * display,
session_pipeline_t ** out )

Create and start the capture thread and (if –render-file) encode thread.

Parameters
captureCapture context (must have real media_source_t for synchronous mode)
displayDisplay context (may have render_file set for –render-file mode)
outPointer to receive allocated pipeline context
Returns
ASCIICHAT_OK on success, error code otherwise
Note
The pipeline does NOT own capture or display — caller must keep them alive until session_pipeline_destroy() returns.

Definition at line 536 of file pipeline.c.

536 {
537 if (!capture || !display || !out) {
538 return SET_ERRNO(ERROR_INVALID_PARAM, "NULL argument");
539 }
540
542 for (size_t i = 0; i < PIPELINE_FRAME_SLOTS; ++i)
543 atomic_init(&p->frame_slots[i].busy, false);
544 p->capture = capture;
545 p->display = display;
546 if (platform_wakeup_create(&p->display_ready) != ASCIICHAT_OK) {
547 SAFE_FREE(p);
548 return SET_ERRNO(ERROR_INIT, "failed to create display wakeup");
549 }
551 NAMED_REGISTER_ATOMIC_PTR(&p->display_pending, "display.pending_frame", p);
552 p->encode_queue = frame_queue_create(256, "encode"); // Large buffer for slow encoding
553
554 // Check if display has render_file configured (will be checked in encode thread)
555 // We store a flag to know whether to enqueue frames for encoding
556 double render_fps = session_display_get_render_fps(display);
557 bool has_file = session_display_has_render_file(display);
559 // Synthetic/visualization sessions can switch sources too. Their recording
560 // clock must remain elapsed session time across gaps and source FPS changes.
563
564 // Playback FPS also has a default when no recording was requested. It must
565 // not enable the encoder's lossless queue for a live-only session.
566 p->has_render_file = has_file;
567 log_debug("[PIPELINE_CREATE] render_fps=%.1f, has_file=%d, has_render_file=%d", render_fps, has_file ? 1 : 0, p->has_render_file ? 1 : 0);
568
569 atomic_store_bool(&p->stop, false);
571 NAMED_REGISTER_ATOMIC(&p->capture_finished, "pipeline_capture_finished", p);
573
574 // Start capture thread
575 if (platform_thread_create(&p->capture_tid, "pipeline_capture", pipeline_capture_thread, p) != 0) {
576 free_frame(atomic_ptr_exchange(&p->display_pending, NULL));
577 platform_wakeup_destroy(p->display_ready);
579 frame_queue_destroy(p->encode_queue);
581 SAFE_FREE(p);
582 return SET_ERRNO(ERROR_INIT, "failed to start capture thread");
583 }
584
585 // Start encode thread only if render_file is active
586 if (p->has_render_file) {
587 if (platform_thread_create(&p->encode_tid, "pipeline_encode", pipeline_encode_thread, p) != 0) {
588 atomic_store_bool(&p->stop, true);
589 thread_join(&p->capture_tid, NULL);
590 free_frame(atomic_ptr_exchange(&p->display_pending, NULL));
591 frame_slots_destroy(p->frame_slots);
592 platform_wakeup_destroy(p->display_ready);
594 frame_queue_destroy(p->encode_queue);
596 SAFE_FREE(p);
597 return SET_ERRNO(ERROR_INIT, "failed to start encode thread");
598 }
599 }
600
601 *out = p;
602 return ASCIICHAT_OK;
603}
#define SET_ERRNO(code,...)
void * atomic_ptr_exchange(atomic_ptr_t *a, void *new_value)
Atomically exchange a pointer and return the old value.
void atomic_store_bool(atomic_t *a, bool value)
Atomically store a boolean value.
void atomic_ptr_store(atomic_ptr_t *a, void *value)
Atomically store a pointer.
void atomic_store_u64(atomic_t *a, uint64_t value)
Atomically store a uint64_t value.
audio_visualization_source_t source
Definition fft.c:25
#define SAFE_FREE(ptr)
#define SAFE_CALLOC(count, size, cast)
#define NAMED_REGISTER_ATOMIC(a, name, parent_ptr)
Register an atomic_t with automatic format specifier.
#define NAMED_REGISTER_ATOMIC_PTR(a, name, parent_ptr)
Register an _Atomic(void *) with automatic format specifier.
#define NAMED_UNREGISTER(ptr)
Unregister a pointer.
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INIT
Definition error_codes.h:60
@ ERROR_INVALID_PARAM
#define log_debug(...)
Log a DEBUG message.
Definition log/log.h:565
media_source_type_t media_source_get_type(media_source_t *source)
Get media source type.
Definition source.c:1099
@ MEDIA_SOURCE_STDIN
Piped or redirected input.
Definition source.h:105
bool session_display_has_render_file(session_display_ctx_t *ctx)
Check if display has render-file configured.
void * session_capture_get_media_source(session_capture_ctx_t *ctx)
Get the underlying media source from capture context.
uint32_t session_display_get_render_fps(session_display_ctx_t *ctx)
Get the render FPS configured for file output.
#define PIPELINE_FRAME_SLOTS
Definition pipeline.c:77
struct session_pipeline_s session_pipeline_t
Definition pipeline.h:22
static bool size_t gotel_query_t * out
Definition queries.h:10
void session_display_set_render_live_timing(session_display_ctx_t *ctx)
_Atomic bool busy
Definition pipeline.c:73
Media source for video and audio capture.
Definition source.c:48
frame_slot_t frame_slots[3]
Definition pipeline.c:299
platform_thread_t encode_tid
Definition pipeline.c:292
atomic_t capture_finished
Definition pipeline.c:308
platform_wakeup_t * display_ready
Definition pipeline.c:301
platform_thread_t capture_tid
Definition pipeline.c:291
atomic_ptr_t display_pending
Definition pipeline.c:300
session_display_ctx_t * display
Definition pipeline.c:305
atomic_t first_frame_ns
Definition pipeline.c:309
frame_queue_t * encode_queue
Definition pipeline.c:302
session_capture_ctx_t * capture
Definition pipeline.c:304

References ASCIICHAT_OK, atomic_ptr_exchange(), atomic_ptr_store(), atomic_store_bool(), atomic_store_u64(), frame_slot_s::busy, session_pipeline_s::capture, session_pipeline_s::capture_finished, session_pipeline_s::capture_tid, session_pipeline_s::display, session_pipeline_s::display_pending, session_pipeline_s::display_ready, session_pipeline_s::encode_queue, session_pipeline_s::encode_tid, ERROR_INIT, ERROR_INVALID_PARAM, session_pipeline_s::first_frame_ns, session_pipeline_s::frame_slots, session_pipeline_s::has_render_file, log_debug, media_source_get_type(), MEDIA_SOURCE_STDIN, NAMED_REGISTER_ATOMIC, NAMED_REGISTER_ATOMIC_PTR, NAMED_UNREGISTER, out, PIPELINE_FRAME_SLOTS, SAFE_CALLOC, SAFE_FREE, session_capture_get_media_source(), session_display_get_render_fps(), session_display_has_render_file(), session_display_set_render_live_timing(), SET_ERRNO, source, and session_pipeline_s::stop.

Referenced by session_render_loop().

◆ session_pipeline_destroy()

asciichat_error_t session_pipeline_destroy ( session_pipeline_t * pipeline)

Stop threads and free pipeline.

Waits for capture and encode threads to exit cleanly.

Parameters
pipelinePipeline context (safe to call with NULL)
Returns
ASCIICHAT_OK

Definition at line 777 of file pipeline.c.

777 {
778 if (!pipeline)
779 return ASCIICHAT_OK;
780
781 log_debug("[PIPELINE] Destroying pipeline, waiting for threads...");
782
783 // Signal threads to stop (may already be stopped)
784 atomic_store_bool(&pipeline->stop, true);
786
787 // Wake up any threads blocked on condition variable waits
788 // so they can check the stop flag and exit immediately
789 // instead of waiting for timeouts (e.g., 100ms frame_queue_pop timeout)
790 platform_wakeup_signal(pipeline->display_ready);
791 if (pipeline->encode_queue) {
792 mutex_lock(&pipeline->encode_queue->mu);
793 cond_broadcast(&pipeline->encode_queue->not_empty);
794 cond_broadcast(&pipeline->encode_queue->not_full);
795 mutex_unlock(&pipeline->encode_queue->mu);
796 }
797
798 if (thread_is_initialized(&pipeline->input_tid) && thread_join(&pipeline->input_tid, NULL) != ASCIICHAT_OK)
799 return SET_ERRNO(ERROR_THREAD, "Cannot join session input thread during shutdown");
800 // During Ctrl-C the presentation thread may be inside terminal output. Its
801 // drain handshake waits for that output to complete and can deadlock the
802 // shutdown path. The pending frame is still released below; normal exits
803 // retain the full display drain.
805 session_display_begin_drain(pipeline->display, 0, false);
806
807 // A timeout must never let the owner free memory still referenced by a worker.
808 // Capture observes stop; encode drains its queue and exits once capture is done.
809 if (thread_is_initialized(&pipeline->capture_tid)) {
810 if (thread_join(&pipeline->capture_tid, NULL) != 0)
811 return SET_ERRNO(ERROR_THREAD, "Cannot join pipeline capture thread");
812 }
814 session_display_begin_drain(pipeline->display, pipeline->frames_accepted, true);
815 if (thread_is_initialized(&pipeline->encode_tid)) {
816 if (thread_join(&pipeline->encode_tid, NULL) != 0)
817 return SET_ERRNO(ERROR_THREAD, "Cannot join pipeline encode thread");
818 }
819
820 // Flush queues to free any remaining frames
821 free_frame(atomic_ptr_exchange(&pipeline->display_pending, NULL));
822 frame_queue_flush(pipeline->encode_queue, free_frame_generic);
823
824 frame_slots_destroy(pipeline->frame_slots);
825 platform_wakeup_destroy(pipeline->display_ready);
827 frame_queue_destroy(pipeline->encode_queue);
829 asciichat_error_t err = pipeline->capture_failure.code != ASCIICHAT_OK ? errno_import(&pipeline->capture_failure) : pipeline->encode_error;
830 if (pipeline->capture_failure.code != ASCIICHAT_OK)
831 LOG_ERRNO_IF_SET("Media capture failed");
832 SAFE_FREE(pipeline);
833
834 log_debug("[PIPELINE] Pipeline destroyed");
835 return err;
836}
asciichat_error_t errno_import(const asciichat_error_context_t *cause)
#define LOG_ERRNO_IF_SET(message)
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
@ ERROR_THREAD
void session_display_begin_drain(session_display_ctx_t *ctx, uint64_t total, bool total_known)
bool shutdown_is_requested(void)
Check if shutdown has been requested.
Definition common.c:87
void ascii_otel_pipeline_progress(unsigned stage, unsigned expected)
Definition otel.c:298
cond_t not_empty
Definition pipeline.c:85
cond_t not_full
Definition pipeline.c:86
mutex_t mu
Definition pipeline.c:84
uint64_t frames_accepted
Definition pipeline.c:312
platform_thread_t input_tid
Definition pipeline.c:293
asciichat_error_context_t capture_failure
Definition pipeline.c:310

References ascii_otel_pipeline_progress(), ASCIICHAT_OK, atomic_ptr_exchange(), atomic_store_bool(), session_pipeline_s::capture_failure, session_pipeline_s::capture_finished, session_pipeline_s::capture_tid, asciichat_error_context_t::code, session_pipeline_s::display, session_pipeline_s::display_pending, session_pipeline_s::display_ready, session_pipeline_s::encode_error, session_pipeline_s::encode_queue, session_pipeline_s::encode_tid, errno_import(), ERROR_THREAD, session_pipeline_s::frame_slots, session_pipeline_s::frames_accepted, session_pipeline_s::input_tid, log_debug, LOG_ERRNO_IF_SET, frame_queue_s::mu, NAMED_UNREGISTER, frame_queue_s::not_empty, frame_queue_s::not_full, SAFE_FREE, session_display_begin_drain(), SET_ERRNO, shutdown_is_requested(), and session_pipeline_s::stop.

Referenced by session_render_loop().

◆ session_pipeline_run_main()

asciichat_error_t session_pipeline_run_main ( session_pipeline_t * pipeline,
session_should_exit_fn should_exit,
session_keyboard_handler_fn keyboard_handler,
void * user_data )

Main thread loop: drives terminal output and keyboard handling.

Pops frames from display queue, converts to ASCII, writes to terminal. Handles snapshot delay timer and exit conditions.

Parameters
pipelinePipeline context created by session_pipeline_create()
should_exitCallback to check if rendering should stop
keyboard_handlerOptional keyboard handler callback
user_dataOpaque data passed to callbacks
Returns
ASCIICHAT_OK on success
Note
This function blocks until should_exit() returns true or capture ends. Signals capture/encode threads to stop before returning.

Definition at line 628 of file pipeline.c.

628 {
629 if (!pipeline || !should_exit) {
630 return SET_ERRNO(ERROR_INVALID_PARAM, "NULL argument");
631 }
632
633 log_debug("[PIPELINE_MAIN] Starting main thread loop");
634 uint64_t display_epoch = UINT64_MAX;
635 if (keyboard_handler && !GET_OPTION(snapshot_mode) && !(pipeline->has_render_file && !terminal_is_interactive())) {
636 pipeline->keyboard_handler = keyboard_handler;
637 pipeline->should_exit = should_exit;
638 pipeline->input_data = user_data;
639 atomic_store(&pipeline->input_start_status, 0);
640 if (platform_thread_create(&pipeline->input_tid, "pipeline_input", pipeline_input_thread, pipeline) != ASCIICHAT_OK)
641 return SET_ERRNO(ERROR_THREAD, "Cannot start responsive session input");
642 while (atomic_load(&pipeline->input_start_status) == 0)
643 platform_sleep_ms(1);
644 if (atomic_load(&pipeline->input_start_status) < 0) {
645 thread_join(&pipeline->input_tid, NULL);
646 return SET_ERRNO(ERROR_INIT, "Cannot initialize session keyboard input");
647 }
648 }
649
650 // Snapshot duration is owned by the capture thread. It records the first
651 // captured frame and marks capture_finished at its duration limit.
652 // The display thread waits for producer completion instead of using
653 // a second timer based on terminal rendering speed; large terminals can make
654 // ASCII conversion and render-file encoding substantially slower than capture.
655 while (!should_exit(user_data) && !atomic_load_bool(&pipeline->stop)) {
656 bool exit_check = should_exit(user_data);
657 log_debug_every(US_PER_SEC_INT, "[PIPELINE_DEBUG] should_exit=%d, stop=%d", exit_check, atomic_load_bool(&pipeline->stop));
658
659 platform_wakeup_wait(pipeline->display_ready, 100 * NS_PER_MS_INT);
660 pipeline_frame_t *frame = atomic_ptr_exchange(&pipeline->display_pending, NULL);
661
662 if (!frame) {
664 break;
665 continue;
666 }
667
668 ascii_otel_metric(ASCII_OTEL_METRIC_DISPLAY_DEPTH, 0);
669 double queue_age = (double)(time_get_ns() - frame->captured_ns) / 1e9;
670 ascii_otel_metric(ASCII_OTEL_METRIC_DISPLAY_WAIT, queue_age);
671 ascii_otel_metric(ASCII_OTEL_METRIC_QUEUE_OLDEST, queue_age);
672 ASCII_OTEL_SCOPE_PARENT(PIPELINE_DISPLAY, &frame->telemetry_context);
673 ascii_otel_scope_int(&otel_scope, "ascii_chat.queue.wait_ns", (int64_t)(time_get_ns() - frame->captured_ns));
674 // Validate frame structure exists before accessing fields
675 if (!frame_is_valid(frame)) {
676 ascii_otel_metric(ASCII_OTEL_METRIC_DROP_INVALID, 1);
677 log_error("Received invalid frame: corrupted or NULL");
678 free_frame(frame);
679 frame = NULL;
680 continue;
681 }
682
683 // A visualization frame may already be pending when the keyboard handler
684 // disables FFT/waveform. Do not let that stale synthetic frame flash before
685 // the first frame captured from the underlying webcam is displayed.
686 if (pipeline_frame_is_stale_visualization(frame)) {
687 ascii_otel_metric(ASCII_OTEL_METRIC_DROP_DISPLAY, 1);
688 free_frame(frame);
689 frame = NULL;
690 continue;
691 }
692
693 /* Visualization presentation replaces the captured image. Avoid running
694 * that image through the expensive glyph renderer only to discard it. */
695 if (frame->visualization) {
696 const bool fresh = frame->fresh;
697 const uint64_t epoch = frame->source_epoch;
698 const uint64_t acquisition_started_ns = frame->acquisition_started_ns;
699 free_frame(frame);
700 frame = NULL;
701 if (epoch == session_capture_source_epoch(pipeline->capture) && (GET_OPTION(waveform) || GET_OPTION(fft))) {
702 ui_controller_frame_acquired_at(acquisition_started_ns);
703 session_display_write_ascii_frame(pipeline->display, " ", fresh);
705 session_capture_complete_open(pipeline->capture, epoch);
706 }
707 continue;
708 }
709
710 // Check if help screen is active - if so, don't render ASCII frames
712 // Snapshot mode has no interactive prompt/log overlay. Do not discard its
713 // only captured frame because startup UI state is still settling.
714 bool help_is_active = !GET_OPTION(snapshot_mode) && (screen == UI_SCREEN_PROMPT || screen == UI_SCREEN_LOGS);
715
716 if (!help_is_active) {
717 // Convert to ASCII
718 if (display_epoch != frame->source_epoch) {
720 display_epoch = frame->source_epoch;
721 }
722 image_t tmp = {.w = frame->w, .h = frame->h, .pixels = (rgb_pixel_t *)frame->pixels};
723 uint64_t conversion_started_ns = time_get_ns();
724 char *ascii = session_display_convert_to_ascii_reuse(pipeline->display, &tmp);
725 uint64_t converted_ns = time_get_ns();
726 double read_ms = (double)(frame->captured_ns - frame->acquisition_started_ns) / NS_PER_MS_INT;
727 double queue_ms = (double)(conversion_started_ns - frame->captured_ns) / NS_PER_MS_INT;
728 double convert_ms = (double)(converted_ns - conversion_started_ns) / NS_PER_MS_INT;
729 uint64_t epoch = frame->source_epoch;
730 bool fresh = frame->fresh;
731 bool frame_visualization = frame->visualization;
732 uint64_t acquisition_started_ns = frame->acquisition_started_ns;
733 free_frame(frame);
734 frame = NULL;
735
736 if (ascii) {
737 // The option can change while conversion runs. Do not publish a
738 // synthetic visualization frame after KEY_3 has disabled it.
739 if (frame_visualization && !GET_OPTION(waveform) && !GET_OPTION(fft)) {
740 session_display_release_ascii(pipeline->display, ascii);
741 continue;
742 }
743 if (epoch == session_capture_source_epoch(pipeline->capture)) {
744 ui_controller_frame_acquired_at(acquisition_started_ns);
745 session_display_write_ascii_frame(pipeline->display, ascii, fresh);
747 uint64_t published_ns = time_get_ns();
748 ascii_otel_metric(ASCII_OTEL_METRIC_FRAME_DISPLAYED, 1);
750 ascii_otel_metric(ASCII_OTEL_METRIC_FRAME_LATENCY, (double)(published_ns - acquisition_started_ns) / 1e9);
751 session_capture_complete_open(pipeline->capture, epoch);
753 "LIVE_FRAME: capture_to_publish_ms=%.2f fresh=%d read_ms=%.2f queue_ms=%.2f convert_ms=%.2f "
754 "publish_ms=%.2f",
755 (double)(published_ns - acquisition_started_ns) / NS_PER_MS_INT, fresh, read_ms, queue_ms, convert_ms, (double)(published_ns - converted_ns) / NS_PER_MS_INT);
756 }
757 session_display_release_ascii(pipeline->display, ascii);
758 } else {
759 ascii_otel_metric(ASCII_OTEL_METRIC_DROP_CONVERT, 1);
760 log_error_every(US_PER_SEC_INT, "Failed to convert captured frame to ASCII; skipping display frame");
761 }
762 } else {
763 ascii_otel_metric(ASCII_OTEL_METRIC_DROP_SCREEN, 1);
764 free_frame(frame);
765 frame = NULL;
766 }
767 }
768
769 log_debug("[PIPELINE_MAIN] Main loop exiting, signaling threads to stop");
770 atomic_store_bool(&pipeline->stop, true);
772 if (thread_is_initialized(&pipeline->input_tid) && thread_join(&pipeline->input_tid, NULL) != ASCIICHAT_OK)
773 return SET_ERRNO(ERROR_THREAD, "Cannot join session input thread");
774 return ASCIICHAT_OK;
775}
bool atomic_load_bool(atomic_t *a)
Atomic pointer wrapper.
void * atomic_ptr_load(atomic_ptr_t *a)
Atomically load a pointer.
void session_capture_complete_open(session_capture_ctx_t *ctx, uint64_t epoch)
uint64_t session_capture_source_epoch(session_capture_ctx_t *ctx)
unsigned long long uint64_t
#define log_error(...)
Log an ERROR message.
Definition log/log.h:604
#define NS_PER_MS_INT
Definition time.h:172
#define US_PER_SEC_INT
Definition time.h:177
#define GET_OPTION(field)
Definition options.h:1339
#define log_debug_every(interval_us, fmt,...)
Rate-limited DEBUG logging.
Definition log/log.h:719
#define log_error_every(interval_us, fmt,...)
Rate-limited ERROR logging.
Definition log/log.h:728
bool should_exit(void)
Definition main.c:260
void ascii_otel_scope_int(ascii_otel_scope_t *s, const char *key, int64_t value)
Definition otel.c:871
void ascii_otel_metric(ascii_otel_metric_t metric, double value)
Definition otel.c:175
#define ASCII_OTEL_SCOPE_PARENT(id, parent)
Definition otel.h:98
void session_display_release_ascii(session_display_ctx_t *ctx, char *ascii)
void session_display_reset_stabilizer(session_display_ctx_t *ctx, bool recording)
char * session_display_convert_to_ascii_reuse(session_display_ctx_t *ctx, const image_t *image)
void session_display_write_ascii_frame(session_display_ctx_t *ctx, const char *ascii, bool fresh)
bool terminal_is_interactive(void)
uint64_t acquisition_started_ns
Definition pipeline.c:53
uint64_t source_epoch
Definition pipeline.c:48
uint64_t captured_ns
Definition pipeline.c:52
gotel_context_t telemetry_context
Definition pipeline.c:49
const uint8_t * pixels
Definition pipeline.c:46
session_should_exit_fn should_exit
Definition pipeline.c:296
atomic_int input_start_status
Definition pipeline.c:294
session_keyboard_handler_fn keyboard_handler
Definition pipeline.c:295
void ui_controller_frame_acquired_at(uint64_t started_ns)
int ui_controller_current_screen(void)
@ UI_SCREEN_PROMPT
@ UI_SCREEN_LOGS

References pipeline_frame_t::acquisition_started_ns, ascii_otel_metric(), ascii_otel_pipeline_progress(), ascii_otel_scope_int(), ASCII_OTEL_SCOPE_PARENT, ASCIICHAT_OK, atomic_load_bool(), atomic_ptr_exchange(), atomic_ptr_load(), atomic_store_bool(), session_pipeline_s::capture, session_pipeline_s::capture_finished, pipeline_frame_t::captured_ns, session_pipeline_s::display, session_pipeline_s::display_pending, session_pipeline_s::display_ready, ERROR_INIT, ERROR_INVALID_PARAM, ERROR_THREAD, pipeline_frame_t::fresh, GET_OPTION, pipeline_frame_t::h, session_pipeline_s::has_render_file, session_pipeline_s::input_data, session_pipeline_s::input_start_status, session_pipeline_s::input_tid, session_pipeline_s::keyboard_handler, log_debug, log_debug_every, log_error, log_error_every, NS_PER_MS_INT, pipeline_frame_t::pixels, session_capture_complete_open(), session_capture_source_epoch(), session_display_convert_to_ascii_reuse(), session_display_release_ascii(), session_display_reset_stabilizer(), session_display_write_ascii_frame(), SET_ERRNO, session_pipeline_s::should_exit, should_exit(), pipeline_frame_t::source_epoch, session_pipeline_s::stop, pipeline_frame_t::telemetry_context, terminal_is_interactive(), ui_controller_current_screen(), ui_controller_frame_acquired_at(), UI_SCREEN_LOGS, UI_SCREEN_PROMPT, US_PER_SEC_INT, pipeline_frame_t::visualization, and pipeline_frame_t::w.

Referenced by session_render_loop().

Variable Documentation

◆ g_snapshot_first_frame_rendered

bool g_snapshot_first_frame_rendered
extern