Audio Encoder laag.

This commit is contained in:
2026-06-08 10:27:05 +02:00
parent 696ef1b978
commit 444d62edac
7 changed files with 836 additions and 1 deletions
+29 -1
View File
@@ -29,7 +29,20 @@
fmpg-buffer-start-sample
fmpg-buffer-end-sample
fmpg-sample-position
ffmpeg-version)
ffmpeg-version
;; Shared FFmpeg/swresample bindings for encoder-side PCM conversion.
;; Keeping these exports here prevents a second, divergent FFmpeg FFI
;; version layer in private/pcm-converter.rkt.
AV_SAMPLE_FMT_S32
swr_alloc_set_opts2
swr_init
swr_free
swr_get_out_samples
swr_get_delay
swr_convert
ffmpeg-make-default-channel-layout
ffmpeg-channel-layout-uninit!)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; C - Types & Functions
@@ -248,6 +261,21 @@
)
)
(def-avutil av_channel_layout_default
(_fun _AVChannelLayout-pointer _int -> _void))
(def-avutil av_channel_layout_uninit
(_fun _AVChannelLayout-pointer -> _void))
(define (ffmpeg-make-default-channel-layout channels)
(let ((p (malloc (ctype-sizeof _AVChannelLayout) 'atomic-interior)))
(av_channel_layout_default p channels)
p))
(define (ffmpeg-channel-layout-uninit! p)
(when p (av_channel_layout_uninit p))
#t)
; _AVCodecParameters:
; codec_type : AVMediaType
; codec_id : int / AVCodecID