Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video: Prefer loading system OpenH264 library to downloading it #17799

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Sep 6, 2024

Some systems do have OpenH264 installed and in order to get rid of the delay caused by downloading the library (and needlessly downloading it in the first place), an attempt is made first to load OpenH264 as a system library. When loading fails (or version is mismatched), only then Ruffle downloads OpenH264 and uses that version of the library.

This also will make it possible to support OpenH264 in Flatpak.

@torokati44
Copy link
Member

Just a random observation on my Fedora 40 system:

md5sum /usr/lib64/libopenh264.so.2.4.1 
a266478faa47e70dae142920e162aea4  /usr/lib64/libopenh264.so.2.4.1

Meanwhile:

http://ciscobinary.openh264.org/libopenh264-2.4.1-linux64.7.so.signed.md5.txt -> 19c561386a9564f8510fcb7586b9d402

I don't know where this file is coming from, or why it's different... :/

@torokati44
Copy link
Member

Oh...

https://fedoraproject.org/wiki/OpenH264

It contains OpenH264 binary built inside the Fedora infrastructure, but distributed by Cisco, so that the all licensing fees are still covered by them.

@torokati44
Copy link
Member

Never mind, it mattersn't, as discussed on Discord... 🙃

Copy link
Member

@torokati44 torokati44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you very much! 🥳

Now, to rebase #16794 again, on top of this... 😩

@torokati44 torokati44 enabled auto-merge (rebase) September 12, 2024 09:48
This value does not have to be a path, it can be a filename of
a library that is automatically located on the system.
This struct represents the OpenH264 codec and makes it possible to
reuse the reference to the OpenH264 library across decoders.
It also adds better error handling.
By using the H264Codec struct, we can load OpenH264 early
and reuse its instance for all decoders.
This struct makes it easier to manage os/arch-specific OpenH264 information.
Some systems do have OpenH264 installed and in order to get
rid of the delay caused by downloading the library
(and needlessly downloading it in the first place),
an attempt is made first to load OpenH264 as a system library.
When loading fails (or version is mismatched), only then Ruffle
downloads OpenH264 and uses that version of the library.
@kjarosh
Copy link
Member Author

kjarosh commented Sep 12, 2024

Just replaced one more occurrence of h264 -> openh264 in a variable name

@torokati44 torokati44 merged commit 22fda90 into ruffle-rs:master Sep 12, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants