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

render_file_* — ties together font resolution, platform renderer, FFmpeg encoder More...

Go to the source code of this file.

Data Structures

struct  render_file_ctx_s
 For render file ctx, this is the live record that ties progress, error, renderer, encoder 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 RENDER_AUTO_FONT_SIZE_PT   12.0
#define RENDER_AUTO_VIDEO_MAX_DIMENSION   1280
#define RENDER_AUTO_MIN_FONT_SIZE_PT   3.0

Functions

asciichat_error_t render_file_create (const char *output_path, int cols, int rows, int fps, int theme, render_file_ctx_t **out)
void render_file_set_live_timing (render_file_ctx_t *ctx)
asciichat_error_t render_file_write_frame (render_file_ctx_t *ctx, const char *frame, uint64_t captured_ns)
void render_file_begin_drain (render_file_ctx_t *ctx, uint64_t total, bool total_known)
void render_file_set_snapshot_actual_duration (render_file_ctx_t *ctx, double actual_duration_sec)
asciichat_error_t render_file_destroy (render_file_ctx_t *ctx)

Detailed Description

render_file_* — ties together font resolution, platform renderer, FFmpeg encoder

Definition in file renderer.c.

Macro Definition Documentation

◆ RENDER_AUTO_FONT_SIZE_PT

#define RENDER_AUTO_FONT_SIZE_PT   12.0

Definition at line 23 of file renderer.c.

Referenced by render_file_create().

◆ RENDER_AUTO_MIN_FONT_SIZE_PT

#define RENDER_AUTO_MIN_FONT_SIZE_PT   3.0

Definition at line 25 of file renderer.c.

Referenced by render_file_create().

◆ RENDER_AUTO_VIDEO_MAX_DIMENSION

#define RENDER_AUTO_VIDEO_MAX_DIMENSION   1280

Definition at line 24 of file renderer.c.

Referenced by render_file_create().

Function Documentation

◆ render_file_begin_drain()

void render_file_begin_drain ( render_file_ctx_t * ctx,
uint64_t total,
bool total_known )

Definition at line 345 of file renderer.c.

345 {
346 if (ctx)
347 render_progress_begin(ctx->progress, total, total_known);
348}
void render_progress_begin(render_progress_t *progress, uint64_t total, bool total_known)
render_progress_t * progress
Definition renderer.c:33

References render_file_ctx_s::progress, and render_progress_begin().

Referenced by session_display_begin_drain().

◆ render_file_create()

asciichat_error_t render_file_create ( const char * output_path,
int cols,
int rows,
int fps,
int theme,
render_file_ctx_t ** out )

Definition at line 53 of file renderer.c.

53 {
54 if (!output_path || !out || cols <= 0 || rows <= 0)
55 return SET_ERRNO(ERROR_INVALID_PARAM, "Missing render output, grid, or context");
56 *out = NULL;
57 log_info("output_path=%s, cols=%d, rows=%d, fps=%d, theme=%d, out=%p", output_path ? output_path : "(null)", cols, rows, fps, theme, (void *)out);
58 render_file_ctx_t *ctx = SAFE_CALLOC(1, sizeof(*ctx), render_file_ctx_t *);
59 if (strcmp(output_path, "/dev/null") == 0) {
60 ctx->discard = true;
61 ctx->error = ASCIICHAT_OK;
62 *out = ctx;
63 return ASCIICHAT_OK;
64 }
65 ctx->kitty_only = strcmp(output_path, "--kitty") == 0;
66 ctx->kitty = ctx->kitty_only || GET_OPTION(render_kitty);
67 if (ctx->kitty && !GET_OPTION(snapshot_mode)) {
68 SAFE_FREE(ctx);
69 return SET_ERRNO(ERROR_INVALID_PARAM, "Kitty graphics output requires --snapshot");
70 }
71 if (ctx->kitty && (strcmp(output_path, "-") == 0 || strcmp(output_path, "pipe:") == 0)) {
72 SAFE_FREE(ctx);
73 return SET_ERRNO(ERROR_INVALID_PARAM, "Kitty graphics and binary media cannot share stdout");
74 }
75 const char *term = SAFE_GETENV("TERM");
76 if (ctx->kitty && terminal_is_stdout_tty() && (!term || strcmp(term, "dumb") == 0 || strcmp(term, "linux") == 0 || strcmp(term, "vt100") == 0)) {
77 SAFE_FREE(ctx);
78 return SET_ERRNO(ERROR_NOT_SUPPORTED, "Kitty graphics require a capable terminal; redirect stdout to export the protocol");
79 }
80
81 // Resolve font spec → platform-appropriate file path, family name, or bundled data.
82 char font_spec[PLATFORM_MAX_PATH_LENGTH] = {0};
83 bool font_is_path = false;
84 const uint8_t *font_data = NULL;
85 size_t font_data_size = 0;
86 const char *raw_font = GET_OPTION(render_font);
87
88 // Log the font option value from GET_OPTION (for WASM font debugging)
89 log_info("[WASM_FONT_GETTER] GET_OPTION(render_font) returned: '%s' (empty=%d), GET_OPTION(matrix_rain)=%d", raw_font ? raw_font : "(null)", (!raw_font || raw_font[0] == '\0') ? 1 : 0,
90 GET_OPTION(matrix_rain));
91
92 // Auto-select matrix font when --matrix flag is set, unless user explicitly overrides with --render-font
93 log_debug("raw_font=%s, matrix_rain=%d", raw_font, GET_OPTION(matrix_rain));
94 if ((!raw_font || raw_font[0] == '\0') && GET_OPTION(matrix_rain)) {
95 raw_font = "matrix";
96 log_debug("[MATRIX] Using matrix font (enabled by --matrix flag)");
97 }
98
99 platform_font_register("matrix", g_font_matrix_resurrected, g_font_matrix_resurrected_size);
100 platform_font_register("default", g_font_default, g_font_default_size);
101 platform_font_register("DejaVu Sans Mono", g_font_default, g_font_default_size);
102 asciichat_error_t fe = platform_font_resolve(raw_font, font_spec, sizeof(font_spec), &font_is_path, &font_data, &font_data_size);
103 if (fe != ASCIICHAT_OK) {
104 if (raw_font && raw_font[0]) {
105 SAFE_FREE(ctx);
106 return fe;
107 }
108 log_warn("font resolution failed for '%s' — using bundled default", raw_font ? raw_font : "(explicit system)");
109 fe = platform_font_resolve("default", font_spec, sizeof(font_spec), &font_is_path, &font_data, &font_data_size);
110 if (fe != ASCIICHAT_OK) {
111 SAFE_FREE(ctx);
112 return fe;
113 }
114 }
115
116 log_debug("Font resolved: font_spec='%s', font_is_path=%d, font_data=%p (size=%zu)", font_spec, font_is_path, (void *)font_data, font_data_size);
117
118 // A zero size selects a compact default for video; explicit font sizes keep
119 // their exact dimensions. Images and Kitty snapshots retain the 12 pt default.
120 double font_size_pt = GET_OPTION(render_font_size);
121 const char *extension = strrchr(output_path, '.');
122 bool is_image = extension && (!strcmp(extension, ".png") || !strcmp(extension, ".jpg") || !strcmp(extension, ".jpeg") || !strcmp(extension, ".bmp") || !strcmp(extension, ".webp"));
123 bool automatic_video_size = font_size_pt == 0.0 && !is_image && !ctx->kitty;
124 if (font_size_pt == 0.0) {
125 font_size_pt = RENDER_AUTO_FONT_SIZE_PT;
126 if (automatic_video_size) {
127 double width_scale = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / ((double)cols * 10.0);
128 double height_scale = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / ((double)rows * 20.0);
129 double scale = width_scale < height_scale ? width_scale : height_scale;
130 if (scale < 1.0)
131 font_size_pt *= scale;
132 if (font_size_pt < RENDER_AUTO_MIN_FONT_SIZE_PT)
133 font_size_pt = RENDER_AUTO_MIN_FONT_SIZE_PT;
134 }
135 }
136 term_renderer_theme_t resolved_theme = (term_renderer_theme_t)theme;
137 if (resolved_theme == TERM_RENDERER_THEME_AUTO) {
139 log_debug("auto theme resolved to %s", resolved_theme == TERM_RENDERER_THEME_DARK ? "dark" : "light");
140 }
141
142 term_renderer_config_t tr_cfg = {
143 .cols = cols,
144 .rows = rows,
145 .font_size_pt = font_size_pt,
146 .theme = resolved_theme,
147 .font_is_path = font_is_path,
148 .font_data = font_data,
149 .font_data_size = font_data_size,
150 };
151 SAFE_STRNCPY(tr_cfg.font_spec, font_spec, sizeof(tr_cfg.font_spec));
152
153 asciichat_error_t err = term_renderer_create(&tr_cfg, &ctx->renderer);
154 if (err != ASCIICHAT_OK) {
155 log_error("term_renderer_create failed: %s", asciichat_error_format(NULL, err));
156 SAFE_FREE(ctx);
157 return err;
158 }
159 int actual_width_px = term_renderer_width_px(ctx->renderer);
160 int actual_height_px = term_renderer_height_px(ctx->renderer);
161 // Hinting and font metrics vary. Recalculate once if the initial estimate
162 // exceeds the target, retaining the original renderer if a bitmap font
163 // cannot be scaled down.
164 if (automatic_video_size && (actual_width_px > RENDER_AUTO_VIDEO_MAX_DIMENSION || actual_height_px > RENDER_AUTO_VIDEO_MAX_DIMENSION) && font_size_pt > RENDER_AUTO_MIN_FONT_SIZE_PT) {
165 double width_scale = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / actual_width_px;
166 double height_scale = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / actual_height_px;
167 double scale = width_scale < height_scale ? width_scale : height_scale;
168 double smaller = font_size_pt * scale * 0.98;
169 if (smaller < RENDER_AUTO_MIN_FONT_SIZE_PT)
171 tr_cfg.font_size_pt = smaller;
172 terminal_renderer_t *candidate = NULL;
173 err = term_renderer_create(&tr_cfg, &candidate);
174 if (err == ASCIICHAT_OK) {
175 int candidate_width = term_renderer_width_px(candidate);
176 int candidate_height = term_renderer_height_px(candidate);
177 if (candidate_width <= actual_width_px && candidate_height <= actual_height_px && (candidate_width < actual_width_px || candidate_height < actual_height_px)) {
179 ctx->renderer = candidate;
180 actual_width_px = candidate_width;
181 actual_height_px = candidate_height;
182 } else {
183 term_renderer_destroy(candidate);
184 }
185 } else {
187 SAFE_FREE(ctx);
188 return err;
189 }
190 }
191 log_info("GRID DIMENSIONS: %ux%u cells -> PIXEL DIMENSIONS: %dx%d px", cols, rows, actual_width_px, actual_height_px);
192 log_debug("term_renderer created (%dx%d cells, %dx%d px)", cols, rows, actual_width_px, actual_height_px);
193
194 if (ctx->kitty_only) {
195 ctx->fps = fps;
196 ctx->progress = render_progress_create(true, "terminal");
197 NAMED_REGISTER_CONTEXT(ctx, "render_file_ctx", output_path, NULL);
199 *out = ctx;
200 return ASCIICHAT_OK;
201 }
202 int output_width_px = actual_width_px;
203 int output_height_px = actual_height_px;
204 if (automatic_video_size && (output_width_px > RENDER_AUTO_VIDEO_MAX_DIMENSION || output_height_px > RENDER_AUTO_VIDEO_MAX_DIMENSION)) {
205 double scale_x = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / output_width_px;
206 double scale_y = (double)RENDER_AUTO_VIDEO_MAX_DIMENSION / output_height_px;
207 double scale = scale_x < scale_y ? scale_x : scale_y;
208 output_width_px = ((int)(output_width_px * scale)) & ~1;
209 output_height_px = ((int)(output_height_px * scale)) & ~1;
210 if (output_width_px < 2)
211 output_width_px = 2;
212 if (output_height_px < 2)
213 output_height_px = 2;
214 }
215 err = ffmpeg_encoder_create_scaled(output_path, actual_width_px, actual_height_px, output_width_px, output_height_px, fps, &ctx->encoder);
216 if (err != ASCIICHAT_OK) {
217 log_error("ffmpeg_encoder_create failed: %s", asciichat_error_format(NULL, err));
219 SAFE_FREE(ctx);
220 return err;
221 }
222 log_debug("ffmpeg_encoder created successfully");
223
224 // Initialize audio fields
225 ctx->audio_sample_rate = 48000; // Audio pipeline is 48kHz
226 ctx->fps = fps;
227 // Allocate large buffer for snapshot mode (5 seconds at 48kHz with ~14 FPS = 3,428 samples per frame)
228 // Use 8192 to comfortably handle snapshot reads without excessive overhead
229 ctx->audio_buf_size = 8192; // Temporary buffer for reading audio (in floats)
230 ctx->audio_read_buf = SAFE_MALLOC(ctx->audio_buf_size * sizeof(float), float *);
231
233 if (err != ASCIICHAT_OK) {
237 SAFE_FREE(ctx);
238 return err;
239 }
240 log_info("initialized encoder for %s", output_path);
241
242 // Register render file context for debugging
243 NAMED_REGISTER_CONTEXT(ctx, "render_file_ctx", output_path, NULL);
244
245 bool binary_stdout = strcmp(output_path, "-") == 0 || strcmp(output_path, "pipe:") == 0;
246 ctx->progress = render_progress_create(!binary_stdout, output_path);
248 *out = ctx;
249 return ASCIICHAT_OK;
250}
const char * asciichat_error_format(const char *message, asciichat_error_t code)
#define SET_ERRNO(code,...)
terminal_background_t colorscheme_current_background(void)
@ TERM_BACKGROUND_DARK
Definition colorscheme.h:71
asciichat_error_t ffmpeg_encoder_create_scaled(const char *output_path, int source_width, int source_height, int width_px, int height_px, int fps, ffmpeg_encoder_t **out)
asciichat_error_t ffmpeg_encoder_destroy(ffmpeg_encoder_t *enc)
#define SAFE_STRNCPY(dst, src, size)
#define SAFE_FREE(ptr)
#define SAFE_MALLOC(size, cast)
#define SAFE_GETENV(name)
#define SAFE_CALLOC(count, size, cast)
unsigned char uint8_t
#define NAMED_REGISTER_CONTEXT(context, context_type, name, parent_ptr)
Register a generic context with automatic format specifier.
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM
@ ERROR_NOT_SUPPORTED
Definition error_codes.h:74
#define log_warn(...)
Log a WARN message.
Definition log/log.h:591
#define log_error(...)
Log an ERROR message.
Definition log/log.h:604
#define log_info(...)
Log an INFO message.
Definition log/log.h:578
#define log_debug(...)
Log a DEBUG message.
Definition log/log.h:565
#define GET_OPTION(field)
Definition options.h:1339
const size_t g_font_matrix_resurrected_size
const unsigned char g_font_matrix_resurrected[]
const size_t g_font_default_size
const unsigned char g_font_default[]
int term_renderer_width_px(terminal_renderer_t *r)
asciichat_error_t term_renderer_create(const term_renderer_config_t *cfg, terminal_renderer_t **out)
void term_renderer_destroy(terminal_renderer_t *r)
int term_renderer_height_px(terminal_renderer_t *r)
static bool size_t gotel_query_t * out
Definition queries.h:10
asciichat_error_t audio_recording_create_channels(audio_recording_t **out, unsigned channels)
Definition recording.c:35
render_progress_t * render_progress_create(bool enabled, const char *destination)
#define RENDER_AUTO_VIDEO_MAX_DIMENSION
Definition renderer.c:24
#define RENDER_AUTO_FONT_SIZE_PT
Definition renderer.c:23
#define RENDER_AUTO_MIN_FONT_SIZE_PT
Definition renderer.c:25
struct terminal_renderer_s terminal_renderer_t
Definition renderer.h:22
term_renderer_theme_t
Terminal rendering theme.
Definition renderer.h:31
@ TERM_RENDERER_THEME_LIGHT
Definition renderer.h:33
@ TERM_RENDERER_THEME_DARK
Definition renderer.h:32
@ TERM_RENDERER_THEME_AUTO
Definition renderer.h:34
struct render_file_ctx_s render_file_ctx_t
Definition renderer.h:69
bool terminal_is_stdout_tty(void)
asciichat_error_t error
Definition renderer.c:34
terminal_renderer_t * renderer
Definition renderer.c:35
ffmpeg_encoder_t * encoder
Definition renderer.c:36
uint32_t audio_sample_rate
Definition renderer.c:47
audio_recording_t * recording
Definition renderer.c:37
float * audio_read_buf
Definition renderer.c:49
char font_spec[PLATFORM_MAX_PATH_LENGTH]
Definition renderer.h:42
void ui_controller_title_render(ui_title_render_t phase)
@ UI_TITLE_RENDERING

References asciichat_error_format(), ASCIICHAT_OK, render_file_ctx_s::audio_buf_size, render_file_ctx_s::audio_read_buf, audio_recording_create_channels(), render_file_ctx_s::audio_sample_rate, colorscheme_current_background(), render_file_ctx_s::discard, render_file_ctx_s::encoder, render_file_ctx_s::error, ERROR_INVALID_PARAM, ERROR_NOT_SUPPORTED, ffmpeg_encoder_create_scaled(), ffmpeg_encoder_destroy(), term_renderer_config_t::font_size_pt, term_renderer_config_t::font_spec, render_file_ctx_s::fps, g_font_default, g_font_default_size, g_font_matrix_resurrected, g_font_matrix_resurrected_size, GET_OPTION, render_file_ctx_s::kitty, render_file_ctx_s::kitty_only, log_debug, log_error, log_info, log_warn, NAMED_REGISTER_CONTEXT, out, render_file_ctx_s::progress, render_file_ctx_s::recording, RENDER_AUTO_FONT_SIZE_PT, RENDER_AUTO_MIN_FONT_SIZE_PT, RENDER_AUTO_VIDEO_MAX_DIMENSION, render_progress_create(), render_file_ctx_s::renderer, SAFE_CALLOC, SAFE_FREE, SAFE_GETENV, SAFE_MALLOC, SAFE_STRNCPY, SET_ERRNO, TERM_BACKGROUND_DARK, term_renderer_create(), term_renderer_destroy(), term_renderer_height_px(), TERM_RENDERER_THEME_AUTO, TERM_RENDERER_THEME_DARK, TERM_RENDERER_THEME_LIGHT, term_renderer_width_px(), terminal_is_stdout_tty(), ui_controller_title_render(), and UI_TITLE_RENDERING.

Referenced by session_display_init_render_file().

◆ render_file_destroy()

asciichat_error_t render_file_destroy ( render_file_ctx_t * ctx)

Definition at line 356 of file renderer.c.

356 {
357 if (!ctx)
358 return ASCIICHAT_OK;
359 if (ctx->discard) {
360 SAFE_FREE(ctx);
361 return ASCIICHAT_OK;
362 }
363 NAMED_UNREGISTER(ctx);
366 uint64_t target = ctx->audio_target;
368 while (ctx->audio_samples_written < target) {
369 int count = (int)((target - ctx->audio_samples_written) > (uint64_t)ctx->audio_buf_size ? (uint64_t)ctx->audio_buf_size : target - ctx->audio_samples_written);
371 err = ffmpeg_encoder_write_audio(ctx->encoder, ctx->audio_read_buf, count);
372 if (err != ASCIICHAT_OK)
373 break;
374 ctx->audio_samples_written += count;
375 }
378 if (err == ASCIICHAT_OK)
379 err = close_err;
380 if (ctx->error != ASCIICHAT_OK)
381 err = ctx->error;
383 if (err == ASCIICHAT_OK && ctx->kitty && ctx->frames_written == 0)
384 err = SET_ERRNO(ERROR_MEDIA_INIT, "No snapshot was rendered for Kitty output");
385 if (err == ASCIICHAT_OK && ctx->kitty && ctx->frames_written > 0)
390 SAFE_FREE(ctx);
391 return err;
392}
asciichat_error_t ffmpeg_encoder_write_audio(ffmpeg_encoder_t *enc, const float *samples, int num_samples)
unsigned long long uint64_t
#define NAMED_UNREGISTER(ptr)
Unregister a pointer.
@ ERROR_MEDIA_INIT
Definition error_codes.h:70
const uint8_t * term_renderer_pixels(terminal_renderer_t *r)
int term_renderer_pitch(terminal_renderer_t *r)
asciichat_error_t kitty_image_write(FILE *stream, const uint8_t *rgba, int width, int height, int pitch)
void audio_recording_read(audio_recording_t *recording, float *samples, size_t count)
Definition recording.c:145
void audio_recording_destroy(audio_recording_t *recording)
Definition recording.c:59
void render_progress_finalize(render_progress_t *progress)
void render_progress_destroy(render_progress_t *progress)
uint64_t audio_samples_written
Definition renderer.c:39
uint64_t frames_written
Definition renderer.c:38
uint64_t audio_target
Definition renderer.c:42
@ UI_TITLE_FINALIZING
@ UI_TITLE_FAILED
@ UI_TITLE_IDLE

References ASCIICHAT_OK, render_file_ctx_s::audio_buf_size, render_file_ctx_s::audio_read_buf, audio_recording_destroy(), audio_recording_read(), render_file_ctx_s::audio_samples_written, render_file_ctx_s::audio_target, render_file_ctx_s::discard, render_file_ctx_s::encoder, render_file_ctx_s::error, ERROR_MEDIA_INIT, ffmpeg_encoder_destroy(), ffmpeg_encoder_write_audio(), render_file_ctx_s::frames_written, render_file_ctx_s::kitty, kitty_image_write(), NAMED_UNREGISTER, render_file_ctx_s::progress, render_file_ctx_s::recording, render_progress_destroy(), render_progress_finalize(), render_file_ctx_s::renderer, SAFE_FREE, SET_ERRNO, term_renderer_destroy(), term_renderer_height_px(), term_renderer_pitch(), term_renderer_pixels(), term_renderer_width_px(), ui_controller_title_render(), UI_TITLE_FAILED, UI_TITLE_FINALIZING, and UI_TITLE_IDLE.

Referenced by session_display_finish_render_file().

◆ render_file_set_live_timing()

void render_file_set_live_timing ( render_file_ctx_t * ctx)

Definition at line 252 of file renderer.c.

252 {
253 if (ctx) {
254 ctx->live_timing = true;
255 if (ctx->encoder)
257 }
258}
void ffmpeg_encoder_set_live_timing(ffmpeg_encoder_t *enc)

References render_file_ctx_s::encoder, ffmpeg_encoder_set_live_timing(), and render_file_ctx_s::live_timing.

Referenced by session_display_render_frame(), and session_display_set_render_live_timing().

◆ render_file_set_snapshot_actual_duration()

void render_file_set_snapshot_actual_duration ( render_file_ctx_t * ctx,
double actual_duration_sec )

Definition at line 350 of file renderer.c.

350 {
351 if (!ctx || !ctx->encoder)
352 return;
353 ffmpeg_encoder_set_snapshot_actual_duration(ctx->encoder, actual_duration_sec);
354}
void ffmpeg_encoder_set_snapshot_actual_duration(ffmpeg_encoder_t *enc, double actual_duration_sec)

References render_file_ctx_s::encoder, and ffmpeg_encoder_set_snapshot_actual_duration().

Referenced by session_display_set_snapshot_actual_duration().

◆ render_file_write_frame()

asciichat_error_t render_file_write_frame ( render_file_ctx_t * ctx,
const char * frame,
uint64_t captured_ns )

Definition at line 329 of file renderer.c.

329 {
330 if (!ctx || !frame)
331 return SET_ERRNO(ERROR_INVALID_PARAM, "Missing render context or frame");
332 if (ctx->error != ASCIICHAT_OK)
333 return ctx->error;
334 if (ctx->discard)
335 return ASCIICHAT_OK;
336 asciichat_error_t err = render_file_write_frame_internal(ctx, frame, captured_ns);
337 if (err != ASCIICHAT_OK)
339 render_progress_frame(ctx->progress, frame, err == ASCIICHAT_OK);
340 if (err != ASCIICHAT_OK)
341 ctx->error = err;
342 return err;
343}
void render_progress_frame(render_progress_t *progress, const char *frame, bool succeeded)

References ASCIICHAT_OK, render_file_ctx_s::discard, render_file_ctx_s::error, ERROR_INVALID_PARAM, render_file_ctx_s::progress, render_progress_frame(), SET_ERRNO, ui_controller_title_render(), and UI_TITLE_FAILED.

Referenced by session_display_encode_frame(), and session_display_render_frame().