Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Is it possible to port FFmpeg to toaruos? #259

Open
Vir-BryanQ opened this issue Oct 25, 2022 · 4 comments
Open

Is it possible to port FFmpeg to toaruos? #259

Vir-BryanQ opened this issue Oct 25, 2022 · 4 comments

Comments

@Vir-BryanQ
Copy link

It seems that there are few tools to deal with multimedia content and I didn't find a way to play a video on toaruos.
I wonder if it is possible to port FFmpeg to toaruos so that toaruos will be more powerful to deal with multimedia content. If possible, how difficult will it be?
By the way, are there any video players on toaruos?

@klange
Copy link
Owner

klange commented Oct 25, 2022

FFmpeg was ported many years ago, before the switch to an in-house libc. I have not revisited that port, though the “minimp3” library available from the package manager is derived from (very slimmed down) FFmpeg sources. I seem to recall FFmpeg relying on some libc/libm math functions, which may be missing or stubbed, so some more work may be necessary to get it building again.

@klange
Copy link
Owner

klange commented Apr 10, 2023

A comment was posted here but deleted by its author, asking about alternative libms.

I don't intend to import any third-party code to support the in-house libm, but I have considered making musl's libm available from the package manager to support ports. The libm implementation in musl, much like others, is largely derivative of an old Sun libm.

This will require some work in the ld.so to fix up the incorrect, naive implementation of symbol resolution. Thankfully, libm implementations do not tend to rely much, if at all, on the internal details of the libc they are shipped with, so an external libm should be able to co-exist with our own in-house libc.

@mxlgv
Copy link

mxlgv commented Apr 12, 2023

I wasn't really talking about making a port of musl, but rather about taking the missing math from there and mixing it into your libc. Mathematics in different libc looks about the same, as it is written in assembler. You will not get something fundamentally different if you want to implement it yourself. And yes, I'm talking about what should be in the C standard math module in libc.

@klange
Copy link
Owner

klange commented Apr 12, 2023

as it is written in assembler

There's actually lots of bit twiddling in C to implement the majority of floating point math functions. Even when a platform has an FPU that supports a function directly, a libm implementation may avoid using the hardware instruction if it's known to be slow or inaccurate.

And yes, I'm talking about what should be in the C standard math module in libc.

Again, I don't intend to import any third-party code - even if my own implementations would be necessarily identical. I think the path forward for math function support is to clean up the implementations of functions we do have - the ones needed to power the core OS - and then defer other functions to a third-party package, installable from the repository. Musl is a good candidate for that (I think even mlibc just uses muls's libm!)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants