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

refactor: remove unnecesary manual work #300

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

DacoTaco
Copy link
Contributor

hi!

i was looking at how you made the UI cross platform as im trying out Avalonia at the moment.
while looking around i saw a lot of manual work that i don't understand why.
I replaced the GIT stuff with GitInfo which compiles it for you at compile time, and cleaned up the csproj while i was there as it was kinda a mess. you were using the System.Text.Json 7.0.4 while targeting .net 8 ...
im also not sure what all the constants stuff is about but thats for another time :)

@exelix11
Copy link
Owner

Hello,

All the csproj shenanigans are because the initial android builds were powered by bflat which had some limitations, I guess I forgot them there when I moved to dotnet so this is a welcome cleanup.

Same with outdated nuget dependencies.

As for avalonia I see two problems, first is rendering: we need a native hw-accelerated canvas to draw the YUV frame that ffmpeg decodes, sdl gives this us for free abstracting all the platform complexities away in a mostly uniform api.
Second is android support, afaik it's still the weakest supported rid for the dotnet ecosystem and the reason I have to resort to a bunch of hacks with third party libraries. I also plan trying to port the whole thing to 32bit android given the continuous requests once dotnet 9 is out which may require further hacks.

SDL is really a lifesaver for this project which allows 90% code reuse for all platforms and I'm unsure I want to remove it.

Anyway if you want to discuss this or have a POC you want to show me you can reach out on discord either on the public server or by DM.

@exelix11 exelix11 merged commit 2441e4d into exelix11:master Aug 11, 2024
1 check passed
@DacoTaco
Copy link
Contributor Author

oh ye, im looking at avalonia for another thing im working on.
i saw SDL being used to play the video once you get the frames from ffmpeg, and ye .net and android/cross platform is kinda pooped. MAUI doesn't have linux support and both Avalonia & MAUI lack a video player.

i was wondering if a SDL video player in a Avalonia control was possible but ye, thats for a different moment to discuss.
i also do believe you should see if you can get your changes merged upstream so you don't rely on these local changes

@exelix11
Copy link
Owner

For what is worth even just a native opengl surface would be enough instead of SDL, but that may already be less stable across platforms.

Also even if maui had a video player it would probably not be good enough cause switch streams raw h264, all video player libraries i tried need some kind of container like mp4 to be able to play them, which is how we got to the current architecture.

At some point i had a web client prototype that could play videos using html5 video by muxing the h264 packets on the fly in js, it was pretty slow.

I'll look into upstreaming my changes to the third party libraries (unfortunately i did not properly track the changes so it will need some diffing) but I'll probably still rather not use nuget for native dependencies because virtually no package has android versions and at that point i prefer managing libraries for all platforms on my own

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