summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/meson.build3
-rw-r--r--src/render/queue_libplacebo.c6
-rw-r--r--src/render/queue_libplacebo.h5
-rw-r--r--src/render/renderer_libplacebo.c11
4 files changed, 16 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;