version info of the ffi modules

This commit is contained in:
2026-05-04 13:19:48 +02:00
parent c8ef025df9
commit 85613cd013
2 changed files with 26 additions and 0 deletions
+17
View File
@@ -7,6 +7,7 @@
) )
(provide fmpg-ffi-decoder-handler (provide fmpg-ffi-decoder-handler
fmpg-version
) )
;; The native shim is the new instance-only FFmpeg audio API. It exposes a ;; The native shim is the new instance-only FFmpeg audio API. It exposes a
@@ -36,6 +37,15 @@
(define _fmpg_instance _pointer) (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 ;; Native bindings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -139,6 +149,9 @@
(define-ffmpeg-audio fmpg_compatible_ffmpeg (define-ffmpeg-audio fmpg_compatible_ffmpeg
(_fun -> _int)) (_fun -> _int))
(define-ffmpeg-audio fmpg_version
(_fun -> _int))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Our interface for decoding to racket ;; Our interface for decoding to racket
@@ -329,6 +342,9 @@
(hash-set! h 'audio-streams audio-streams) (hash-set! h 'audio-streams audio-streams)
h)) h))
(define (version)
(fmpg-version))
(lambda (cmd . args) (lambda (cmd . args)
(cond (cond
[(eq? cmd 'new) (new)] [(eq? cmd 'new) (new)]
@@ -342,6 +358,7 @@
[(eq? cmd 'tell) (tell)] [(eq? cmd 'tell) (tell)]
[(eq? cmd 'file) ffmpeg-file] [(eq? cmd 'file) ffmpeg-file]
[(eq? cmd 'metadata) (metadata)] [(eq? cmd 'metadata) (metadata)]
[(eq? cmd 'version) (version)]
[else (error (format "Unknown command: ~a" cmd))]))) [else (error (format "Unknown command: ~a" cmd))])))
); end of module ); end of module
+9
View File
@@ -20,6 +20,7 @@
ao_set_volume_async ao_set_volume_async
ao_volume_async ao_volume_async
make-BufferInfo_t make-BufferInfo_t
ao_version
) )
(define _BufferType_t (define _BufferType_t
@@ -50,6 +51,14 @@
[endiannes _Endian_t] [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) (when (eq? (system-type 'os) 'windows)
(void (get-lib '("libao-1.2.2") '(#f)))) (void (get-lib '("libao-1.2.2") '(#f))))