Skip to content

Conversation

@cjee21
Copy link
Contributor

@cjee21 cjee21 commented Oct 7, 2025

Features

  • Bindings generator and Rust wrapper in Source\MediaInfoDLL\MediaInfoDLL-rs
  • Example in Source\Example\HowToUse_Dll-rs
  • Raw bindings are automatically generated from MediaInfoLib header during build
  • Rust wrapper is manually written to wrap raw bindings
  • Building the example will automatically generate and build everything required
  • The CI builds and test runs the Rust example using 7z package generated from MSBuild job for Windows x86-64/ARM64, using MediaInfoLib git plus libmediainfo-dev package from Ubuntu repo for Ubuntu x86-64 and using libmediainfo built/installed with CMake from MediaInfoLib git for MacOS.
  • Example accepts an optional filename as CLI argument or it will use Example.ogg by default
  • Supports Unicode (UTF-8) path input and text output
  • Tested on Windows 11 (x64/arm64), Ubuntu (amd64/aarch64) and MacOS (aarch64)

Limitations

  • Most (commonly used) but not all of the API have manually written wrapper. The remaining can be accessed via raw bindings.
  • Not all wrapped API have unit tests

Note

  • Stream=General and Parameter=90 is using 90 and not same as CPP one because the previous number produces no output.
  • Run cargo doc --open to generate and view HTML documentation.

@cjee21
Copy link
Contributor Author

cjee21 commented Oct 7, 2025

@JeromeMartinez Noticed the official packages on MediaArea.net for x86/i386 does not contain *.lib files.

@cjee21 cjee21 marked this pull request as draft October 7, 2025 15:13
@cjee21

This comment was marked as resolved.

@cjee21 cjee21 force-pushed the Rust branch 2 times, most recently from 116c72c to 1de5440 Compare October 7, 2025 16:13
@cjee21 cjee21 marked this pull request as ready for review October 7, 2025 16:24
@cjee21 cjee21 force-pushed the Rust branch 6 times, most recently from 5a21f68 to 4dfa33f Compare October 8, 2025 12:12
@cjee21
Copy link
Contributor Author

cjee21 commented Oct 8, 2025

@JeromeMartinez is MediaInfo_int8u* Buffer in Open_Buffer_Continue supposed to be const? It is not marked a const and it looks like it is impossible to pass a read-only buffer from Rust to it unless manually doing a 'dangerous' cast.

@JeromeMartinez
Copy link
Member

is MediaInfo_int8u* Buffer in Open_Buffer_Continue supposed to be const?

It is const internally, and the C++ interface has the const, and the C interface redirects to the C++ interface., so we don't write at it, the cast would be OK (not sure we can add the "cast" to the interface without breaking the ABI).

@cjee21 cjee21 force-pushed the Rust branch 3 times, most recently from cf6f2ce to 968eb79 Compare October 8, 2025 15:49
@cjee21
Copy link
Contributor Author

cjee21 commented Oct 8, 2025

Running test_inform() and test_unicode() in parallel will randomly fail. Seems the option is affecting the other instance.


@JeromeMartinez MediaInfoList->Open(file, options), the options do not work. Seems DLL does not pass the option along.


Should be done. Some functions remain (that I do not know of their use) that not yet have Rust wrapper.

I added CI run for Rust code in this PR to test that it works on various OS and so that you can check the example output. If it is too much CI, I can add a variable to disable it.

@cjee21 cjee21 force-pushed the Rust branch 12 times, most recently from e1ec976 to 6bf2531 Compare October 11, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants