Files
mpv-joc/fork/files/audio/decode/ad_joc.h
T
TheM14 66359ff089 Add native ad-joc-pcm takeover with libswresample
- Add ad-joc-pcm (default no). With it disabled, non-E-AC-3 audio is handed
  directly to ad_lavc and the native component does not take PCM over.
- With ad-joc-pcm=yes, decode registered PCM/compressed codecs with
  libavcodec, convert to 48 kHz interleaved float32 through libswresample,
  and feed joc_core's JOC_STREAM_IN_PCM_LAYOUT path.
- Register common codecs (FLAC, MP3, AAC, AC3, TrueHD, DTS, ALAC, Vorbis,
  Opus, WavPack, APE, TTA, MPC and PCM variants) so ad=joc can select the
  native path for them.
- Keep the existing E-AC-3 JOC path unchanged; ad-joc-pcm only affects
  non-E-AC-3 inputs.
- Document the option in fork/mpv.conf.example and fork/README.md.
2026-11-13 14:23:35 +08:00

30 lines
1.2 KiB
C

/*
* MIT License, Copyright (c) 2026 TheM14
*
* This file is compiled into mpv, so the resulting player is distributed under
* mpv's own license (LGPL-2.1-or-later, or GPL-2.0-or-later when built with
* -Dgpl=true). mpv's license text is in LICENSE-mpv.
*/
/* --ad-joc-* options, shared by the decoder (audio/decode/ad_joc.c) and the
* option table (options/options.c). These are ordinary mpv options, so
* mpv.conf carries them: "ad-joc-binaural=yes", "ad-joc-hrtf=...". */
#pragma once
#include <stdbool.h>
#include "options/m_option.h"
struct ad_joc_params {
bool binaural; /* binaural (stereo) output; off uses the speaker layout */
bool pcm; /* also decode ordinary PCM/compressed audio into the renderer */
char *hrtf; /* SOFA / Rosella / .jochrtf; the kind is detected */
char *layout; /* speaker layout name, e.g. "7.1" or "9.1.6" */
bool int24; /* quantise the output to the renderer's int24 rule */
int binaural_mode; /* JOC_BINAURAL_NEAR(1) / FAR(2) / MID(3) */
int rosella_filterbank; /* Rosella filterbank: 0 default (public), 2 captured */
double gain_db;
};
extern const struct m_sub_options ad_joc_conf;