elsiehupp / ffmpeg-vapi

Vala Bindings for FFmpeg
Other
2 stars 0 forks source link

Help on how to use these vapis #1

Open tudo75 opened 1 year ago

tudo75 commented 1 year ago

Hi, I tried to use your vapi. Started testing only libswresample and adding the package dependency to my meson file and also the vapi dir

dependencies = [
    dependency('gtk+-3.0', version: '>= 3.20'),
    dependency('glib-2.0'),
    dependency('gio-2.0'),
    dependency('libswresample'),
    meson.get_compiler('c').find_library('m', required: false),
    meson.get_compiler('vala').find_library('posix'),
]

vapi_dir = join_paths(meson.current_source_dir(), 'vapi')
add_project_arguments(['--vapidir', join_paths(vapi_dir, 'libswresample')], language: 'vala')

and installed the libswresample-dev lib, but on compilation I receive the error

error: Package `libswresample' not found in specified Vala API directories or GObject-Introspection GIR directories

What I'm missing or doing wrong?

Thanks for your help

elsiehupp commented 1 year ago

You're probably not doing anything wrong.

This project is nowhere near in actual working condition (which I should probably make clearer in the README—sorry for the confusion 😬), and I've kind of set it aside for the moment while I work on other projects.

If you'd like to help, though, I would definitely welcome that!

I mean I could explain more if you'd like... Basically my impression is that was making VAPIs from the wrong C header files, i.e. making VAPIs for internal headers, not the public API. I decided to take a break from this project when I realized that that was what I was doing wrong. In general I hadn't quite yet figured out how to link the C headers to the VAPIs in Meson, yet, either. As I said, this is nowhere near usable...
tudo75 commented 1 year ago

I started to work on how to write these vapis. I know now that for every library you want to use you must create only one vapi file with the same name of the library. eg: libavutil => libavutil.vapi In the vapi file you must put references only to the classes, methods, consts, etc that you want to use from vala (so the internal use methods aren't necessary) I started a small test here if you want to take a look: https://github.com/tudo75/ValaFFmpeg