diff options
| author | 2026-07-02 18:31:31 -0400 | |
|---|---|---|
| committer | 2026-07-02 18:31:31 -0400 | |
| commit | f51b7c35c95a5c6ad50c9fc430780e6953f37dad (patch) | |
| tree | ca7557e147e918fda1284cc1a338c98b9d7e86f8 | |
| parent | 38cce5e94a10e5420e4685bbe5ebb1aade6d522f (diff) | |
| download | camu-f51b7c35c95a5c6ad50c9fc430780e6953f37dad.tar.gz camu-f51b7c35c95a5c6ad50c9fc430780e6953f37dad.tar.bz2 camu-f51b7c35c95a5c6ad50c9fc430780e6953f37dad.zip | |
Fix FFmpegless build
Signed-off-by: Andrew Opalach <andrew@akon.city>
| -rw-r--r-- | src/render/meson.build | 3 | ||||
| -rw-r--r-- | src/render/queue_libplacebo.c | 6 | ||||
| -rw-r--r-- | src/render/queue_libplacebo.h | 5 | ||||
| -rw-r--r-- | src/render/renderer_libplacebo.c | 11 | ||||
| -rw-r--r-- | src/screen/screen.c | 2 |
5 files changed, 18 insertions, 9 deletions
diff --git a/src/render/meson.build b/src/render/meson.build index 44d8255..9aee7af 100644 --- a/src/render/meson.build +++ b/src/render/meson.build @@ -162,6 +162,9 @@ elif get_option('renderer') == 'libplacebo' endif if get_option('subtitles').enabled() + if 'ffmpeg' not in get_option('codecs') + error('Subtitle support currently depends on FFmpeg.') + endif libass_found = false if 'libass' not in get_option('force_fallback_for') and get_option('wrap_mode') != 'forcefallback' libass = dependency('libass', required: false, allow_fallback: false) diff --git a/src/render/queue_libplacebo.c b/src/render/queue_libplacebo.c index f2a2898..57d60f6 100644 --- a/src/render/queue_libplacebo.c +++ b/src/render/queue_libplacebo.c @@ -111,8 +111,8 @@ static bool map_frame(pl_gpu gpu, pl_tex *tex, const struct pl_source_frame *src } if (frame->format == CAMU_PIXEL_FORMAT_GREY) { - out_frame->repr.sys = pl_system_from_av(AVCOL_SPC_BT470BG); - out_frame->repr.levels = pl_levels_from_av(AVCOL_RANGE_JPEG); + out_frame->repr.sys = PL_COLOR_SYSTEM_BT_601; // pl_system_from_av(AVCOL_SPC_BT470BG) + out_frame->repr.levels = PL_COLOR_LEVELS_FULL; // pl_levels_from_av(AVCOL_RANGE_JPEG) } else { out_frame->repr = pl_color_repr_unknown; } @@ -410,6 +410,7 @@ static void queue_lp_push_av_frame(struct camu_frame_queue *queue, AVFrame *fram } #endif +#ifdef CAMU_HAVE_SUBTITLES static bool convert_subtitle(struct camu_frame_queue_lp *lq, AVPacket *pkt) { AVSubtitle sub = { 0 }; @@ -429,6 +430,7 @@ static bool convert_subtitle(struct camu_frame_queue_lp *lq, AVPacket *pkt) } return false; } +#endif static void queue_lp_push_subtitle(struct camu_frame_queue *queue, struct camu_codec_packet *packet) { diff --git a/src/render/queue_libplacebo.h b/src/render/queue_libplacebo.h index f72cb88..c1a4388 100644 --- a/src/render/queue_libplacebo.h +++ b/src/render/queue_libplacebo.h @@ -1,13 +1,14 @@ #pragma once -#include <libplacebo/utils/frame_queue.h> #ifdef CAMU_HAVE_FFMPEG #include <al/lib.h> AL_IGNORE_WARNING("-Wswitch") -// PL_LIBAV_IMPLEMENTATION defined in queue_libplacebo.c. +// PL_LIBAV_IMPLEMENTATION defined in impl_libplacebo.c. #include <libplacebo/utils/libav.h> AL_IGNORE_WARNING_END #endif +#include <libplacebo/utils/upload.h> +#include <libplacebo/utils/frame_queue.h> #ifdef CAMU_HAVE_SUBTITLES #include <ass/ass.h> #endif diff --git a/src/render/renderer_libplacebo.c b/src/render/renderer_libplacebo.c index 704aebe..2bcbd64 100644 --- a/src/render/renderer_libplacebo.c +++ b/src/render/renderer_libplacebo.c @@ -8,11 +8,11 @@ #include "../screen/screen.h" #include "../util/color_palette.h" -#include "shaders/vr_video.h" - #include "renderer_libplacebo.h" #include "queue_libplacebo.h" +#include "shaders/vr_video.h" + #ifdef AL_DEBUG // vkQueueSubmit2: VK_ERROR_VALIDATION_FAILED_EXT leads to an annoying deadlock. #define RENDERER_DEBUG 1 @@ -22,6 +22,7 @@ #define CRT_BACKGROUND #define CRT_BACKGROUND_COLOR (1.f / 7.5f) +#define CRT_BACKGROUND_COLOR_ON (0.025f) #ifdef CRT_BACKGROUND static f32 clear_color[4] = { CRT_BACKGROUND_COLOR, CRT_BACKGROUND_COLOR, CRT_BACKGROUND_COLOR, 1.f }; @@ -494,9 +495,9 @@ static bool renderer_lp_render(struct camu_renderer *renderer, struct camu_scree #ifdef CRT_BACKGROUND if (!lr->frame_cleared) { if (lr->params.background != PL_CLEAR_SKIP) { - clear_color[0] = 0.025f; - clear_color[1] = 0.025f; - clear_color[2] = 0.025f; + clear_color[0] = CRT_BACKGROUND_COLOR_ON; + clear_color[1] = CRT_BACKGROUND_COLOR_ON; + clear_color[2] = CRT_BACKGROUND_COLOR_ON; } else { clear_color[0] = 0.f; clear_color[1] = 0.f; diff --git a/src/screen/screen.c b/src/screen/screen.c index ff36fe1..21715a6 100644 --- a/src/screen/screen.c +++ b/src/screen/screen.c @@ -216,7 +216,9 @@ static bool touch_callback(void *userdata, s32 index, u8 phase, f64 x, f64 y) scr->callback(scr->userdata, CAMU_SCREEN_TOGGLE_PAUSE, NULL); } else { if (scr->touch_mode) { +#if CAMU_HAVE_SUBTITLES scr->subtitles_enabled = !scr->subtitles_enabled; +#endif } else { s32 n = (x >= third) ? 1 : -1; scr->callback(scr->userdata, CAMU_SCREEN_SKIP, &n); |