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

Big endian #24

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Big endian #24

wants to merge 3 commits into from

Conversation

jbubik
Copy link

@jbubik jbubik commented May 17, 2020

I have sacrificed some sleep and made nginx-rtmp-module running on both Little-endian and Big-endian platforms. Tested with local playback and "push" functionality on PC/cygwin (x86 64bit LE) and TP-Link Archer C7 v5 (MIPS 32bit BE). Other functions (pull, record, vod, stats, etc.) untested - problems on BE expected there. The original code was written with LE perspective only. This PR fixes #22 and will collide with #23 (pierreyves258 was faster to spot the issue with gcc 8).

@ut0mt8
Copy link
Owner

ut0mt8 commented May 20, 2021

This should work; but I'm not in this code right now, and don't completely understand your changes.

@jbubik
Copy link
Author

jbubik commented May 20, 2021

No new features at all. All changes in this PR address a problem on CPUs with Big Endian architecture. See Wikipedia for technical background. Original code compiles on both architectures, but woks correctly only on Little Endian CPUs (i32, amd64). When there is a 16bit value 0xABCD in RTMP packet, it is fetched into CPU as 0xCDAB on Little Endian platforms. Original code always swaps the bytes to get back the correct value 0xABCD. This "swap" is a bad idea on Big Endian platforms. See libc manual for the recommended solution. Functions ntohs/ntohl/htons/htonl are declared in the compiler according to endianess of target platform.

@jbubik
Copy link
Author

jbubik commented May 29, 2021

Hi @ut0mt8 - are you aware, that your repository is the source for OpenWrt package "nginx"? OpenWrt project supports many different routers with many different CPU architectures - some of them are Big Endian. I wanted to make the code working correctly on these architectures (I own TPLink Archer C7, MIPS BE).
The project (nginx-rtmp-module) started with @arut, then has been forked by @sergey-dryabzhinsky, then has been forked by @ut0mt8. All repositories seemed abandoned in May 2020 when I authored the changes. Please let me (and/or the OpenWrt folks) know if you are willing to maintain the project. If it is not possible, the community must find a different way to go forward.

I am willing to help, but at the moment I see lack of communication between the developers. Any comments on this?

@ut0mt8
Copy link
Owner

ut0mt8 commented May 31, 2021

@jbubik really? I was aware of the situation. But unfortunately I tried to re-upstream my work and you no one respond, even if @arut help me in some case. The problem is I start this fork for my previous work, it was a lot of fun, but it's already too old, and don't have time to maintain it anymore. That's a shame cause my work add some interesting features (sometime the code is a bit hacky) but at least it serve well my previous employer during the 2018 soccer world cup :)

I never talked to sergy btw. So yes we are the classic situation of "abandonware" :/

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.

[RTMP] "too big message" (on big-endian platforms)
2 participants