summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--cross/x86_64-w64-mingw32.txt3
-rw-r--r--flake.lock12
-rw-r--r--flake.nix45
-rw-r--r--meson.build21
-rw-r--r--meson_options.txt1
-rw-r--r--src/bimu/client.c5
-rw-r--r--src/bimu/client.h6
-rw-r--r--src/bimu/handler.h8
-rw-r--r--src/bimu/handlers/codec_server.c6
-rw-r--r--src/bimu/server.c4
-rw-r--r--src/bimu/server.h6
-rw-r--r--src/buffer/video.c2
-rw-r--r--src/codec/codec.h4
-rw-r--r--src/codec/libav/demuxer.c17
-rw-r--r--src/codec/libav/demuxer.h4
-rw-r--r--src/codec/libav/resampler.c2
-rw-r--r--src/codec/meson.build17
-rw-r--r--src/codec/spng/impl.c4
-rw-r--r--src/codec/stb_image/impl.c4
-rw-r--r--src/codec/wuffs/impl.c4
-rw-r--r--src/fruits/sink/meson.build8
-rw-r--r--src/mixer/meson.build11
-rw-r--r--src/mixer/mixer.c1
-rw-r--r--src/render/queue_libplacebo.c2
-rw-r--r--src/render/queue_tiger.h2
-rw-r--r--src/render/renderer_tiger.h2
-rw-r--r--src/screen/screen.c1
-rw-r--r--src/screen/view.c4
-rw-r--r--subprojects/ffmpeg.wrap8
-rw-r--r--subprojects/packagefiles/ffmpeg/meson.build19
-rw-r--r--subprojects/shaderc/meson.build2
-rw-r--r--subprojects/zlib.wrap5
33 files changed, 144 insertions, 103 deletions
diff --git a/.gitignore b/.gitignore
index c4b932a..d8be8e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,10 +10,12 @@ old/
old_old/
subprojects/c89atomic/
subprojects/c89atomic.wrap
-subprojects/curl.wrap
-subprojects/ffmpeg-6.1/
+subprojects/libcurl/
+subprojects/libcurl.wrap
+subprojects/ffmpeg-6.1.1/
subprojects/glfw3/
subprojects/glfw3.wrap
+subprojects/jansson/
subprojects/jansson.wrap
subprojects/libakiyo
subprojects/libalabaster
@@ -28,7 +30,6 @@ subprojects/miniaudio/
subprojects/packagecache/
subprojects/sekihi
subprojects/shaderc/include/
-subprojects/shaderc/install/
subprojects/shaderc/lib/
subprojects/shoki
subprojects/stb/
diff --git a/cross/x86_64-w64-mingw32.txt b/cross/x86_64-w64-mingw32.txt
index 05ba3b0..bc95ac2 100644
--- a/cross/x86_64-w64-mingw32.txt
+++ b/cross/x86_64-w64-mingw32.txt
@@ -8,7 +8,8 @@ strip = 'x86_64-w64-mingw32-strip'
exe_wrapper = 'wine64'
[properties]
-needs_exe_wrapper = true
+nm = 'x86_64-w64-mingw32-nm'
+ar = 'x86_64-w64-mingw32-ar'
[host_machine]
system = 'windows'
diff --git a/flake.lock b/flake.lock
index f215f80..95c5e08 100644
--- a/flake.lock
+++ b/flake.lock
@@ -5,11 +5,11 @@
"systems": "systems"
},
"locked": {
- "lastModified": 1701680307,
- "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
+ "lastModified": 1705309234,
+ "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
+ "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1704538339,
- "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=",
+ "lastModified": 1705133751,
+ "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701",
+ "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index 6c0c989..9227fef 100644
--- a/flake.nix
+++ b/flake.nix
@@ -7,7 +7,8 @@
flake-utils.lib.eachDefaultSystem
(system:
let
- pkgs = import nixpkgs { inherit system; };
+ overlays = [];
+ pkgs = import nixpkgs { inherit overlays; inherit system; };
in
with pkgs;
rec {
@@ -21,9 +22,6 @@
gcc13
nasm
pkg-config
- libtool
- automake
- autoconf
ninja
meson
cmake
@@ -39,7 +37,7 @@
alsa-lib
pipewire
libpulseaudio
-# libplacebo
+ #libplacebo
xxHash
lcms
shaderc
@@ -55,9 +53,6 @@
egl-wayland
notcurses
];
- mesonFlags = [
- "-Dwrap_mode=default"
- ];
meta = with lib; {
homepage = "";
description = "";
@@ -77,14 +72,44 @@
python3
python3.pkgs.requests
python3.pkgs.pip
- python3.pkgs.cython
+ python3.pkgs.cython_3
python3.pkgs.setuptools
nodePackages.pyright
asciidoc
];
buildInputs = packages.default.buildInputs ++ [];
shellHook = ''
- export NIX_SHELL=true
+ export NIX_SHELL="develop"
+ unset SOURCE_DATE_EPOCH
+ exec ${pkgs.zsh}/bin/zsh
+ '';
+ };
+
+ devShells.mingw64 = let
+ gcc = pkgsCross.mingwW64.buildPackages.wrapCC (pkgsCross.mingwW64.buildPackages.gcc-unwrapped.override ({
+ threadsCross = {
+ model = "win32";
+ package = null;
+ };
+ }));
+ gccWin32Stdenv = overrideCC pkgsCross.mingwW64.stdenv gcc;
+ in mkShell.override { stdenv = gccWin32Stdenv; } {
+ NIX_HARDENING_ENABLE = "";
+ nativeBuildInputs = [
+ git
+ buildPackages.gcc
+ nasm
+ pkg-config
+ meson
+ ninja
+ cmake
+ python3
+ ];
+ buildInputs = with pkgsCross.mingwW64; [
+ (zlib.override { shared = false; static = true; })
+ ];
+ shellHook = ''
+ export NIX_SHELL="mingw64"
unset SOURCE_DATE_EPOCH
exec ${pkgs.zsh}/bin/zsh
'';
diff --git a/meson.build b/meson.build
index 3bc60fb..30887a0 100644
--- a/meson.build
+++ b/meson.build
@@ -5,14 +5,17 @@ compiler = meson.get_compiler('c')
cmake = import('cmake')
is_debug = get_option('buildtype').startswith('debug')
+is_windows = host_machine.system() == 'windows'
alabaster = subproject('libalabaster')
-akiyo = subproject('libakiyo')
+akiyo_opts = []
+if get_option('sink-only')
+ akiyo_opts += ['curl=disabled']
+endif
+akiyo = subproject('libakiyo', default_options: akiyo_opts)
akiyo_has_curl = akiyo.get_variable('akiyo_has_curl')
akiyo_has_mmap = akiyo.get_variable('akiyo_has_mmap')
-shoki = subproject('shoki').get_variable('shoki')
-
common_deps = [alabaster.get_variable('alabaster'), akiyo.get_variable('akiyo')]
subdir('src/util')
@@ -23,11 +26,15 @@ subdir('src/screen')
subdir('src/buffer')
subdir('src/codec')
subdir('src/cache')
-subdir('src/bimu')
subdir('src/mixer')
subdir('src/render')
-subdir('src/libclient')
+subdir('src/bimu')
subdir('src/libsink')
-subdir('src/tree')
subdir('src/fruits/sink')
-subdir('src/fruits/cmc')
+
+if not get_option('sink-only')
+ shoki = subproject('shoki').get_variable('shoki')
+ subdir('src/tree')
+ subdir('src/libclient')
+ subdir('src/fruits/cmc')
+endif
diff --git a/meson_options.txt b/meson_options.txt
index e69de29..faced59 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('sink-only', type: 'boolean', value: true)
diff --git a/src/bimu/client.c b/src/bimu/client.c
index 8a72753..c592906 100644
--- a/src/bimu/client.c
+++ b/src/bimu/client.c
@@ -2,7 +2,10 @@
#include "../codec/libav/packet_ext.h"
+#include "handlers/codec.h"
+
#include "client.h"
+#include "common.h"
static void data_connection_callback(void *userdata, struct aki_packet_stream *stream)
{
@@ -109,7 +112,7 @@ static void control_connection_closed_callback(void *userdata, struct aki_packet
static void parse_info_packet(struct bmu_client *client, struct aki_packet *packet)
{
- client->duration = aki_packet_read_s64(packet);
+ client->duration = aki_packet_read_u64(packet);
u32 count = aki_packet_read_u32(packet);
for (u32 i = 0; i < count; i++) {
struct bmu_client_stream *stream = al_alloc_object(struct bmu_client_stream);
diff --git a/src/bimu/client.h b/src/bimu/client.h
index 0ebf282..8c9803b 100644
--- a/src/bimu/client.h
+++ b/src/bimu/client.h
@@ -3,9 +3,7 @@
#include <al/types.h>
#include <aki/packet_stream.h>
-#include "handlers/codec.h"
-
-#include "common.h"
+#include "../codec/codec.h"
struct bmu_client_stream {
u8 type;
@@ -23,7 +21,7 @@ struct bmu_client {
struct aki_packet_stream control;
struct aki_packet_stream data;
bool corked;
- s64 duration;
+ u64 duration;
array(s32) subscribed;
array(struct bmu_client_stream *) streams;
void (*callback)(void *, u8, struct bmu_client_stream *stream, void *);
diff --git a/src/bimu/handler.h b/src/bimu/handler.h
index 9b9d348..3646dd6 100644
--- a/src/bimu/handler.h
+++ b/src/bimu/handler.h
@@ -9,8 +9,8 @@ struct bmu_server_handler {
bool (*init)(struct bmu_server_handler *, struct cch_handle *, struct aki_packet_pool *);
void (*write_info)(struct bmu_server_handler *, struct aki_packet *);
void (*subscribe)(struct bmu_server_handler *, s32, bool);
- s64 (*get_duration)(struct bmu_server_handler *);
- bool (*seek)(struct bmu_server_handler *, s64);
+ u64 (*get_duration)(struct bmu_server_handler *);
+ bool (*seek)(struct bmu_server_handler *, u64);
bool (*step)(struct bmu_server_handler *);
void (*free)(struct bmu_server_handler **);
void *userdata;
@@ -23,8 +23,8 @@ enum {
};
enum {
- BIMU_CLIENT_SET = 0,
- BIMU_CLIENT_CONFIGURE,
+ BIMU_CLIENT_CONFIGURE = 0,
+ BIMU_CLIENT_SET,
BIMU_CLIENT_DATA,
BIMU_CLIENT_REMOVE_BUFFERS,
BIMU_CLIENT_EOF,
diff --git a/src/bimu/handlers/codec_server.c b/src/bimu/handlers/codec_server.c
index ca1c1b8..a30ce68 100644
--- a/src/bimu/handlers/codec_server.c
+++ b/src/bimu/handlers/codec_server.c
@@ -30,7 +30,7 @@ static bool codec_server_init(struct bmu_server_handler *handler, struct cch_han
static void codec_server_write_info(struct bmu_server_handler *handler, struct aki_packet *packet)
{
struct bmu_codec_server *codec = (struct bmu_codec_server *)handler;
- aki_packet_write_s64(packet, codec->demux->get_duration(codec->demux));
+ aki_packet_write_u64(packet, codec->demux->get_duration(codec->demux));
aki_packet_write_u32(packet, codec->demux->streams.size);
struct camu_stream *stream;
al_array_foreach_ptr(codec->demux->streams, i, stream) {
@@ -58,13 +58,13 @@ static void codec_server_subscribe(struct bmu_server_handler *handler, s32 index
}
}
-static s64 codec_server_get_duration(struct bmu_server_handler *handler)
+static u64 codec_server_get_duration(struct bmu_server_handler *handler)
{
struct bmu_codec_server *codec = (struct bmu_codec_server *)handler;
return codec->demux->get_duration(codec->demux);
}
-static bool codec_server_seek(struct bmu_server_handler *handler, s64 pos)
+static bool codec_server_seek(struct bmu_server_handler *handler, u64 pos)
{
struct bmu_codec_server *codec = (struct bmu_codec_server *)handler;
return codec->demux->seek(codec->demux, pos);
diff --git a/src/bimu/server.c b/src/bimu/server.c
index b823827..e1aedce 100644
--- a/src/bimu/server.c
+++ b/src/bimu/server.c
@@ -86,7 +86,7 @@ static void send_start_packet(struct bmu_node_connection *connection)
struct aki_packet *packet = aki_packet_create();
aki_packet_write_u8(packet, BIMU_CONTROL_START);
u64 ts = aki_get_timestamp() - START_DELAY;
- s64 seek_pos = connection->node->seek_pos;
+ u64 seek_pos = connection->node->seek_pos;
if (!connection->node->paused) {
if (connection->node->start >= 0) {
if ((ts - DELAY_GIVE) < (u64)connection->node->start) {
@@ -98,7 +98,7 @@ static void send_start_packet(struct bmu_node_connection *connection)
connection->node->start = ts;
}
}
- s64 duration = connection->handler->get_duration(connection->handler);
+ u64 duration = connection->handler->get_duration(connection->handler);
if (seek_pos > duration) seek_pos = duration;
// -1 signals to not call seek. We have to distinguish between a seek to 0
// and the start of a stream.
diff --git a/src/bimu/server.h b/src/bimu/server.h
index d954fa9..09fed99 100644
--- a/src/bimu/server.h
+++ b/src/bimu/server.h
@@ -25,7 +25,7 @@ struct bmu_node_connection {
struct aki_packet_pool pool;
s32 running;
u8 paused;
- s64 seek_pos;
+ u64 seek_pos;
struct cch_handle handle;
struct bmu_server_handler *handler;
struct aki_thread thread;
@@ -35,8 +35,8 @@ struct bmu_node {
u16 id;
struct cch_entry *entry;
bool paused;
- s64 start;
- s64 seek_pos;
+ u64 start;
+ u64 seek_pos;
u16 connection_id;
array(struct bmu_node_connection *) connections;
struct bmu_server *server;
diff --git a/src/buffer/video.c b/src/buffer/video.c
index de1f025..26e84b0 100644
--- a/src/buffer/video.c
+++ b/src/buffer/video.c
@@ -149,6 +149,8 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out)
void camu_video_buffer_free(struct camu_video_buffer *buf)
{
+#ifdef CAMU_VIDEO_BUFFER_FORCE_SCALER
if (buf->fmt.scaler_needed) camu_lav_scaler_close(&buf->scale);
+#endif
buf->queue->free(&buf->queue);
}
diff --git a/src/codec/codec.h b/src/codec/codec.h
index 1309210..f9ba660 100644
--- a/src/codec/codec.h
+++ b/src/codec/codec.h
@@ -96,8 +96,8 @@ struct camu_demuxer {
u8 type;
bool (*init)(struct camu_demuxer *, struct cch_handle *);
s32 (*get_packet)(struct camu_demuxer *, struct camu_packet *);
- s64 (*get_duration)(struct camu_demuxer *);
- bool (*seek)(struct camu_demuxer *, s64);
+ u64 (*get_duration)(struct camu_demuxer *);
+ bool (*seek)(struct camu_demuxer *, u64);
void (*free)(struct camu_demuxer **);
array(struct camu_stream) streams;
array(s32) subscribed;
diff --git a/src/codec/libav/demuxer.c b/src/codec/libav/demuxer.c
index d823d23..18b9020 100644
--- a/src/codec/libav/demuxer.c
+++ b/src/codec/libav/demuxer.c
@@ -1,8 +1,7 @@
#include <al/log.h>
-#include "../common.h"
-
#include "demuxer.h"
+#include "avio.h"
#define BUF_SIZE 16384
@@ -63,11 +62,11 @@ static bool lav_demuxer_init(struct camu_demuxer *demux, struct cch_handle *hand
goto err;
}
- av->duration = 0;
-
#define GUESS_STREAM_IS_IMAGE(stream) \
(stream->duration >= 0 && stream->nb_frames <= 1 && (stream->avg_frame_rate.den == 0 && stream->r_frame_rate.den > 0))
+ av->duration = 0;
+
for (u32 i = 0; i < av->format_context->nb_streams; i++) {
AVStream *stream = av->format_context->streams[i];
enum AVMediaType type = stream->codecpar->codec_type;
@@ -88,7 +87,8 @@ static bool lav_demuxer_init(struct camu_demuxer *demux, struct cch_handle *hand
al_log_warn("lav_demux", "Stream has a negative start_time (%ld).", stream->start_time);
}
s64 duration = av_rescale_q(stream->duration, stream->time_base, AV_TIME_BASE_Q);
- if (duration > av->duration) av->duration = duration;
+ al_assert(duration >= 0);
+ if ((u64)duration > av->duration) av->duration = (u64)duration;
al_array_push(av->demux.streams, ((struct camu_stream){
.type = CAMU_FFMPEG_COMPAT,
.av.stream = stream
@@ -140,16 +140,17 @@ static s32 lav_demuxer_get_packet(struct camu_demuxer *demux, struct camu_packet
return ret;
}
-static s64 lav_demuxer_get_duration(struct camu_demuxer *demux)
+static u64 lav_demuxer_get_duration(struct camu_demuxer *demux)
{
struct camu_lav_demuxer *av = (struct camu_lav_demuxer *)demux;
return av->duration;
}
-static bool lav_demuxer_seek(struct camu_demuxer *demux, s64 pos)
+static bool lav_demuxer_seek(struct camu_demuxer *demux, u64 pos)
{
struct camu_lav_demuxer *av = (struct camu_lav_demuxer *)demux;
- s64 ts = av_rescale_q(pos, (AVRational){ 1, 1000000 }, AV_TIME_BASE_Q);
+ if (pos > av->duration) pos = av->duration;
+ s64 ts = av_rescale_q((s64)pos, (AVRational){ 1, 1000000 }, AV_TIME_BASE_Q);
if (av->eof) {
avformat_flush(av->format_context);
av->eof = false;
diff --git a/src/codec/libav/demuxer.h b/src/codec/libav/demuxer.h
index a9d8c5c..9b2d093 100644
--- a/src/codec/libav/demuxer.h
+++ b/src/codec/libav/demuxer.h
@@ -8,13 +8,11 @@
#include "../codec.h"
-#include "avio.h"
-
struct camu_lav_demuxer {
struct camu_demuxer demux;
AVIOContext *io_context;
AVFormatContext *format_context;
- s64 duration;
+ u64 duration;
bool eof;
};
diff --git a/src/codec/libav/resampler.c b/src/codec/libav/resampler.c
index 3dcb6d4..ba700f4 100644
--- a/src/codec/libav/resampler.c
+++ b/src/codec/libav/resampler.c
@@ -43,7 +43,7 @@ bool camu_lav_resampler_init(struct camu_lav_resampler *resamp, struct camu_lav_
av_opt_set_sample_fmt(ctx, "out_sample_fmt", fmt->req_format, 0);
// Slower but more accurate resampler.
- av_opt_set_int(ctx, "resampler", SWR_ENGINE_SOXR, 0);
+ //av_opt_set_int(ctx, "resampler", SWR_ENGINE_SOXR, 0);
if (swr_init(ctx) != 0) {
swr_free(&ctx);
diff --git a/src/codec/meson.build b/src/codec/meson.build
index a3951f0..676be1c 100644
--- a/src/codec/meson.build
+++ b/src/codec/meson.build
@@ -9,6 +9,7 @@ av_src = [
'libav/avio.c'
]
av_inc = []
+av_ldflags = []
av_deps = []
libavutil = dependency('libavutil', required: false)
@@ -24,28 +25,20 @@ if not (libavutil.found() and libavformat.found() and libavcodec.found() and lib
libavcodec = av_proj.get_variable('avcodec')
libswresample = av_proj.get_variable('swresample')
libswscale = av_proj.get_variable('swscale')
- #libdir = av_proj.get_variable('libdir')
- #libavutil = compiler.find_library('avutil', dirs: libdir)
- #libavformat = compiler.find_library('avformat', dirs: libdir)
- #libavcodec = compiler.find_library('avcodec', dirs: libdir)
- #libswresample = compiler.find_library('swresample', dirs: libdir)
- #libswscale = compiler.find_library('swscale', dirs: libdir)
- zlib = compiler.find_library('z', required: false)
- if zlib.found()
- av_deps += [zlib]
- endif
+ av_inc += [av_proj.get_variable('inc')]
+ av_ldflags += ['-L' + av_proj.get_variable('libdir')]
+ av_deps += [dependency('zlib')]
soxr = compiler.find_library('soxr', required: false)
if soxr.found()
av_deps += [soxr]
endif
av_deps += [compiler.find_library('bcrypt')]
- av_inc += [av_proj.get_variable('inc')]
endif
endif
if libavutil.found() and libavformat.found() and libavcodec.found() and libswresample.found() and libswscale.found()
av_deps += [libavutil, libavformat, libavcodec, libswresample, libswscale]
- av = declare_dependency(sources: av_src, dependencies: av_deps, include_directories: av_inc)
+ av = declare_dependency(sources: av_src, dependencies: av_deps, include_directories: av_inc, link_args: av_ldflags)
add_project_arguments('-DHAVE_FFMPEG', language: ['c', 'cpp'])
endif
diff --git a/src/codec/spng/impl.c b/src/codec/spng/impl.c
index d090bdc..9089e99 100644
--- a/src/codec/spng/impl.c
+++ b/src/codec/spng/impl.c
@@ -53,13 +53,13 @@ static s32 spng_demuxer_get_packet(struct camu_demuxer *demux, struct camu_packe
return CAMU_OK;
}
-static s64 spng_demuxer_get_duration(struct camu_demuxer *demux)
+static u64 spng_demuxer_get_duration(struct camu_demuxer *demux)
{
(void)demux;
return 0;
}
-static bool spng_demuxer_seek(struct camu_demuxer *demux, s64 pos)
+static bool spng_demuxer_seek(struct camu_demuxer *demux, u64 pos)
{
(void)demux;
(void)pos;
diff --git a/src/codec/stb_image/impl.c b/src/codec/stb_image/impl.c
index b7ed928..6058ff2 100644
--- a/src/codec/stb_image/impl.c
+++ b/src/codec/stb_image/impl.c
@@ -51,13 +51,13 @@ static s32 stbi_demuxer_get_packet(struct camu_demuxer *demux, struct camu_packe
return CAMU_OK;
}
-static s64 stbi_demuxer_get_duration(struct camu_demuxer *demux)
+static u64 stbi_demuxer_get_duration(struct camu_demuxer *demux)
{
(void)demux;
return 0;
}
-static bool stbi_demuxer_seek(struct camu_demuxer *demux, s64 pos)
+static bool stbi_demuxer_seek(struct camu_demuxer *demux, u64 pos)
{
(void)demux;
(void)pos;
diff --git a/src/codec/wuffs/impl.c b/src/codec/wuffs/impl.c
index a1e58e4..26e9011 100644
--- a/src/codec/wuffs/impl.c
+++ b/src/codec/wuffs/impl.c
@@ -72,13 +72,13 @@ static s32 wuffs_demuxer_get_packet(struct camu_demuxer *demux, struct camu_pack
return CAMU_OK;
}
-static s64 wuffs_demuxer_get_duration(struct camu_demuxer *demux)
+static u64 wuffs_demuxer_get_duration(struct camu_demuxer *demux)
{
(void)demux;
return 0;
}
-static bool wuffs_demuxer_seek(struct camu_demuxer *demux, s64 pos)
+static bool wuffs_demuxer_seek(struct camu_demuxer *demux, u64 pos)
{
(void)demux;
(void)pos;
diff --git a/src/fruits/sink/meson.build b/src/fruits/sink/meson.build
index c409857..8879937 100644
--- a/src/fruits/sink/meson.build
+++ b/src/fruits/sink/meson.build
@@ -1,5 +1,10 @@
sink_src = ['sink.c']
sink_deps = [common_deps, buffer, cache, av, screen, render, mixer, libsink]
+sink_args = []
+
+if meson.is_cross_build()
+ sink_args += ['-static', '-static-libgcc', '-static-libstdc++']
+endif
use_tui = false
if use_tui
@@ -7,4 +12,5 @@ if use_tui
sink_deps += [dependency('notcurses')]
endif
-executable('sink', sink_src, dependencies: sink_deps)
+executable('sink', sink_src, dependencies: sink_deps,
+ c_args: sink_args, cpp_args: sink_args, link_args: sink_args)
diff --git a/src/mixer/meson.build b/src/mixer/meson.build
index 53389eb..52125ce 100644
--- a/src/mixer/meson.build
+++ b/src/mixer/meson.build
@@ -4,10 +4,6 @@ mixer_deps = [common_deps]
miniaudio = subproject('miniaudio').get_variable('miniaudio')
mixer_src += ['audio_miniaudio.c']
mixer_deps += [miniaudio]
-if host_machine.system() != 'windows'
- libpulse = dependency('libpulse')
- mixer_deps += [libpulse]
-endif
miniaudio_args = [
'-DMA_NO_JACK',
@@ -18,8 +14,13 @@ miniaudio_args = [
'-DMA_NO_RESOURCE_MANAGER',
'-DMA_NO_NODE_GRAPH',
'-DMA_NO_ENGINE',
- '-DMA_NO_RUNTIME_LINKING'
]
+if not is_windows
+ libpulse = dependency('libpulse')
+ mixer_deps += [libpulse]
+ miniaudio_args += ['-DMA_NO_RUNTIME_LINKING']
+endif
+
mixer = declare_dependency(sources: mixer_src, dependencies: mixer_deps,
compile_args: miniaudio_args)
diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c
index 646f056..663e7aa 100644
--- a/src/mixer/mixer.c
+++ b/src/mixer/mixer.c
@@ -1,5 +1,4 @@
#include "../buffer/audio.h"
-#include "../buffer/clock.h"
#include "mixer.h"
diff --git a/src/render/queue_libplacebo.c b/src/render/queue_libplacebo.c
index 327397f..de9df44 100644
--- a/src/render/queue_libplacebo.c
+++ b/src/render/queue_libplacebo.c
@@ -120,7 +120,7 @@ static void discard_av_frame(const struct pl_source_frame *src)
{
AVFrame *frame = src->frame_data;
av_frame_free(&frame);
- al_log_info("frame_queue_libplacebo", "Dropped frame with PTS %.3f.", src->pts);
+ al_log_debug("frame_queue_libplacebo", "Dropped frame with PTS %.3f.", src->pts);
}
static void queue_lp_push_av_frame(struct camu_frame_queue *queue, AVFrame *frame, f64 pts)
diff --git a/src/render/queue_tiger.h b/src/render/queue_tiger.h
index 1524a29..db675df 100644
--- a/src/render/queue_tiger.h
+++ b/src/render/queue_tiger.h
@@ -1,6 +1,6 @@
#pragma once
-#include <skh/egl.h>
+#include <skh/gl.h>
#include "../buffer/frame_queue.h"
diff --git a/src/render/renderer_tiger.h b/src/render/renderer_tiger.h
index e9a7eb0..2979d91 100644
--- a/src/render/renderer_tiger.h
+++ b/src/render/renderer_tiger.h
@@ -1,6 +1,6 @@
#pragma once
-#include <skh/egl.h>
+#include <skh/gl.h>
#include "renderer.h"
diff --git a/src/screen/screen.c b/src/screen/screen.c
index dd4bdc6..94b5d8c 100644
--- a/src/screen/screen.c
+++ b/src/screen/screen.c
@@ -260,7 +260,6 @@ static void add_buffer_internal(struct camu_screen *scr, struct camu_video_buffe
#endif
camu_view_calculate(&video.view, scr->width, scr->height);
al_array_push(scr->videos, video);
- scr->window->resize(scr->window, stream->video.width, stream->video.height);
}
static void remove_buffer_internal(struct camu_screen *scr, struct camu_video_buffer *buf)
diff --git a/src/screen/view.c b/src/screen/view.c
index 4cf6007..dddc11a 100644
--- a/src/screen/view.c
+++ b/src/screen/view.c
@@ -33,8 +33,8 @@ void camu_view_calculate(struct camu_view *view, s32 window_width, s32 window_he
default:
return;
}
- view->x_offset = ((window_width - (view->width * view->zoom)) / 2.0);
- view->y_offset = ((window_height - (view->height * view->zoom)) / 2.0);
+ view->x_offset = (window_width - (view->width * view->zoom)) / 2.0;
+ view->y_offset = (window_height - (view->height * view->zoom)) / 2.0;
}
bool camu_view_pan_simple(struct camu_view *view, s32 window_width, s32 window_height, f64 dx, f64 dy)
diff --git a/subprojects/ffmpeg.wrap b/subprojects/ffmpeg.wrap
index 071be8b..76dcda1 100644
--- a/subprojects/ffmpeg.wrap
+++ b/subprojects/ffmpeg.wrap
@@ -1,6 +1,6 @@
[wrap-file]
-directory = ffmpeg-6.1
-source_url = https://www.ffmpeg.org/releases/ffmpeg-6.1.tar.gz
-source_filename = ffmpeg-6.1.tar.gz
-source_hash = 938dd778baa04d353163ca5cb06c909c918850055f549205b29b1224e45a5316
+directory = ffmpeg-6.1.1
+source_url = https://www.ffmpeg.org/releases/ffmpeg-6.1.1.tar.gz
+source_filename = ffmpeg-6.1.1.tar.gz
+source_hash = b0aee531e4a91fed6bc031445dfc3ad8eb36de1fcb0fa2acdb589ecc9f8dc9cb
patch_directory = ffmpeg
diff --git a/subprojects/packagefiles/ffmpeg/meson.build b/subprojects/packagefiles/ffmpeg/meson.build
index 2faa65e..c4ab72d 100644
--- a/subprojects/packagefiles/ffmpeg/meson.build
+++ b/subprojects/packagefiles/ffmpeg/meson.build
@@ -1,4 +1,4 @@
-project('ffmpeg', 'c', version: '6.1', meson_version: '>=0.57.0')
+project('ffmpeg', 'c', version: '6.1.1', meson_version: '>=0.57.0')
compiler = meson.get_compiler('c')
@@ -16,6 +16,8 @@ if not is_debug
endif
extra_options += ['--cc=' + compiler.cmd_array()[0]]
+extra_options += ['--nm=' + meson.get_external_property('nm', 'nm')]
+extra_options += ['--ar=' + meson.get_external_property('ar', 'ar')]
if is_windows
if is_64bit
@@ -40,13 +42,11 @@ demuxers = 'flac,mp3,aac,wav,image2,mjpeg,image2pipe,image_jpeg_pipe,matroska,mo
parsers = 'mjpeg,jpeg2000'
#parsers += ',mpegaudio,mpegvideo,dvd_nav'
-if not is_windows or is_mingw
- #extra_options += ['--enable-zlib', '--enable-libsoxr']
- extra_options += ['--enable-zlib']
- decoders += ',png'
- demuxers += ',image_png_pipe'
- parsers += ',png'
-endif
+#extra_options += ['--enable-zlib', '--enable-libsoxr']
+extra_options += ['--enable-zlib']
+decoders += ',png'
+demuxers += ',image_png_pipe'
+parsers += ',png'
bsfs = 'extract_extradata,mp3_header_decompress'
@@ -81,6 +81,7 @@ proj = ext_proj.add_project('configure',
'--disable-alsa',
'--disable-xlib',
'--disable-vulkan',
+ '--enable-nonfree',
'--enable-runtime-cpudetect',
'--enable-asm',
'--enable-inline-asm',
@@ -105,5 +106,5 @@ avcodec = proj.dependency('avcodec')
swresample = proj.dependency('swresample')
swscale = proj.dependency('swscale')
-libdir = meson.project_build_root() + '/dist/usr/locallib'
inc = include_directories('.')
+libdir = meson.project_build_root() + '/dist/usr/locallib'
diff --git a/subprojects/shaderc/meson.build b/subprojects/shaderc/meson.build
index 7543f54..ce02aa8 100644
--- a/subprojects/shaderc/meson.build
+++ b/subprojects/shaderc/meson.build
@@ -1,4 +1,4 @@
-project('shaderc', 'cpp', version: '2023.7')
+project('shaderc', 'cpp', version: '2023.8')
compiler = meson.get_compiler('c')
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 0000000..2a4215f
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+url = https://github.com/madler/zlib.git
+revision = 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851
+depth = 1
+method = cmake