From 85613cd013b7ddedba3191780b149415bd501398 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Mon, 4 May 2026 13:19:48 +0200 Subject: [PATCH] version info of the ffi modules --- ffmpeg-ffi.rkt | 17 +++++++++++++++++ libao-async-ffi.rkt | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/ffmpeg-ffi.rkt b/ffmpeg-ffi.rkt index df6131c..3a02a3d 100644 --- a/ffmpeg-ffi.rkt +++ b/ffmpeg-ffi.rkt @@ -7,6 +7,7 @@ ) (provide fmpg-ffi-decoder-handler + fmpg-version ) ;; The native shim is the new instance-only FFmpeg audio API. It exposes a @@ -36,6 +37,15 @@ (define _fmpg_instance _pointer) + (define (fmpg-version) + (let* ((v (fmpg_version)) + (patch (remainder v 256)) + (minor (remainder (quotient v 256) 256)) + (major (quotient v 65536)) + ) + (list major minor patch))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Native bindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -138,6 +148,9 @@ (define-ffmpeg-audio fmpg_compatible_ffmpeg (_fun -> _int)) + + (define-ffmpeg-audio fmpg_version + (_fun -> _int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -329,6 +342,9 @@ (hash-set! h 'audio-streams audio-streams) h)) + (define (version) + (fmpg-version)) + (lambda (cmd . args) (cond [(eq? cmd 'new) (new)] @@ -342,6 +358,7 @@ [(eq? cmd 'tell) (tell)] [(eq? cmd 'file) ffmpeg-file] [(eq? cmd 'metadata) (metadata)] + [(eq? cmd 'version) (version)] [else (error (format "Unknown command: ~a" cmd))]))) ); end of module diff --git a/libao-async-ffi.rkt b/libao-async-ffi.rkt index 543e49c..940b5a0 100644 --- a/libao-async-ffi.rkt +++ b/libao-async-ffi.rkt @@ -20,6 +20,7 @@ ao_set_volume_async ao_volume_async make-BufferInfo_t + ao_version ) (define _BufferType_t @@ -50,6 +51,14 @@ [endiannes _Endian_t] )) +(define (ao_version) + (let* ((v (ao_async_version)) + (patch (remainder v 256)) + (minor (remainder (quotient v 256) 256)) + (major (quotient v 65536)) + ) + (list major minor patch))) + (when (eq? (system-type 'os) 'windows) (void (get-lib '("libao-1.2.2") '(#f))))