diff --git a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp index 577e9baa322b..cf8469823c26 100644 --- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp +++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp @@ -1719,12 +1719,11 @@ static int vcmEnsureExternalCodec( // Register H.264 codec. if (send) { - VideoEncoder* encoder = nullptr; + VideoEncoder* encoder = nullptr; #ifdef MOZ_WEBRTC_OMX - encoder = OMXVideoCodec::CreateEncoder( - OMXVideoCodec::CodecType::CODEC_H264); + encoder = OMXVideoCodec::CreateEncoder(OMXVideoCodec::CodecType::CODEC_H264); #else - encoder = mozilla::GmpVideoCodec::CreateEncoder(); + encoder = mozilla::GmpVideoCodec::CreateEncoder(); #endif if (encoder) { return conduit->SetExternalSendCodec(config, encoder); @@ -2311,16 +2310,15 @@ int vcmGetH264SupportedPacketizationModes() */ uint32_t vcmGetVideoH264ProfileLevelID() { - // constrained baseline level 1.2 - // XXX make variable based on openh264 and OMX support -#ifdef MOZ_WEBRTC_OMX + // For OMX, constrained baseline level 1.2 (via a pref) // Max resolution CIF; we should include max-mbps - return 0x42E00C; -#else - // XXX See bug 1043515 - we may want to support a higher profile than - // 1.3, depending on hardware(?) - return 0x42E00D; -#endif + int32_t level = 13; // minimum suggested for WebRTC spec + + vcmGetVideoLevel(0, &level); + level &= 0xFF; + level |= 0x42E000; + + return (uint32_t) level; } /** @@ -2786,6 +2784,13 @@ static short vcmGetVideoPref(uint16_t codec, return VCM_ERROR; } +short vcmGetVideoLevel(uint16_t codec, + int32_t *level) { + return vcmGetVideoPref(codec, + "media.navigator.video.h264.level", + level); +} + short vcmGetVideoMaxFs(uint16_t codec, int32_t *max_fs) { return vcmGetVideoPref(codec, diff --git a/media/webrtc/signaling/src/sipcc/include/vcm.h b/media/webrtc/signaling/src/sipcc/include/vcm.h index 4b498e22a963..f23dff720123 100755 --- a/media/webrtc/signaling/src/sipcc/include/vcm.h +++ b/media/webrtc/signaling/src/sipcc/include/vcm.h @@ -1083,14 +1083,11 @@ int vcmOnSdpParseError(const char *peercconnection, const char *message); */ int vcmDisableRtcpComponent(const char *peerconnection, int level); +short vcmGetVideoLevel(uint16_t codec, int32_t *level); short vcmGetVideoMaxFs(uint16_t codec, int32_t *max_fs); - short vcmGetVideoMaxFr(uint16_t codec, int32_t *max_fr); - short vcmGetVideoMaxBr(uint16_t codec, int32_t *max_br); - short vcmGetVideoMaxMbps(uint16_t codec, int32_t *max_mbps); - short vcmGetVideoPreferredCodec(int32_t *preferred_codec); //Using C++ for gips. This is the end of extern "C" above. diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index ec65c9eb01a4..3e9a7d9d4f7d 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -303,6 +303,7 @@ pref("media.peerconnection.enabled", true); pref("media.peerconnection.video.enabled", true); pref("media.navigator.video.max_fs", 1200); // 640x480 == 1200mb pref("media.navigator.video.max_fr", 30); +pref("media.navigator.video.h264.level", 12); // 0x42E00C - level 1.2 pref("media.navigator.video.h264.max_br", 700); // 8x10 pref("media.navigator.video.h264.max_mbps", 11880); // CIF@30fps pref("media.peerconnection.video.h264_enabled", false); @@ -314,6 +315,7 @@ pref("media.peerconnection.enabled", true); pref("media.peerconnection.video.enabled", true); pref("media.navigator.video.max_fs", 0); // unrestricted pref("media.navigator.video.max_fr", 0); // unrestricted +pref("media.navigator.video.h264.level", 31); // 0x42E01f - level 3.1 pref("media.navigator.video.h264.max_br", 0); pref("media.navigator.video.h264.max_mbps", 0); pref("media.peerconnection.video.h264_enabled", false);