diff options
53 files changed, 693 insertions, 556 deletions
diff --git a/.editorconfig b/.editorconfig index 7d5465e..3c3e7cc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,3 +9,7 @@ indent_size = 4 tab_width = 4 end_of_line = lf trim_trailing_whitespace = true + +[meson.build] +indent_size = 2 +tab_width = 2 @@ -10,9 +10,11 @@ src/portal/cpy/portal.c src/portal/cpy/portal.h src/portal/py/config.py src/portal/vendor/* -subprojects/BLAKE3/ +subprojects/BLAKE3-*/ +subprojects/c89atomic-*/ subprojects/c89atomic.wrap -subprojects/c89atomic/ +subprojects/cairo.wrap +subprojects/cairo/ subprojects/expat-*/ subprojects/expat.wrap subprojects/ffmpeg-*/ @@ -21,45 +23,52 @@ subprojects/freetype-*/ subprojects/fribidi-*/ subprojects/glfm-*/ subprojects/glfm.wrap +subprojects/glfw3-*/ subprojects/glfw3.wrap -subprojects/glfw3/ +subprojects/glib-*/ +subprojects/glib.wrap subprojects/gperf.wrap subprojects/gperf/ +subprojects/gvdb.wrap subprojects/harfbuzz-*/ +subprojects/jansson-*/ subprojects/jansson.wrap -subprojects/jansson/ +subprojects/jsmn-*/ subprojects/jsmn.wrap -subprojects/jsmn/ subprojects/libalabaster subprojects/libalabaster/ subprojects/libass-*/ -subprojects/libcdio-paranoia/ +subprojects/libcdio-paranoia-*/ +subprojects/libcurl-*/ subprojects/libcurl.wrap -subprojects/libcurl/ -subprojects/libdvdcss/ -subprojects/libdvdnav/ -subprojects/libdvdread/ +subprojects/libdvdcss-*/ +subprojects/libdvdnav-*/ +subprojects/libdvdread-*/ subprojects/libev-4.33/ subprojects/libev.wrap +subprojects/libffi.wrap +subprojects/libffi/ subprojects/libnaunet subprojects/libnaunet/ -subprojects/libplacebo/ +subprojects/libplacebo-*/ subprojects/libpng-*/ subprojects/libpng.wrap subprojects/libxml2-*/ subprojects/libxml2.wrap subprojects/linmath.h/ -subprojects/miniaudio/ -subprojects/notcurses/ +subprojects/miniaudio-*/ +subprojects/notcurses-*/ subprojects/packagecache/ -subprojects/shaderc/ +subprojects/pcre2-*/ +subprojects/pcre2.wrap +subprojects/shaderc-*/ subprojects/stb/ subprojects/stela subprojects/stela/ +subprojects/vulkan-headers-*/ subprojects/vulkan.wrap -subprojects/vulkan/ subprojects/wayland-protocols.wrap subprojects/wayland-protocols/ subprojects/wlr-protocols.wrap subprojects/wlr-protocols/ -subprojects/wuffs/ +subprojects/wuffs-*/ @@ -91,11 +91,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1737469691, + "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "type": "github" }, "original": { @@ -64,7 +64,7 @@ cd "$out" ${lib.getExe meson} subprojects download \ - libalabaster libnaunet stela miniaudio + libalabaster libnaunet stela miniaudio notcurses cd "$out/subprojects/libalabaster" ${lib.getExe meson} subprojects download c89atomic @@ -131,7 +131,6 @@ wlr-protocols egl-wayland # notcurses build - libdeflate libunistring ncurses # discord @@ -188,6 +187,9 @@ })); gccWin32Stdenv = overrideCC pkgsCross.ucrt64.stdenv gcc; in mkShell.override { stdenv = gccWin32Stdenv; } { + # Note that `cc` has to invoke a native compiler not a cross compiler. + # If meson complains that a compiler for the "build machine" is not found, + # it may be due to NIX_COMPILE_FLAGS, or NIX_LDFLAGS. NIX_HARDENING_ENABLE = ""; nativeBuildInputs = [ git @@ -207,6 +209,68 @@ (openssl.override { static = true; }) xxHash vulkan-headers + # Many more things need to be fixed for notcurses on Windows. + ((ncurses.override { enableStatic = true; withCxx = false; withTermlib = false; }).overrideAttrs (oldAttrs: rec { + version = "6.5.20250118"; + src = fetchurl { + url = "https://invisible-island.net/archives/ncurses/ncurses-${lib.versions.majorMinor version}.tar.gz"; + hash = "sha256-E22RvCaamleF5fnpgLx2q1dCj2BM4+WlqQzrx2eXHMY="; + }; + #configureFlags = lib.remove "--enable-sp-funcs" (lib.remove "--enable-term-driver" oldAttrs.configureFlags) ++ [ + configureFlags = oldAttrs.configureFlags ++ [ + # "--enable-exp-win32" + ]; + patches = (lib.lists.forEach [ + #{ date = "20240427"; hash = "qiAf4WrIiihsLaekMPJFZFh8qdCUrp+9U9zmlrG4lSw="; } + { date = "20240504"; hash = "e7YUKYS+AH/i00dBQCGUEqqwXlcwqnDWkX8KM7RIEPE="; } + { date = "20240511"; hash = "rjl7Vi71pL5S4hWZdqe2nLQ0ILUOaQjRQyGTvwZFmRs="; } + { date = "20240518"; hash = "7qenzh+Qc5q6wv773CZXsc+L3sgVwravibMSSCB1D4Y="; } + { date = "20240519"; hash = "4eG9rnusBnjPz/RF4fnBXmZMNEUfVHX+rbxOu6iVuZA="; } + { date = "20240525"; hash = "Q3F05g1WGkjkKnUO0GRqKS7YrWH9PvC/KRDknYmJqZc="; } + { date = "20240601"; hash = "WXMM3dZ4gM9x2WPIeytA7Bcn4L+XgwS8idXzzlDWXP8="; } + { date = "20240608"; hash = "ItbeBCMGlxy8/jk65CEvrGeVmtaHMlp46sI1cQlkv9k="; } + { date = "20240615"; hash = "SurjpGVjeL7jo7tMbbZjhLKcMOI0WJdWSlP8UqxZo2o="; } + { date = "20240622"; hash = "xPfbRD3VEV/JIlSJVj5s5DyvQ/N5yqcG0GuplhOAT18="; } + { date = "20240629"; hash = "pqs1/Tiv4thvTluN3OozD/cjWPTX+I+R0SV/whSdhAc="; } + { date = "20240706"; hash = "PAVI20IoDvIE1tFAbfAkBrZelqVflUaDxR3hDX48wvU="; } + { date = "20240713"; hash = "f6SWjki6RSYMA2+bnyODkHl4Ywf1Dh6b+xy9zbIoKA0="; } + { date = "20240720"; hash = "WDWigk9EjZsdVBWO2ZUqafDi5THqk2adlEqVGZrARgg="; } + { date = "20240727"; hash = "8ZgMLcTGG0c9x+sfhCavwvl2h53Sqk/BI9B3797Vwao="; } + { date = "20240810"; hash = "CRQBjskmBbh0C9JFBPzylGddXyd8gbUIxXZjsvCfwSk="; } + { date = "20240817"; hash = "utPRoefg/ZHP/GpbNR028k6Cfwhg7L1CdGv9gNf1tOs="; } + { date = "20240824"; hash = "9Iy229KtZn0Mx6b3O4G04y3sL/VeUWhDLYsNZjikjN4="; } + { date = "20240831"; hash = "L4T4dhGZKTY7HYBys2gJHuzDGfRLd9ls4l2ePsmyysk="; } + { date = "20240914"; hash = "IW8ixyj+RfkwyNAXSzUo9yuMtSWSNLHWp3342c1i+gc="; } + { date = "20240922"; hash = "nFf/2kCBVEabZKE4lQ71eovpWjMXlO7SjMpzS+IwEMA="; } + { date = "20240928"; hash = "dsR1zWo020PBv/QtvPuqHYbNerFnTMenhO6jVzIOoKM="; } + { date = "20241006"; hash = "UCcpwSwLVbjUf7reM8juR2NPs59pfSed06Qt4n+PfTs="; } + { date = "20241019"; hash = "7drIhiHIhRJbFPJwfu0KAprwOcBFxJL9p049EuaHx3Y="; } + { date = "20241026"; hash = "0gxRfBsCtaGarqvFTsqUZuo4aeHLkr76ZuGG5cMFIWQ="; } + { date = "20241102"; hash = "Ws28hQEIX3Nrk84WsvozkIiRQmSZUoGUplQkMCmlNnw="; } + { date = "20241109"; hash = "ZvA2c9O3K4y2mqfGgQJYhsWSybfnAlhFxQHZb6q7YSs="; } + { date = "20241123"; hash = "J8ErjvP8ZvuMT9jnFiq75zMImbypsnWB1CuNMiJX5Nc="; } + { date = "20241130"; hash = "Yy8bkjr55psDj32Nj/n10J5yG8urOV91LPESlf1t3pg="; } + { date = "20241207"; hash = "IqJEPkWZV5BNiHpc4YNP2lFWg3zngG+lf345szoAYdo="; } + { date = "20241214"; hash = "Kq1qLk8WtAVCD9itpXIrluUUixGH3x9QRV/+UMD9CCE="; } + { date = "20241221"; hash = "FUpH6KDLRS00KA3MvI18N8npoL7DnoavHA0yrg8dl74="; } + { date = "20241228"; hash = "r4EvgE2DamJiJ8EucqmWQIYmbKyLaQ+nPbvg5lwxewo="; } + { date = "20250104"; hash = "pkb/MXJlPwXUH3n+DuGH+4M1EROGUrd2iP+8xBngzEk="; } + { date = "20250111"; hash = "FpvEIhyTA5NxWlQpsyGlMoSjDEe5P45irwUZmXXGr3A="; } + { date = "20250118"; hash = "uBHtMR/FR3hb+2PIgg4ahApk8/AxZ5FOMIXxtpGSB4o="; } + ] (ver: pkgs.fetchurl rec { + name = "ncurses-6.5-${ver.date}.patch"; + url = "https://invisible-island.net/archives/ncurses/6.5/${name}.gz"; + sha256 = ver.hash; + postFetch = '' + cp $out src.gz + ${pkgs.gzip}/bin/gzip -dc src.gz > $out + ''; + })) ++ [ + ]; + })) + libunistring + (libiconv.override { enableStatic = true; enableShared = false; }) + windows.mingw_w64_pthreads ]; shellHook = '' export SHELL="${pkgs.bashInteractive}/bin/bash" diff --git a/scripts/shaderc_deps.sh b/scripts/shaderc_deps.sh new file mode 100755 index 0000000..e8f4335 --- /dev/null +++ b/scripts/shaderc_deps.sh @@ -0,0 +1,5 @@ +#! /usr/bin/env sh +# We need a better way to do this. +git clone https://github.com/KhronosGroup/SPIRV-Tools.git --depth=1 spirv-tools +git clone https://github.com/KhronosGroup/SPIRV-Headers.git --depth=1 spirv-headers +git clone https://github.com/KhronosGroup/glslang.git --depth=1 glslang diff --git a/src/buffer/meson.build b/src/buffer/meson.build index debef54..6301206 100644 --- a/src/buffer/meson.build +++ b/src/buffer/meson.build @@ -1,8 +1,9 @@ buffer_src = ['audio.c', 'clock.c', 'peak_buffer.c'] buffer_deps = [] buffer_args = [] + if not no_video buffer_src += ['video.c'] endif -buffer = declare_dependency(sources: buffer_src, - dependencies: buffer_deps, compile_args: buffer_args) + +buffer = declare_dependency(sources: buffer_src, dependencies: buffer_deps, compile_args: buffer_args) diff --git a/src/cache/meson.build b/src/cache/meson.build index 5b70c3c..9c9af7b 100644 --- a/src/cache/meson.build +++ b/src/cache/meson.build @@ -8,6 +8,16 @@ cache_src = [ cache_deps = [] cache_args = [] +if naunet_has_mmap + cache_src += ['backings/file_mapped.c'] +else + cache_src += ['backings/file.c'] +endif + +if naunet_has_curl + cache_src += ['handlers/http.c'] +endif + cache_have_cdio = false libcdio_paranoia = dependency('libcdio_paranoia', required: false, allow_fallback: true) libcdio_cdda = dependency('libcdio_cdda', required: false, allow_fallback: true) @@ -18,21 +28,14 @@ if libcdio_paranoia.found() and libcdio_cdda.found() cache_have_cdio = true endif -#libdvdcss = dependency('libdvdcss', required: false, allow_fallback: true) -#libdvdread = dependency('libdvdread', required: false, allow_fallback: true) -#libdvdnav = dependency('libdvdnav', required: false, allow_fallback: true) -#if libdvdcss.found() and libdvdread.found() and libdvdnav.found() -#endif - -if naunet_has_mmap - cache_src += ['backings/file_mapped.c'] -else - cache_src += ['backings/file.c'] -endif - -if naunet_has_curl - cache_src += ['handlers/http.c'] +cache_have_libdvd = false +libdvdcss = dependency('libdvdcss', required: false, allow_fallback: true) +libdvdread = dependency('dvdread', required: false, allow_fallback: true) +libdvdnav = dependency('dvdnav', required: false, allow_fallback: true) +if libdvdcss.found() and libdvdread.found() and libdvdnav.found() + cache_deps += [libdvdcss, libdvdread, libdvdnav] + cache_args += ['-DCACHE_HAVE_LIBDVD'] + cache_have_libdvd = true endif -cache = declare_dependency(sources: cache_src, dependencies: cache_deps, - compile_args: cache_args) +cache = declare_dependency(sources: cache_src, dependencies: cache_deps, compile_args: cache_args) diff --git a/src/codec/codec.h b/src/codec/codec.h index b70e3cb..af824d7 100644 --- a/src/codec/codec.h +++ b/src/codec/codec.h @@ -9,12 +9,6 @@ #include "../cache/handle.h" -#ifndef CAMU_SINK_NO_VIDEO -#include "../render/renderer.h" -#else -struct camu_renderer; -#endif - #ifdef CAMU_HAVE_FFMPEG enum { CAMU_OK = 0, @@ -22,9 +16,11 @@ enum { CAMU_ERR_EOF = AVERROR_EOF, CAMU_ERR_AGAIN = AVERROR(EAGAIN) }; + enum { CAMU_SEEK_SIZE = AVSEEK_SIZE }; + enum { CAMU_STREAM_UNKNOWN = AVMEDIA_TYPE_UNKNOWN, CAMU_STREAM_AUDIO = AVMEDIA_TYPE_AUDIO, // 1 @@ -32,6 +28,7 @@ enum { CAMU_STREAM_SUBTITLE = AVMEDIA_TYPE_SUBTITLE, CAMU_STREAM_ATTACHMENT = AVMEDIA_TYPE_ATTACHMENT }; + enum { CAMU_SAMPLE_FORMAT_NONE = AV_SAMPLE_FMT_NONE, CAMU_SAMPLE_FORMAT_U8 = AV_SAMPLE_FMT_U8, @@ -47,12 +44,14 @@ enum { CAMU_SAMPLE_FORMAT_S64 = AV_SAMPLE_FMT_S64, CAMU_SAMPLE_FORMAT_S64P = AV_SAMPLE_FMT_S64P }; + enum { CAMU_PIXEL_FORMAT_RGBA = AV_PIX_FMT_RGBA, CAMU_PIXEL_FORMAT_RGB = AV_PIX_FMT_RGB8, CAMU_PIXEL_FORMAT_GREYA = AV_PIX_FMT_GRAY8A, CAMU_PIXEL_FORMAT_GREY = AV_PIX_FMT_GRAY8 }; + #define CAMU_PLANAR_DATA_POINTERS AV_NUM_DATA_POINTERS #else enum { @@ -61,9 +60,11 @@ enum { CAMU_ERR_EOF = -1, CAMU_ERR_AGAIN = -2 }; + enum { CAMU_SEEK_SIZE = 0x10000 }; + enum { CAMU_STREAM_UNKNOWN = -1, CAMU_STREAM_AUDIO, @@ -71,6 +72,7 @@ enum { CAMU_STREAM_SUBTITLE, CAMU_STREAM_ATTACHMENT }; + enum { CAMU_SAMPLE_FORMAT_NONE = -1, CAMU_SAMPLE_FORMAT_U8, @@ -86,12 +88,14 @@ enum { CAMU_SAMPLE_FORMAT_S64, CAMU_SAMPLE_FORMAT_S64P }; + enum { CAMU_PIXEL_FORMAT_RGBA = 0, CAMU_PIXEL_FORMAT_RGB, CAMU_PIXEL_FORMAT_GREYA, CAMU_PIXEL_FORMAT_GREY }; + #define CAMU_PLANAR_DATA_POINTERS 8 #endif @@ -176,6 +180,7 @@ struct camu_demuxer { s32 subscribed; }; +struct camu_renderer; struct camu_decoder { u8 mode; bool (*init)(struct camu_decoder *, struct camu_renderer *, struct camu_codec_stream *, diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c index 36e59dd..5ff99d7 100644 --- a/src/codec/ffmpeg/decoder.c +++ b/src/codec/ffmpeg/decoder.c @@ -2,9 +2,13 @@ #include <al/log.h> #include <libavutil/cpu.h> +#ifndef CAMU_SINK_NO_VIDEO +#include "../../render/renderer.h" +#endif + #include "decoder.h" -#if !defined CAMU_SINK_NO_VIDEO +#ifndef CAMU_SINK_NO_VIDEO static s32 get_buffer2(AVCodecContext *context, AVFrame *pic, s32 flags) { struct camu_ff_decoder *av = (struct camu_ff_decoder *)context->opaque; @@ -236,7 +240,7 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend } #endif -#if !defined CAMU_SINK_NO_VIDEO +#ifndef CAMU_SINK_NO_VIDEO if (codecpar->codec_type == AVMEDIA_TYPE_VIDEO && renderer && renderer->get_buffer2) { av->renderer = renderer; av->codec_context->opaque = av; diff --git a/src/codec/ffmpeg/meson.build b/src/codec/ffmpeg/meson.build new file mode 100644 index 0000000..fc0bc91 --- /dev/null +++ b/src/codec/ffmpeg/meson.build @@ -0,0 +1,70 @@ +ffmpeg_src = [ + 'common.c', + 'packet_ext.c', +] +ffmpeg_args = ['-DCAMU_HAVE_FFMPEG'] +ffmpeg_deps = [] + +ffmpeg_server_src = [ + ffmpeg_src, + 'demuxer.c', + 'avio.c' +] +ffmpeg_server_deps = [] + +# This is layed out based on how things work currently. +# Obviously the decoder, resampler, scaler, and encoder should +# be a part of a server-side transcoding function. +ffmpeg_client_src = [ + ffmpeg_src, + 'decoder.c', + 'resampler.c', + 'scaler.c', + 'encoder.c' +] +ffmpeg_client_deps = [] + +libavutil = dependency('libavutil', required: false) +libavformat = dependency('libavformat', required: false) +libavcodec = dependency('libavcodec', required: false) +libswresample = dependency('libswresample', required: false) +libswscale = dependency('libswscale', required: false) +if not (libavutil.found() and libavformat.found() and libavcodec.found() and libswresample.found() and libswscale.found()) + ffmpeg_proj = subproject('ffmpeg', required: false) + if ffmpeg_proj.found() + libavutil = ffmpeg_proj.get_variable('avutil') + libavformat = ffmpeg_proj.get_variable('avformat') + libavcodec = ffmpeg_proj.get_variable('avcodec') + libswresample = ffmpeg_proj.get_variable('swresample') + libswscale = ffmpeg_proj.get_variable('swscale') + # Only used to set include dirs for FFmpeg. + ffmpeg_deps += [ffmpeg_proj.get_variable('ffmpeg_inc_dep')] + # We explicitly enable zlib in the FFmpeg build. + ffmpeg_deps += [dependency('zlib')] + if is_windows + # Extra static dependencies for Windows. + ffmpeg_client_deps += [compiler.find_library('bcrypt')] + elif is_android + # Android MediaCodec HW decoding. + ffmpeg_client_deps += [compiler.find_library('mediandk')] + endif + soxr = compiler.find_library('soxr', required: false) + if soxr.found() + ffmpeg_client_deps += [soxr] + ffmpeg_args += ['-DCAMU_HAVE_SOXR'] + endif + endif +endif + +if libavutil.found() and libavformat.found() and libavcodec.found() and libswresample.found() and libswscale.found() + ffmpeg_server_deps += [libavutil, libavformat, libavcodec] + ffmpeg_client_deps += [libavutil, libavformat, libavcodec, libswresample, libswscale] + codec_server_deps += [ + declare_dependency(sources: ffmpeg_server_src, + dependencies: [ffmpeg_deps, ffmpeg_server_deps], compile_args: ffmpeg_args) + ] + codec_client_deps += [ + declare_dependency(sources: ffmpeg_client_src, + dependencies: [ffmpeg_deps, ffmpeg_client_deps], compile_args: ffmpeg_args) + ] +endif diff --git a/src/codec/meson.build b/src/codec/meson.build index 2e89d95..4c9e16b 100644 --- a/src/codec/meson.build +++ b/src/codec/meson.build @@ -1,86 +1,25 @@ -codec_deps = [] +codec_server_deps = [] +codec_client_deps = [] if get_option('codecs').contains('ffmpeg') - ffmpeg_src = [ - 'ffmpeg/common.c', - 'ffmpeg/packet_ext.c', - 'ffmpeg/decoder.c', - 'ffmpeg/resampler.c', - 'ffmpeg/scaler.c', - 'ffmpeg/encoder.c', - ] - if not get_option('sink-only') - ffmpeg_src += [ - 'ffmpeg/demuxer.c', - 'ffmpeg/avio.c' - ] - endif - ffmpeg_inc = [] - ffmpeg_deps = [] - ffmpeg_args = [] - - libavutil = dependency('libavutil', required: false) - libavformat = dependency('libavformat', required: false) - libavcodec = dependency('libavcodec', required: false) - libswresample = dependency('libswresample', required: false) - libswscale = dependency('libswscale', required: false) - if not (libavutil.found() and libavformat.found() and libavcodec.found() and libswresample.found() and libswscale.found()) - ffmpeg_proj = subproject('ffmpeg', required: false) - if ffmpeg_proj.found() - libavutil = ffmpeg_proj.get_variable('avutil') - libavformat = ffmpeg_proj.get_variable('avformat') - libavcodec = ffmpeg_proj.get_variable('avcodec') - libswresample = ffmpeg_proj.get_variable('swresample') - libswscale = ffmpeg_proj.get_variable('swscale') - # Only used to set include dirs for FFmpeg. - ffmpeg_deps += [ffmpeg_proj.get_variable('ffmpeg_inc_dep')] - # We explicitly enable zlib in the FFmpeg build. - ffmpeg_deps += [dependency('zlib')] - if is_windows - # Extra static dependencies for Windows. - ffmpeg_deps += [compiler.find_library('bcrypt')] - elif is_android - ffmpeg_deps += [compiler.find_library('mediandk')] - endif - soxr = compiler.find_library('soxr', required: false) - if soxr.found() - ffmpeg_deps += [soxr] - ffmpeg_args += ['-DCAMU_HAVE_SOXR'] - endif - endif - endif - - if libavutil.found() and libavformat.found() and libavcodec.found() and libswresample.found() and libswscale.found() - ffmpeg_deps += [libavutil, libavformat, libavcodec, libswresample, libswscale] - ffmpeg_args += ['-DCAMU_HAVE_FFMPEG'] - ffmpeg_codec = declare_dependency(sources: ffmpeg_src, dependencies: ffmpeg_deps, - include_directories: ffmpeg_inc, compile_args: ffmpeg_args) - codec_deps += [ffmpeg_codec] - endif + subdir('ffmpeg') endif if get_option('codecs').contains('stb_image') - stb = subproject('stb').get_variable('stb') - stb_image_codec = declare_dependency(sources: ['stb_image/impl.c'], dependencies: stb) - codec_deps += [stb_image_codec] + subdir('stb_image') endif if get_option('codecs').contains('spng') - spng = dependency('spng', required: false) - if spng.found() - spng_codec = declare_dependency(sources: ['spng/impl.c'], dependencies: spng) - codec_deps += [spng_codec] - endif + subdir('spng') endif if get_option('codecs').contains('wuffs') - wuffs = subproject('wuffs').get_variable('wuffs') - wuffs_codec = declare_dependency(sources: ['wuffs/impl.c'], dependencies: wuffs) - codec_deps += [wuffs_codec] + subdir('wuffs') endif if not no_video - codec_deps += [stela] + codec_client_deps += [stela] endif -codecs = declare_dependency(dependencies: codec_deps) +codecs_server = declare_dependency(dependencies: codec_server_deps) +codecs_client = declare_dependency(dependencies: codec_client_deps) diff --git a/src/codec/spng/client.c b/src/codec/spng/client.c new file mode 100644 index 0000000..6edb9c9 --- /dev/null +++ b/src/codec/spng/client.c @@ -0,0 +1,77 @@ +#include <spng.h> + +#include "../common.h" + +#include "decoder.h" + +static bool spng_decoder_init(struct camu_decoder *dec, struct camu_renderer *renderer, struct camu_codec_stream *stream, + void (*callback)(void *, struct camu_codec_frame *), void *userdata) +{ + struct camu_spng_decoder *spng = (struct camu_spng_decoder *)dec; + (void)renderer; + spng->stream = stream; + spng->callback = callback; + spng->userdata = userdata; + return true; +} + +static s32 spng_decoder_push(struct camu_decoder *dec, struct camu_codec_packet *packet) +{ + struct camu_spng_decoder *spng = (struct camu_spng_decoder *)dec; + if (!packet) return CAMU_OK; + + spng_ctx *ctx = spng_ctx_new(SPNG_CTX_IGNORE_ADLER32); + spng_set_png_buffer(ctx, nn_buffer_get_ptr(packet->buffer, 0), packet->buffer->size); + spng_set_option(ctx, SPNG_CHUNK_COUNT_LIMIT, 6250); + spng_set_crc_action(ctx, SPNG_CRC_DISCARD, SPNG_CRC_DISCARD); + + size_t out_size; + spng_decoded_image_size(ctx, SPNG_FMT_RGBA8, &out_size); + + struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); + frame->mode = CAMU_NORMAL; + frame->data = camu_page_alloc(out_size); + spng_decode_chunks(ctx); + spng_decode_image(ctx, frame->data, out_size, SPNG_FMT_RGBA8, 0); + spng_ctx_free(ctx); + frame->flags = 0; + frame->format = CAMU_PIXEL_FORMAT_RGBA; + struct camu_video_format *fmt = &spng->stream->video.fmt; + frame->video.width = fmt->width; + frame->video.height = fmt->height; + frame->pts = 0.0; + + spng->callback(spng->userdata, frame); + + return CAMU_OK; +} + +static void spng_decoder_flush(struct camu_decoder *dec) +{ + (void)dec; +} + +static s32 spng_decoder_process(struct camu_decoder *dec) +{ + (void)dec; + return CAMU_ERR_EOF; +} + +static void spng_decoder_free(struct camu_decoder **dec) +{ + struct camu_spng_decoder *spng = (struct camu_spng_decoder *)*dec; + al_free(spng); + *dec = NULL; +} + +struct camu_decoder *camu_spng_decoder_create(void) +{ + struct camu_spng_decoder *spng = al_alloc_object(struct camu_spng_decoder); + spng->dec.mode = CAMU_NORMAL; + spng->dec.init = spng_decoder_init; + spng->dec.push = spng_decoder_push; + spng->dec.process = spng_decoder_process; + spng->dec.flush = spng_decoder_flush; + spng->dec.free = spng_decoder_free; + return (struct camu_decoder *)spng; +} diff --git a/src/codec/spng/impl.c b/src/codec/spng/impl.c index 3fb7e21..e69de29 100644 --- a/src/codec/spng/impl.c +++ b/src/codec/spng/impl.c @@ -1,164 +0,0 @@ -#include <al/lib.h> -#include <nnwt/common.h> -#include <spng.h> - -#include "../../cache/entry.h" - -#include "../common.h" - -#include "demuxer.h" -#include "decoder.h" - -static bool spng_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handle) -{ - struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)demux; - - spng->handle = handle; - nn_buffer_init(&spng->buffer); - spng->eof = false; - - cch_handle_seek(spng->handle, 0, SEEK_SET); - off_t size = cch_entry_get_size(spng->handle->entry); - nn_buffer_ensure_space(&spng->buffer, size); - cch_handle_read(spng->handle, nn_buffer_get_ptr(&spng->buffer, 0), size); - spng->buffer.size = size; - - spng_ctx *ctx = spng_ctx_new(SPNG_CTX_IGNORE_ADLER32); - spng_set_png_buffer(ctx, nn_buffer_get_ptr(&spng->buffer, 0), spng->buffer.size); - spng_set_option(ctx, SPNG_CHUNK_COUNT_LIMIT, 6250); - spng_set_crc_action(ctx, SPNG_CRC_DISCARD, SPNG_CRC_DISCARD); - - struct spng_ihdr ihdr; - spng_get_ihdr(ctx, &ihdr); - - struct camu_codec_stream stream; - stream.mode = CAMU_NORMAL; - stream.type = CAMU_STREAM_VIDEO; - stream.video.width = ihdr.width; - stream.video.height = ihdr.height; - stream.video.format = CAMU_PIXEL_FORMAT_RGBA; - - al_array_push(spng->demux.streams, stream); - - spng_ctx_free(ctx); - - return true; -} - -static s32 spng_demuxer_get_packet(struct camu_demuxer *demux, struct camu_codec_packet *packet) -{ - struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)demux; - if (!spng->eof) { - packet->mode = CAMU_NORMAL; - packet->buffer = &spng->buffer; - spng->eof = true; - return CAMU_OK; - } - return CAMU_ERR_EOF; -} - -static u64 spng_demuxer_get_duration(struct camu_demuxer *demux) -{ - (void)demux; - return 0; -} - -static bool spng_demuxer_seek(struct camu_demuxer *demux, u64 pos) -{ - (void)demux; - (void)pos; - return true; -} - -static void spng_demuxer_free(struct camu_demuxer **demux) -{ - struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)*demux; - nn_buffer_free(&spng->buffer); - al_array_free(spng->demux.streams); - al_free(spng); - *demux = NULL; -} - -static bool spng_decoder_init(struct camu_decoder *dec, struct camu_renderer *renderer, struct camu_codec_stream *stream, - void (*callback)(void *, struct camu_codec_frame *), void *userdata) -{ - struct camu_spng_decoder *spng = (struct camu_spng_decoder *)dec; - (void)renderer; - spng->stream = stream; - spng->callback = callback; - spng->userdata = userdata; - return true; -} - -static s32 spng_decoder_push(struct camu_decoder *dec, struct camu_codec_packet *packet) -{ - struct camu_spng_decoder *spng = (struct camu_spng_decoder *)dec; - if (!packet) return CAMU_OK; - - spng_ctx *ctx = spng_ctx_new(SPNG_CTX_IGNORE_ADLER32); - spng_set_png_buffer(ctx, nn_buffer_get_ptr(packet->buffer, 0), packet->buffer->size); - spng_set_option(ctx, SPNG_CHUNK_COUNT_LIMIT, 6250); - spng_set_crc_action(ctx, SPNG_CRC_DISCARD, SPNG_CRC_DISCARD); - - size_t out_size; - spng_decoded_image_size(ctx, SPNG_FMT_RGBA8, &out_size); - - struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); - frame->mode = CAMU_NORMAL; - frame->data = camu_page_alloc(out_size); - spng_decode_chunks(ctx); - spng_decode_image(ctx, frame->data, out_size, SPNG_FMT_RGBA8, 0); - spng_ctx_free(ctx); - frame->flags = 0; - frame->format = CAMU_PIXEL_FORMAT_RGBA; - frame->width = spng->stream->video.width; - frame->height = spng->stream->video.height; - frame->pts = 0.0; - - spng->callback(spng->userdata, frame); - - return CAMU_OK; -} - -static void spng_decoder_flush(struct camu_decoder *dec) -{ - (void)dec; -} - -static s32 spng_decoder_process(struct camu_decoder *dec) -{ - (void)dec; - return CAMU_ERR_EOF; -} - -static void spng_decoder_free(struct camu_decoder **dec) -{ - struct camu_spng_decoder *spng = (struct camu_spng_decoder *)*dec; - al_free(spng); - *dec = NULL; -} - -struct camu_demuxer *camu_spng_demuxer_create(void) -{ - struct camu_spng_demuxer *spng = al_alloc_object(struct camu_spng_demuxer); - spng->demux.mode = CAMU_NORMAL; - al_array_init(spng->demux.streams); - spng->demux.init = spng_demuxer_init; - spng->demux.get_packet = spng_demuxer_get_packet; - spng->demux.get_duration = spng_demuxer_get_duration; - spng->demux.seek = spng_demuxer_seek; - spng->demux.free = spng_demuxer_free; - return (struct camu_demuxer *)spng; -} - -struct camu_decoder *camu_spng_decoder_create(void) -{ - struct camu_spng_decoder *spng = al_alloc_object(struct camu_spng_decoder); - spng->dec.mode = CAMU_NORMAL; - spng->dec.init = spng_decoder_init; - spng->dec.push = spng_decoder_push; - spng->dec.process = spng_decoder_process; - spng->dec.flush = spng_decoder_flush; - spng->dec.free = spng_decoder_free; - return (struct camu_decoder *)spng; -} diff --git a/src/codec/spng/meson.build b/src/codec/spng/meson.build new file mode 100644 index 0000000..d8af781 --- /dev/null +++ b/src/codec/spng/meson.build @@ -0,0 +1,3 @@ +spng = dependency('spng') +codec_server_deps += [declare_dependency(sources: ['server.c'], dependencies: spng)] +codec_client_deps += [declare_dependency(sources: ['client.c'], dependencies: spng)] diff --git a/src/codec/spng/server.c b/src/codec/spng/server.c new file mode 100644 index 0000000..8eb941b --- /dev/null +++ b/src/codec/spng/server.c @@ -0,0 +1,90 @@ +#include <spng.h> + +#include "../../cache/entry.h" + +#include "demuxer.h" + +static bool spng_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handle) +{ + struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)demux; + + spng->handle = handle; + nn_buffer_init(&spng->buffer); + spng->eof = false; + + cch_handle_seek(spng->handle, 0, SEEK_SET); + off_t size = cch_entry_get_size(spng->handle->entry); + nn_buffer_ensure_space(&spng->buffer, size); + cch_handle_read(spng->handle, nn_buffer_get_ptr(&spng->buffer, 0), size); + spng->buffer.size = size; + + spng_ctx *ctx = spng_ctx_new(SPNG_CTX_IGNORE_ADLER32); + spng_set_png_buffer(ctx, nn_buffer_get_ptr(&spng->buffer, 0), spng->buffer.size); + spng_set_option(ctx, SPNG_CHUNK_COUNT_LIMIT, 6250); + spng_set_crc_action(ctx, SPNG_CRC_DISCARD, SPNG_CRC_DISCARD); + + struct spng_ihdr ihdr; + spng_get_ihdr(ctx, &ihdr); + + struct camu_codec_stream stream = { 0 }; + stream.mode = CAMU_NORMAL; + stream.type = CAMU_STREAM_VIDEO; + struct camu_video_format *fmt = &stream.video.fmt; + fmt->width = ihdr.width; + fmt->height = ihdr.height; + fmt->format = CAMU_PIXEL_FORMAT_RGBA; + + al_array_push(spng->demux.streams, stream); + + spng_ctx_free(ctx); + + return true; +} + +static s32 spng_demuxer_get_packet(struct camu_demuxer *demux, struct camu_codec_packet *packet) +{ + struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)demux; + if (!spng->eof) { + packet->mode = CAMU_NORMAL; + packet->buffer = &spng->buffer; + spng->eof = true; + return CAMU_OK; + } + return CAMU_ERR_EOF; +} + +static u64 spng_demuxer_get_duration(struct camu_demuxer *demux) +{ + (void)demux; + return 0; +} + +static bool spng_demuxer_seek(struct camu_demuxer *demux, u64 pos) +{ + (void)demux; + (void)pos; + return true; +} + +static void spng_demuxer_free(struct camu_demuxer **demux) +{ + struct camu_spng_demuxer *spng = (struct camu_spng_demuxer *)*demux; + nn_buffer_free(&spng->buffer); + al_array_free(spng->demux.streams); + al_free(spng); + *demux = NULL; +} + + +struct camu_demuxer *camu_spng_demuxer_create(void) +{ + struct camu_spng_demuxer *spng = al_alloc_object(struct camu_spng_demuxer); + spng->demux.mode = CAMU_NORMAL; + al_array_init(spng->demux.streams); + spng->demux.init = spng_demuxer_init; + spng->demux.get_packet = spng_demuxer_get_packet; + spng->demux.get_duration = spng_demuxer_get_duration; + spng->demux.seek = spng_demuxer_seek; + spng->demux.free = spng_demuxer_free; + return (struct camu_demuxer *)spng; +} diff --git a/src/codec/stb_image/client.c b/src/codec/stb_image/client.c new file mode 100644 index 0000000..3742def --- /dev/null +++ b/src/codec/stb_image/client.c @@ -0,0 +1,71 @@ +#include <stb_image.h> + +#include "decoder.h" + +static bool stbi_decoder_init(struct camu_decoder *dec, struct camu_renderer *renderer, struct camu_codec_stream *stream, + void (*callback)(void *, struct camu_codec_frame *), void *userdata) +{ + struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)dec; + (void)renderer; + stb->stream = stream; + stb->callback = callback; + stb->userdata = userdata; + return true; +} + +static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet *packet) +{ + struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)dec; + if (!packet) return CAMU_OK; + + s32 w, h, channels; + u8 *data = nn_buffer_get_ptr(packet->buffer, 0); + u8 *pixels = stbi_load_from_memory(data, packet->buffer->size, &w, &h, &channels, 0); + if (!pixels) return CAMU_ERR_ERROR; + struct camu_video_format *fmt = &stb->stream->video.fmt; + al_assert(w == fmt->width && h == fmt->height); + + struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); + frame->mode = CAMU_NORMAL; + frame->flags = 0; + frame->data = pixels; + frame->video.width = w; + frame->video.height = h; + frame->format = camu_pixel_format_from_channels(channels); + al_assert(frame->format == fmt->format); + frame->pts = 0.0; + + stb->callback(stb->userdata, frame); + + return CAMU_OK; +} + +static void stbi_decoder_flush(struct camu_decoder *dec) +{ + (void)dec; +} + +static s32 stbi_decoder_process(struct camu_decoder *dec) +{ + (void)dec; + return CAMU_ERR_EOF; +} + +static void stbi_decoder_free(struct camu_decoder **dec) +{ + struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)*dec; + al_free(stb); + *dec = NULL; +} + +struct camu_decoder *camu_stbi_decoder_create(void) +{ + struct camu_stbi_decoder *stb = al_alloc_object(struct camu_stbi_decoder); + stb->dec.mode = CAMU_NORMAL; + stb->dec.init = stbi_decoder_init; + stb->dec.push = stbi_decoder_push; + stb->dec.process = stbi_decoder_process; + stb->dec.flush = stbi_decoder_flush; + stb->dec.free = stbi_decoder_free; + return (struct camu_decoder *)stb; +} diff --git a/src/codec/stb_image/impl.c b/src/codec/stb_image/impl.c index 1d3a4a1..e59d581 100644 --- a/src/codec/stb_image/impl.c +++ b/src/codec/stb_image/impl.c @@ -1,169 +1,8 @@ -#include <al/lib.h> -#include <nnwt/common.h> #include "../common.h" #define STB_IMAGE_IMPLEMENTATION -#define STB_IMAGE_STATIC #define STBI_NO_STDIO #define STBI_NO_FAILURE_STRINGS #define STBI_MALLOC camu_page_alloc #define STBI_FREE al_free #define STBI_REALLOC camu_page_realloc -AL_UNUSED_FUNCTION_PUSH #include <stb_image.h> -AL_UNUSED_FUNCTION_POP - -#include "../../cache/entry.h" - -#include "demuxer.h" -#include "decoder.h" - -static bool stbi_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handle) -{ - struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)demux; - - stb->handle = handle; - nn_buffer_init(&stb->buffer); - stb->eof = false; - - cch_handle_seek(stb->handle, 0, SEEK_SET); - off_t size = cch_entry_get_size(stb->handle->entry); - nn_buffer_ensure_space(&stb->buffer, size); - cch_handle_read(stb->handle, nn_buffer_get_ptr(&stb->buffer, 0), size); - stb->buffer.size = size; - - s32 w, h, channels; - u8 *data = nn_buffer_get_ptr(&stb->buffer, 0); - if (!stbi_info_from_memory(data, stb->buffer.size, &w, &h, &channels)) { - goto err; - } - - struct camu_codec_stream stream = { 0 }; - stream.mode = CAMU_NORMAL; - stream.type = CAMU_STREAM_VIDEO; - struct camu_video_format *fmt = &stream.video.fmt; - fmt->width = w; - fmt->height = h; - fmt->format = camu_pixel_format_from_channels(channels); - - al_array_push(stb->demux.streams, stream); - - return true; -err: - return false; -} - -static s32 stbi_demuxer_get_packet(struct camu_demuxer *demux, struct camu_codec_packet *packet) -{ - struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)demux; - if (!stb->eof) { - packet->mode = CAMU_NORMAL; - packet->buffer = &stb->buffer; - stb->eof = true; - return CAMU_OK; - } - return CAMU_ERR_EOF; -} - -static u64 stbi_demuxer_get_duration(struct camu_demuxer *demux) -{ - (void)demux; - return 0; -} - -static bool stbi_demuxer_seek(struct camu_demuxer *demux, u64 pos) -{ - (void)demux; - (void)pos; - return true; -} - -static void stbi_demuxer_free(struct camu_demuxer **demux) -{ - struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)*demux; - nn_buffer_free(&stb->buffer); - al_array_free(stb->demux.streams); - al_free(stb); - *demux = NULL; -} - - -static bool stbi_decoder_init(struct camu_decoder *dec, struct camu_renderer *renderer, struct camu_codec_stream *stream, - void (*callback)(void *, struct camu_codec_frame *), void *userdata) -{ - struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)dec; - (void)renderer; - stb->stream = stream; - stb->callback = callback; - stb->userdata = userdata; - return true; -} - -static s32 stbi_decoder_push(struct camu_decoder *dec, struct camu_codec_packet *packet) -{ - struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)dec; - if (!packet) return CAMU_OK; - - s32 w, h, channels; - u8 *data = nn_buffer_get_ptr(packet->buffer, 0); - u8 *pixels = stbi_load_from_memory(data, packet->buffer->size, &w, &h, &channels, 0); - if (!pixels) return CAMU_ERR_ERROR; - struct camu_video_format *fmt = &stb->stream->video.fmt; - al_assert(w == fmt->width && h == fmt->height); - - struct camu_codec_frame *frame = al_alloc_object(struct camu_codec_frame); - frame->mode = CAMU_NORMAL; - frame->flags = 0; - frame->data = pixels; - frame->video.width = w; - frame->video.height = h; - frame->format = camu_pixel_format_from_channels(channels); - al_assert(frame->format == fmt->format); - frame->pts = 0.0; - - stb->callback(stb->userdata, frame); - - return CAMU_OK; -} - -static void stbi_decoder_flush(struct camu_decoder *dec) -{ - (void)dec; -} - -static s32 stbi_decoder_process(struct camu_decoder *dec) -{ - (void)dec; - return CAMU_ERR_EOF; -} - -static void stbi_decoder_free(struct camu_decoder **dec) -{ - struct camu_stbi_decoder *stb = (struct camu_stbi_decoder *)*dec; - al_free(stb); - *dec = NULL; -} - -struct camu_demuxer *camu_stbi_demuxer_create(void) -{ - struct camu_stbi_demuxer *stb = al_alloc_object(struct camu_stbi_demuxer); - stb->demux.mode = CAMU_NORMAL; - al_array_init(stb->demux.streams); - stb->demux.init = stbi_demuxer_init; - stb->demux.get_packet = stbi_demuxer_get_packet; - stb->demux.get_duration = stbi_demuxer_get_duration; - stb->demux.seek = stbi_demuxer_seek; - stb->demux.free = stbi_demuxer_free; - return (struct camu_demuxer *)stb; -} - -struct camu_decoder *camu_stbi_decoder_create(void) -{ - struct camu_stbi_decoder *stb = al_alloc_object(struct camu_stbi_decoder); - stb->dec.mode = CAMU_NORMAL; - stb->dec.init = stbi_decoder_init; - stb->dec.push = stbi_decoder_push; - stb->dec.process = stbi_decoder_process; - stb->dec.flush = stbi_decoder_flush; - stb->dec.free = stbi_decoder_free; - return (struct camu_decoder *)stb; -} diff --git a/src/codec/stb_image/meson.build b/src/codec/stb_image/meson.build new file mode 100644 index 0000000..fea86ff --- /dev/null +++ b/src/codec/stb_image/meson.build @@ -0,0 +1,3 @@ +stb = subproject('stb').get_variable('stb') +codec_server_deps += declare_dependency(sources: ['server.c', 'impl.c'], dependencies: stb) +codec_client_deps += declare_dependency(sources: ['client.c', 'impl.c'], dependencies: stb) diff --git a/src/codec/stb_image/server.c b/src/codec/stb_image/server.c new file mode 100644 index 0000000..3642a64 --- /dev/null +++ b/src/codec/stb_image/server.c @@ -0,0 +1,87 @@ +#include <stb_image.h> + +#include "../../cache/entry.h" + +#include "demuxer.h" + +static bool stbi_demuxer_init(struct camu_demuxer *demux, struct cch_handle *handle) +{ + struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)demux; + + stb->handle = handle; + nn_buffer_init(&stb->buffer); + stb->eof = false; + + cch_handle_seek(stb->handle, 0, SEEK_SET); + off_t size = cch_entry_get_size(stb->handle->entry); + nn_buffer_ensure_space(&stb->buffer, size); + cch_handle_read(stb->handle, nn_buffer_get_ptr(&stb->buffer, 0), size); + stb->buffer.size = size; + + s32 w, h, channels; + u8 *data = nn_buffer_get_ptr(&stb->buffer, 0); + if (!stbi_info_from_memory(data, stb->buffer.size, &w, &h, &channels)) { + goto err; + } + + struct camu_codec_stream stream = { 0 }; + stream.mode = CAMU_NORMAL; + stream.type = CAMU_STREAM_VIDEO; + struct camu_video_format *fmt = &stream.video.fmt; + fmt->width = w; + fmt->height = h; + fmt->format = camu_pixel_format_from_channels(channels); + + al_array_push(stb->demux.streams, stream); + + return true; +err: + return false; +} + +static s32 stbi_demuxer_get_packet(struct camu_demuxer *demux, struct camu_codec_packet *packet) +{ + struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)demux; + if (!stb->eof) { + packet->mode = CAMU_NORMAL; + packet->buffer = &stb->buffer; + stb->eof = true; + return CAMU_OK; + } + return CAMU_ERR_EOF; +} + +static u64 stbi_demuxer_get_duration(struct camu_demuxer *demux) +{ + (void)demux; + return 0; +} + +static bool stbi_demuxer_seek(struct camu_demuxer *demux, u64 pos) +{ + (void)demux; + (void)pos; + return true; +} + +static void stbi_demuxer_free(struct camu_demuxer **demux) +{ + struct camu_stbi_demuxer *stb = (struct camu_stbi_demuxer *)*demux; + nn_buffer_free(&stb->buffer); + al_array_free(stb->demux.streams); + al_free(stb); + *demux = NULL; +} + +struct camu_demuxer *camu_stbi_demuxer_create(void) +{ + struct camu_stbi_demuxer *stb = al_alloc_object(struct camu_stbi_demuxer); + stb->demux.mode = CAMU_NORMAL; + al_array_init(stb->demux.streams); + stb->demux.init = stbi_demuxer_init; + stb->demux.get_packet = stbi_demuxer_get_packet; + stb->demux.get_duration = stbi_demuxer_get_duration; + stb->demux.seek = stbi_demuxer_seek; + stb->demux.free = stbi_demuxer_free; + return (struct camu_demuxer *)stb; +} diff --git a/src/codec/wuffs/meson.build b/src/codec/wuffs/meson.build new file mode 100644 index 0000000..bb5007a --- /dev/null +++ b/src/codec/wuffs/meson.build @@ -0,0 +1,3 @@ +wuffs = subproject('wuffs').get_variable('wuffs') +#codec_server_deps += declare_dependency(sources: ['server.c'], dependencies: wuffs) +#codec_client_deps += declare_dependency(sources: ['client.c'], dependencies: wuffs) diff --git a/src/fruits/cmsrv/cmsrv.c b/src/fruits/cmsrv/cmsrv.c index 2f8322c..0149246 100644 --- a/src/fruits/cmsrv/cmsrv.c +++ b/src/fruits/cmsrv/cmsrv.c @@ -10,8 +10,10 @@ #include "../../server/server.h" #include "../../server/common.h" -#include "../../cache/handlers/cdio.h" #include "../../codec/ffmpeg/common.h" +#if CACHE_HAVE_CDIO +#include "../../cache/handlers/cdio.h" +#endif #include "../common.h" diff --git a/src/fruits/cmv/cmv.c b/src/fruits/cmv/cmv.c index 9926f32..ac6f6e8 100644 --- a/src/fruits/cmv/cmv.c +++ b/src/fruits/cmv/cmv.c @@ -71,14 +71,16 @@ s32 main(s32 argc, char *argv[]) camu_ff_set_default_log_callback(); #endif - str home; - al_str_from(&home, getenv("HOME")); - - str color_palette; - al_str_clone(&color_palette, &home); - al_str_cat(&color_palette, &al_str_c("/.config/colors.json")); - camu_color_palette_init(&color_palette); - al_str_free(&color_palette); + str home = al_str_null(); + char *home_env = getenv("HOME"); + if (home_env) { + al_str_from(&home, home_env); + str color_palette; + al_str_clone(&color_palette, &home); + al_str_cat(&color_palette, &al_str_c("/.config/colors.json")); + camu_color_palette_init(&color_palette); + al_str_free(&color_palette); + } nn_event_loop_init(&c.loop); @@ -105,7 +107,7 @@ s32 main(s32 argc, char *argv[]) addr = &CAMU_TEST_ADDR; } #else - type = NNWT_SOCKET_TCP; addr = CAMU_TEST_ADDR; + type = NNWT_SOCKET_TCP; addr = &CAMU_TEST_ADDR; #endif if (!camu_desktop_init(&c.desktop, "cmv")) failure(); diff --git a/src/fruits/cmv/meson.build b/src/fruits/cmv/meson.build index 9b83847..870345e 100644 --- a/src/fruits/cmv/meson.build +++ b/src/fruits/cmv/meson.build @@ -7,14 +7,10 @@ else cmv_deps += [server] endif -if get_option('portal').enabled() - cmv_deps += [portal] -endif - use_tui = false if use_tui cmv_src += [] - cmv_deps += [dependency('notcurses')] + cmv_deps += [notcurses] endif cmv_link_args = [] diff --git a/src/fruits/ctv/meson.build b/src/fruits/ctv/meson.build index 5a4dca8..1b653e7 100644 --- a/src/fruits/ctv/meson.build +++ b/src/fruits/ctv/meson.build @@ -1,6 +1,5 @@ ctv_src = ['ctv.c', '../../sink/common.c'] ctv_deps = [common_deps, libsink] ctv_args = ['-DCAMU_MIXER_THREADED', '-DCAMU_SCREEN_THREADED'] - # https://github.com/google/ExoPlayer/issues/9933#issuecomment-1029775358 shared_library('ctv', ctv_src, dependencies: ctv_deps, c_args: ctv_args, link_args: ['-Wl,-Bsymbolic', '-static-libstdc++']) diff --git a/src/fruits/meson.build b/src/fruits/meson.build index 2ceeaa0..37edd0b 100644 --- a/src/fruits/meson.build +++ b/src/fruits/meson.build @@ -1,28 +1,34 @@ -if get_option('server').enabled() or get_option('client').enabled() +if (get_option('server').enabled() or get_option('client').enabled()) and not is_windows notcurses = dependency('notcurses', required: false, allow_fallback: false) notcurses_core = dependency('notcurses-core', required: false, allow_fallback: false) if not notcurses.found() or not notcurses_core.found() notcurses_opts = cmake.subproject_options() notcurses_opts.add_cmake_defines({ 'CMAKE_BUILD_TYPE': is_debug ? 'Debug' : 'Release' }) notcurses_opts.add_cmake_defines({ 'USE_CXX': false }) + notcurses_opts.add_cmake_defines({ 'USE_DEFLATE': false }) notcurses_opts.add_cmake_defines({ 'USE_DOCTEST': false }) notcurses_opts.add_cmake_defines({ 'USE_PANDOC': false }) notcurses_opts.add_cmake_defines({ 'BUILD_EXECUTABLES': false }) notcurses_opts.add_cmake_defines({ 'BUILD_FFI_LIBRARY': false }) notcurses_opts.add_cmake_defines({ 'USE_POC': false }) - notcurses_opts.add_cmake_defines({ 'USE_STATIC': false }) - notcurses_opts.add_cmake_defines({ 'USE_MULTIMEDIA': 'ffmpeg' }) + notcurses_opts.add_cmake_defines({ 'USE_STATIC': true }) + notcurses_opts.add_cmake_defines({ 'USE_MULTIMEDIA': is_windows ? 'none' : 'ffmpeg' }) notcurses_proj = cmake.subproject('notcurses', options: notcurses_opts) - notcurses = notcurses_proj.dependency('notcurses') - notcurses_core = notcurses_proj.dependency('notcurses-core') + if is_windows + notcurses = notcurses_proj.dependency('notcurses-static') + notcurses_core = notcurses_proj.dependency('notcurses-core-static') + else + notcurses = notcurses_proj.dependency('notcurses') + notcurses_core = notcurses_proj.dependency('notcurses-core') + endif endif endif -if get_option('server').enabled() +if get_option('server').enabled() and not is_windows subdir('cmsrv') endif -if get_option('client').enabled() +if get_option('client').enabled() and not is_windows subdir('cmc') endif diff --git a/src/liana/handlers.c b/src/liana/handlers.c index 38e5bfa..69737ee 100644 --- a/src/liana/handlers.c +++ b/src/liana/handlers.c @@ -4,7 +4,7 @@ #ifdef CACHE_HAVE_CDIO #include "handlers/cdio.h" #endif -#ifdef LIANA_HAVE_DVD +#ifdef CACHE_HAVE_LIBDVD #include "handlers/dvd.h" #endif @@ -29,9 +29,9 @@ struct lia_handler_entry liana_handlers[] = { #endif }, #endif -#ifdef LIANA_HAVE_DVD +#ifdef CACHE_HAVE_LIBDVD { - .name = al_str_c("dvd"), + .name = al_str_c("libdvd"), #ifdef LIANA_SERVER .create_server_handler = lia_dvd_server_create, #endif diff --git a/src/liana/meson.build b/src/liana/meson.build index beb6f68..34abc66 100644 --- a/src/liana/meson.build +++ b/src/liana/meson.build @@ -10,7 +10,8 @@ liana_client_src = [ 'handlers/codec_client.c', 'handlers.c' ] -liana_deps = [codecs] +liana_server_deps = [cache, codecs_server] +liana_client_deps = [codecs_client] liana_args = [] if cache_have_cdio @@ -18,17 +19,12 @@ if cache_have_cdio liana_client_src += ['handlers/cdio_client.c'] endif -libdvdcss = dependency('libdvdcss') -libdvdread = dependency('dvdread') -libdvdnav = dependency('dvdnav') -if libdvdcss.found() and libdvdread.found() and libdvdnav.found() +if cache_have_libdvd liana_server_src += ['handlers/dvd_server.c'] liana_client_src += ['handlers/dvd_client.c'] - liana_deps += [libdvdcss, libdvdread, libdvdnav] - liana_args += ['-DLIANA_HAVE_DVD'] endif liana_server = declare_dependency(sources: liana_server_src, - dependencies: liana_deps, compile_args: [liana_args, '-DLIANA_SERVER']) + dependencies: liana_server_deps, compile_args: [liana_args, '-DLIANA_SERVER']) liana_client = declare_dependency(sources: liana_client_src, - dependencies: liana_deps, compile_args: [liana_args, '-DLIANA_CLIENT']) + dependencies: liana_client_deps, compile_args: [liana_args, '-DLIANA_CLIENT']) diff --git a/src/libsink/meson.build b/src/libsink/meson.build index 7f2d1d4..a0805af 100644 --- a/src/libsink/meson.build +++ b/src/libsink/meson.build @@ -1,10 +1,11 @@ libsink_src = ['sink.c'] libsink_deps = [buffer, mixer, liana_client] libsink_args = [] + if not no_video libsink_deps += [screen] else libsink_args += ['-DCAMU_SINK_NO_VIDEO'] endif -libsink = declare_dependency(sources: libsink_src, dependencies: libsink_deps, - compile_args: libsink_args) + +libsink = declare_dependency(sources: libsink_src, dependencies: libsink_deps, compile_args: libsink_args) diff --git a/src/render/meson.build b/src/render/meson.build index c2bcfd7..668c3d4 100644 --- a/src/render/meson.build +++ b/src/render/meson.build @@ -62,7 +62,42 @@ endif libass_opts = [] if not is_windows libass_opts += ['fontconfig=enabled'] + # libass(e46aede):meson.build:126 + fontconfig = dependency('fontconfig', + version: '>=2.10.92', + default_options: [ + 'doc=disabled', + 'nls=disabled', + 'tests=disabled', + 'tools=disabled', + 'cache-build=disabled' + ]) endif +# libass(e46aede):meson.build:90 +fribidi = dependency('fribidi', + version: '>=0.19.1', + default_options: [ + 'docs=false', + 'tests=false', + 'bin=false' + ]) +# libass(e46aede):meson.build:84 +# fontconfig(72b9a48):meson.build:28 +freetype = dependency('freetype2', + version: '>=9.17.3', + default_options: [ + 'harfbuzz=disabled' + ]) +# freetype2(42608f7):meson.build:346 +harfbuz = dependency('harfbuzz', + version: '>=2.0.0', + default_options: [ + 'freetype=disabled', + 'tests=disabled', + 'introspection=disabled', + 'docs=disabled', + 'utilities=disabled' + ]) libass = dependency('libass', default_options: libass_opts) render_deps += [libass] diff --git a/src/server/meson.build b/src/server/meson.build index 52c993f..1b9676c 100644 --- a/src/server/meson.build +++ b/src/server/meson.build @@ -3,8 +3,10 @@ server_src = [ 'user.c', 'db.c' ] -server_deps = [cache, liana_server] +server_deps = [liana_server] + if get_option('portal').enabled() server_deps += [portal] endif + server = declare_dependency(sources: server_src, dependencies: server_deps) diff --git a/src/sink/meson.build b/src/sink/meson.build index 124c7a5..0c115f8 100644 --- a/src/sink/meson.build +++ b/src/sink/meson.build @@ -1,5 +1,4 @@ desktop_src = ['desktop.c', 'common.c', 'input_simulator.c'] desktop_deps = [libsink] desktop_args = ['-DCAMU_MIXER_THREADED', '-DCAMU_SCREEN_THREADED'] -desktop = declare_dependency(sources: desktop_src, dependencies: desktop_deps, - compile_args: desktop_args) +desktop = declare_dependency(sources: desktop_src, dependencies: desktop_deps, compile_args: desktop_args) diff --git a/src/util/color_palette.c b/src/util/color_palette.c index 02af36f..73dfc83 100644 --- a/src/util/color_palette.c +++ b/src/util/color_palette.c @@ -31,9 +31,11 @@ static char *normal_colors[16] = { "color14", "color15" }; +#endif bool camu_color_palette_init(str *path) { +#ifdef NAUNET_HAS_JSON struct nn_file file; if (!nn_file_open(&file, path, NNWT_FILE_READONLY)) { return false; @@ -93,6 +95,8 @@ bool camu_color_palette_init(str *path) al_log_warn("color_palette", "%s is not a valid hex color.", normal_colors[i]); } } +#else + (void)path; +#endif return true; } -#endif diff --git a/src/util/color_palette.h b/src/util/color_palette.h index e3e4ed5..a71360c 100644 --- a/src/util/color_palette.h +++ b/src/util/color_palette.h @@ -32,6 +32,4 @@ struct camu_color_palette { extern struct camu_color_palette global_color_palette; -#ifdef NAUNET_HAS_JSON bool camu_color_palette_init(str *path); -#endif diff --git a/subprojects/BLAKE3.wrap b/subprojects/BLAKE3.wrap index ebccf0d..7f3b7da 100644 --- a/subprojects/BLAKE3.wrap +++ b/subprojects/BLAKE3.wrap @@ -1,6 +1,7 @@ [wrap-git] +directory = BLAKE3-d2e8069 url = https://github.com/BLAKE3-team/BLAKE3.git -revision = 5c8b350b3531102359b89e9f0a3367e6de4a43f4 +revision = d2e8069161fef13bf0a5198a75dbaee81d8854d9 depth = 1 patch_directory = BLAKE3 method = cmake diff --git a/subprojects/libalabaster.wrap b/subprojects/libalabaster.wrap index 1fec842..cceb244 100644 --- a/subprojects/libalabaster.wrap +++ b/subprojects/libalabaster.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://git.akon.city/libalabaster -revision = 209310c561d89c9ed2040aa7053b320d32cc393c +revision = 562c730ac38749fb43ae5b7b53ae5f3043166bd1 depth = 1 diff --git a/subprojects/libcdio-paranoia.wrap b/subprojects/libcdio-paranoia.wrap index f1ed23c..c271d48 100644 --- a/subprojects/libcdio-paranoia.wrap +++ b/subprojects/libcdio-paranoia.wrap @@ -1,6 +1,7 @@ [wrap-git] +directory = libcdio-paranoia-717f126 url = https://github.com/rocky/libcdio-paranoia.git -revision = 28ad7d06c503989f4738bcc9d44b2a035f162d24 +revision = 717f1263910695e8bc66ad33d08a61ff572c0691 depth = 1 patch_directory = libcdio-paranoia diff --git a/subprojects/libdvdcss.wrap b/subprojects/libdvdcss.wrap index acbc6f2..fde6a82 100644 --- a/subprojects/libdvdcss.wrap +++ b/subprojects/libdvdcss.wrap @@ -1,4 +1,5 @@ [wrap-git] +directory = libdvdcss-d0b6a29 url = https://code.videolan.org/videolan/libdvdcss.git revision = d0b6a291c24eda3727ad5c7a14956fc1fc82446d depth = 1 diff --git a/subprojects/libdvdnav.wrap b/subprojects/libdvdnav.wrap index 6bc37a3..a0953d8 100644 --- a/subprojects/libdvdnav.wrap +++ b/subprojects/libdvdnav.wrap @@ -1,4 +1,5 @@ [wrap-git] +directory = libdvdnav-9831fe0 url = https://code.videolan.org/videolan/libdvdnav.git revision = 9831fe01488bd0e9d1e3521195da6940cd8415eb depth = 1 diff --git a/subprojects/libdvdread.wrap b/subprojects/libdvdread.wrap index 932fd51..f347dd4 100644 --- a/subprojects/libdvdread.wrap +++ b/subprojects/libdvdread.wrap @@ -1,4 +1,5 @@ [wrap-git] +directory = libdvdread-ba2227b url = https://code.videolan.org/videolan/libdvdread.git revision = ba2227bb8619724c2bfadcc4d8f25d741a3398ac depth = 1 diff --git a/subprojects/libnaunet.wrap b/subprojects/libnaunet.wrap index 0466a46..7cce0e2 100644 --- a/subprojects/libnaunet.wrap +++ b/subprojects/libnaunet.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://git.akon.city/libnaunet -revision = cef6cabce7ae97e9edfb6821ce4393d714579866 +revision = e48874a91a86ef561aa4b3298d6170ec9777954e depth = 1 diff --git a/subprojects/libplacebo.wrap b/subprojects/libplacebo.wrap index 9eb608c..cc66e64 100644 --- a/subprojects/libplacebo.wrap +++ b/subprojects/libplacebo.wrap @@ -1,10 +1,11 @@ [wrap-git] +directory = libplacebo-118d810 url = https://code.videolan.org/videolan/libplacebo.git revision = 118d8106640796d3f2ceb55f8634a32a58a47aa2 clone-recursive = true depth = 1 -diff_files = libplacebo/cache_ref_rect.diff, libplacebo/fix_rotate.diff, libplacebo/no_dlltool_no_shaderc_version.diff +diff_files = libplacebo/cache_ref_rect.diff, libplacebo/fix_rotate.diff, libplacebo/no_dlltool_no_shaderc_version.diff, libplacebo/compiler_warnings.diff, libplacebo/glClientWaitSync_0_return.diff, libplacebo/info_priv_hash.diff [provide] dependency_names = libplacebo diff --git a/subprojects/miniaudio.wrap b/subprojects/miniaudio.wrap index 9936650..e4e8862 100644 --- a/subprojects/miniaudio.wrap +++ b/subprojects/miniaudio.wrap @@ -1,6 +1,7 @@ [wrap-git] +directory = miniaudio-6d5efde url = https://github.com/mackron/miniaudio.git -revision = fc905ec97fdd4935f6066e648cccf1a098cd66cb +revision = 6d5efde254a81e42294f3baf4a4376a76492c192 depth = 1 patch_directory = miniaudio diff_files = miniaudio/miniaudio_pulse_flush.diff, miniaudio/miniaudio_alsa_compile.diff diff --git a/subprojects/notcurses.wrap b/subprojects/notcurses.wrap index f946c58..eda7b98 100644 --- a/subprojects/notcurses.wrap +++ b/subprojects/notcurses.wrap @@ -1,4 +1,5 @@ [wrap-git] +directory = notcurses-c11efe8 url = https://github.com/dankamongmen/notcurses.git revision = c11efe877f2245901f5c9ce110de7a2c83cfa2ed depth = 1 diff --git a/subprojects/packagefiles/glfm/get_egl_internal.diff b/subprojects/packagefiles/glfm/get_egl_internal.diff deleted file mode 100644 index 3c9098c..0000000 --- a/subprojects/packagefiles/glfm/get_egl_internal.diff +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/include/glfm.h b/include/glfm.h -index ceace39..d18711c 100644 ---- a/include/glfm.h -+++ b/include/glfm.h -@@ -892,6 +892,9 @@ ANativeActivity *glfmAndroidGetActivity(void) GLFM_DEPRECATED("Use glfmGetAndroi - /// ``GLFMAppFocusFunc``. - void *glfmGetAndroidActivity(const GLFMDisplay *display); - -+void *glfmGetEglDisplay(const GLFMDisplay *display); -+void *glfmGetEglContext(const GLFMDisplay *display); -+ - #endif // GLFM_EXPOSE_NATIVE_ANDROID - - #ifdef __cplusplus -diff --git a/src/glfm_android.c b/src/glfm_android.c -index 67d1927..7942ddf 100644 ---- a/src/glfm_android.c -+++ b/src/glfm_android.c -@@ -2800,4 +2800,20 @@ void *glfmGetAndroidActivity(const GLFMDisplay *display) { - return platformData->activity; - } - -+void *glfmGetEglDisplay(const GLFMDisplay *display) { -+ if (!display || !display->platformData) { -+ return NULL; -+ } -+ GLFMPlatformData *platformData = display->platformData; -+ return platformData->eglDisplay; -+} -+ -+void *glfmGetEglContext(const GLFMDisplay *display) { -+ if (!display || !display->platformData) { -+ return NULL; -+ } -+ GLFMPlatformData *platformData = display->platformData; -+ return platformData->eglContext; -+} -+ - #endif // __ANDROID__ diff --git a/subprojects/packagefiles/libcdio-paranoia/meson.build b/subprojects/packagefiles/libcdio-paranoia/meson.build index 42818f6..82b07b3 100644 --- a/subprojects/packagefiles/libcdio-paranoia/meson.build +++ b/subprojects/packagefiles/libcdio-paranoia/meson.build @@ -1,4 +1,4 @@ -project('libcdio-paranoia', 'c', version: 'git-28ad7d0', meson_version: '>=0.57.0') +project('libcdio-paranoia', 'c', version: 'git-717f126', meson_version: '>=0.57.0') ext_proj = import('unstable-external_project') diff --git a/subprojects/packagefiles/libplacebo/compiler_warnings.diff b/subprojects/packagefiles/libplacebo/compiler_warnings.diff new file mode 100644 index 0000000..f3ec3af --- /dev/null +++ b/subprojects/packagefiles/libplacebo/compiler_warnings.diff @@ -0,0 +1,19 @@ +diff --git a/src/include/libplacebo/utils/libav_internal.h b/src/include/libplacebo/utils/libav_internal.h +index 06b151b..67ac387 100644 +--- a/src/include/libplacebo/utils/libav_internal.h ++++ b/src/include/libplacebo/utils/libav_internal.h +@@ -59,11 +59,14 @@ PL_LIBAV_API enum pl_color_system pl_system_from_av(enum AVColorSpace spc) + case AVCOL_SPC_SMPTE170M: return PL_COLOR_SYSTEM_BT_601; + case AVCOL_SPC_SMPTE240M: return PL_COLOR_SYSTEM_SMPTE_240M; + case AVCOL_SPC_YCGCO: return PL_COLOR_SYSTEM_YCGCO; ++ case AVCOL_SPC_YCGCO_RE: return PL_COLOR_SYSTEM_UNKNOWN; // missing ++ case AVCOL_SPC_YCGCO_RO: return PL_COLOR_SYSTEM_UNKNOWN; // missing + case AVCOL_SPC_BT2020_NCL: return PL_COLOR_SYSTEM_BT_2020_NC; + case AVCOL_SPC_BT2020_CL: return PL_COLOR_SYSTEM_BT_2020_C; + case AVCOL_SPC_SMPTE2085: return PL_COLOR_SYSTEM_UNKNOWN; // missing + case AVCOL_SPC_CHROMA_DERIVED_NCL: return PL_COLOR_SYSTEM_UNKNOWN; // missing + case AVCOL_SPC_CHROMA_DERIVED_CL: return PL_COLOR_SYSTEM_UNKNOWN; // missing ++ case AVCOL_SPC_IPT_C2: return PL_COLOR_SYSTEM_UNKNOWN; // missing + // Note: this colorspace is confused between PQ and HLG, which libav* + // requires inferring from other sources, but libplacebo makes explicit. + // Default to PQ as it's the more common scenario. diff --git a/subprojects/packagefiles/notcurses/notcurses_xopen_source.diff b/subprojects/packagefiles/notcurses/notcurses_xopen_source.diff deleted file mode 100644 index f334169..0000000 --- a/subprojects/packagefiles/notcurses/notcurses_xopen_source.diff +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5d6c1420d..7f575f257 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -226,10 +226,8 @@ endif() - # don't want these on freebsd/dragonfly/osx - if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - target_compile_definitions(notcurses-core -- PUBLIC -- _XOPEN_SOURCE=700 # wcwidth(3) requires _XOPEN_SOURCE, and is in our headers - PRIVATE -- _GNU_SOURCE _DEFAULT_SOURCE -+ _GNU_SOURCE _DEFAULT_SOURCE _XOPEN_SOURCE=700 - ) - target_compile_definitions(notcurses-core-static - PUBLIC diff --git a/subprojects/packagefiles/shaderc/third_party_fix_build.diff b/subprojects/packagefiles/shaderc/third_party_fix_build.diff new file mode 100644 index 0000000..03a1e11 --- /dev/null +++ b/subprojects/packagefiles/shaderc/third_party_fix_build.diff @@ -0,0 +1,13 @@ +diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt +index d44f62a..608accd 100644 +--- a/third_party/CMakeLists.txt ++++ b/third_party/CMakeLists.txt +@@ -87,7 +87,7 @@ if (NOT TARGET glslang) + # Glslang tests are off by default. Turn them on if testing Shaderc. + set(GLSLANG_TESTS ON) + endif() +- set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>) ++ #set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>) + add_subdirectory(${SHADERC_GLSLANG_DIR} glslang) + endif() + if (NOT TARGET glslang) diff --git a/subprojects/packagefiles/wuffs/meson.build b/subprojects/packagefiles/wuffs/meson.build index dafc5b2..c595249 100644 --- a/subprojects/packagefiles/wuffs/meson.build +++ b/subprojects/packagefiles/wuffs/meson.build @@ -1,2 +1,2 @@ -project('wuff', 'c', version: 'git-7bd37b9') +project('wuff', 'c', version: 'git-d662ef5') wuffs = declare_dependency(include_directories: include_directories('./release/c')) diff --git a/subprojects/shaderc.wrap b/subprojects/shaderc.wrap index 752f8e2..06e2e34 100644 --- a/subprojects/shaderc.wrap +++ b/subprojects/shaderc.wrap @@ -1,5 +1,8 @@ [wrap-git] +directory = shaderc-3158c54 url = https://github.com/google/shaderc.git -revision = ddac450a36a3be28a2c2173f26703249dd83cfdf +revision = 3158c54654b2d9589f402fa27aa7e28438fd6333 depth = 1 method = cmake +patch_directory = shaderc +diff_files = shaderc/third_party_fix_build.diff diff --git a/subprojects/stela.wrap b/subprojects/stela.wrap index fb20893..26184ba 100644 --- a/subprojects/stela.wrap +++ b/subprojects/stela.wrap @@ -1,4 +1,4 @@ [wrap-git] url = https://git.akon.city/stela -revision = 35a0c4feb6569895bf19c05c510a674666dcc4c6 +revision = a55bfe4c21858eef0eb1bddf4085fcfde1b7e07d depth = 1 diff --git a/subprojects/wuffs.wrap b/subprojects/wuffs.wrap index 165ae9e..113e521 100644 --- a/subprojects/wuffs.wrap +++ b/subprojects/wuffs.wrap @@ -1,5 +1,6 @@ [wrap-git] +directory = wuffs-d662ef5 url = https://github.com/google/wuffs.git -revision = 7bd37b9bc168f59c220995c152e68ff012a9935a +revision = d662ef548401b62e3addbd5df34056cfa83ee184 depth = 1 patch_directory = wuffs diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap deleted file mode 100644 index 2a4215f..0000000 --- a/subprojects/zlib.wrap +++ /dev/null @@ -1,5 +0,0 @@ -[wrap-git] -url = https://github.com/madler/zlib.git -revision = 09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851 -depth = 1 -method = cmake |