-
Notifications
You must be signed in to change notification settings - Fork 32
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
base: dev
Are you sure you want to change the base?
Big endian #24
Conversation
This should work; but I'm not in this code right now, and don't completely understand your changes. |
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. |
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). I am willing to help, but at the moment I see lack of communication between the developers. Any comments on this? |
@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" :/ |
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).