|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🖥️ Terminal rendering, TTY management, and frame output More...
Files | |
| file | display.c |
| 💻 Client terminal display: TTY detection, frame rendering, and interactive/stdout output routing | |
| file | display.h |
| ascii-chat Client Display Management Interface | |
Functions | |
| void | display_set_context (session_display_ctx_t *display_ctx) |
| Set the display context created by session_client_like framework. | |
| int | display_init () |
| Initialize what is necessary to display ascii frames. | |
| bool | display_has_tty () |
| Check if display has TTY capability. | |
| void | display_full_reset () |
| Perform full display reset. | |
| void | display_reset_for_new_connection () |
| Reset display state for new connection. | |
| void | display_disable_logging_for_first_frame () |
| Disable terminal logging for first frame. | |
| void | display_render_frame (const char *frame_data) |
| Render ASCII frame to display. | |
| void | display_cleanup () |
| Cleanup display subsystem. | |
🖥️ Terminal rendering, TTY management, and frame output
The terminal display subsystem manages terminal initialization, ASCII frame rendering, TTY capability detection, and terminal cleanup.
Implementation: src/client/display.c, src/client/display.h
Problem: Log messages corrupt first frame display
Solution:
| void display_cleanup | ( | ) |
#include <display.c>
Cleanup display subsystem.
Destroys session display context and releases all resources including keyboard input handling.
Definition at line 362 of file src/client/display.c.
References session_capture_destroy().
| void display_disable_logging_for_first_frame | ( | ) |
#include <display.c>
Disable terminal logging for first frame.
Disables terminal logging before clearing the display for the first frame to prevent log output from interfering with ASCII display.
Call this before clearing the display for the first frame to prevent log output from interfering with ASCII display.
Definition at line 292 of file src/client/display.c.
References log_set_terminal_output(), and splash_intro_done().
Referenced by display_render_frame().
| void display_full_reset | ( | ) |
#include <display.c>
Perform full display reset.
Executes complete terminal reset sequence for clean display state. Safe to call multiple times and handles mode-specific behavior.
Definition at line 266 of file src/client/display.c.
References session_display_reset(), and should_exit().
Referenced by server_connection_lost().
| bool display_has_tty | ( | ) |
#include <display.c>
Check if display has TTY capability.
Definition at line 254 of file src/client/display.c.
References session_display_has_tty().
| int display_init | ( | ) |
#include <display.c>
Initialize what is necessary to display ascii frames.
Initialize display subsystem.
Creates session display context for TTY management and frame rendering. Must be called once during client startup.
Definition at line 180 of file src/client/display.c.
References session_capture_create(), session_display_create(), session_display_ctx::snapshot_mode, and terminal_is_stdin_tty().
| void display_render_frame | ( | const char * | frame_data | ) |
#include <display.c>
Render ASCII frame to display.
Render ASCII frame to display
Uses session display library for frame output routing based on display mode and snapshot requirements. Also polls for keyboard input for interactive controls (volume, color mode, flip).
| frame_data | ASCII frame data to render |
| is_snapshot_frame | Whether this is the final snapshot frame |
| frame_data | ASCII frame data to render |
Definition at line 315 of file src/client/display.c.
References display_disable_logging_for_first_frame(), session_display_is_help_active(), session_display_render_frame(), session_display_render_help(), and session_handle_keyboard_input().
| void display_reset_for_new_connection | ( | ) |
#include <display.c>
Reset display state for new connection.
Resets the first frame tracking flag to prepare for a new connection. Call this when starting a new connection to reset first frame tracking.
Call this when starting a new connection to reset first frame tracking.
Definition at line 280 of file src/client/display.c.
Referenced by protocol_start_connection().
| void display_set_context | ( | session_display_ctx_t * | display_ctx | ) |
#include <display.c>
Set the display context created by session_client_like framework.
Set the display context (framework integration)
Client mode doesn't create its own display context anymore. Instead, session_client_like_run() creates it and passes it to client_run(). This setter allows client_run() to make the framework-created context available to protocol threads that need to render frames.
| display_ctx | Display context created by framework (may be NULL) |
Called by client_run() to pass the display context created by session_client_like_run() to the display module so protocol threads can render frames.
| display_ctx | Display context from framework (may be NULL) |
Definition at line 162 of file src/client/display.c.