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
[sailfishos][gecko] Disable h264 packetization mode 0. Fixes JB#55671 #58
Conversation
I personally find understanding patch changes tricky (too many red/green varieties), so in case it's helpful to others, this is the diff between the patched file before this change, and the patched file afterwards. diff --git a/PeerConnectionImpl.cpp.pre b/PeerConnectionImpl.cpp.post
index 3b32261..ad810b8 100644
--- a/PeerConnectionImpl.cpp.pre
+++ b/PeerConnectionImpl.cpp.post
@@ -851,7 +851,11 @@ class ConfigureCodec {
// Might disable it, but we set up other params anyway
videoCodec.mEnabled = mH264Enabled;
- if (mHardwareH264Supported) {
+ if (videoCodec.mPacketizationMode == 0 && !mSoftwareH264Enabled) {
+ // We're assuming packetization mode 0 is unsupported by
+ // hardware.
+ videoCodec.mEnabled = false;
+ } else if (mHardwareH264Supported) {
videoCodec.mStronglyPreferred = true;
}
} else if (videoCodec.mName == "red") { |
I wasn't able to test this, but the code looks good to me. One question arises: can a video codec be selected at all if 854 if (videoCodec.mPacketizationMode == 0 && !mSoftwareH264Enabled) {
855 // We're assuming packetization mode 0 is unsupported by
856 // hardware.
857 videoCodec.mEnabled = false;
858 }
859
860 if (mHardwareH264Supported) {
861 videoCodec.mStronglyPreferred = true;
862 } Looking through the code, I wasn't able to figure out if this was actually the case or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM, but untested.
@d-grigorev could you rebase this one, thank you. |
videoCodec.mStronglyPreferred has higher priority than videoCodec.mEnabled therefore SDP negotiation fails when the peer offers h264 packetization mode 0. This commit makes gecko strongly prefer only packetization mode 1, so mode 0 will never be selected.
Actually, this is the problem. If I rebased this change. |
How do you want to handle this? Should we land this like it is now? |
This was the issue only for H264. The code for VP9 doesn't set |
videoCodec.mStronglyPreferred has higher priority than videoCodec.mEnabled
therefore SDP negotiation fails when the peer offers h264 packetization
mode 0. This commit makes gecko strongly prefer only packetization mode 1,
so mode 0 will never be selected.