Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save LeifAndersen/353e0da21d9213dcd6a79cbd9b8c94ee to your computer and use it in GitHub Desktop.

Select an option

Save LeifAndersen/353e0da21d9213dcd6a79cbd9b8c94ee to your computer and use it in GitHub Desktop.
#lang racket
(require ffi/unsafe
ffi/unsafe/define
ffi/unsafe/define/conventions
ffi/unsafe/alloc
setup/dirs)
(define-ffi-definer define-avutil (ffi-lib "libavutil" "55")
#:make-c-id convention:hyphen->underscore)
(define-cpointer-type _av-frame-pointer)
(define-avutil av-frame-free (_fun (_ptr i _av-frame-pointer) -> _void)
#:wrap (deallocator))
(define-avutil av-frame-alloc (_fun -> _av-frame-pointer)
#:wrap (allocator av-frame-free))
(let loop ()
(av-frame-alloc)
(loop))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment