Bug 1056350: Make H.264 Level configurable and change OpenH264 default to 3.1 r=bwc

This commit is contained in:
Randell Jesup 2014-08-29 21:29:18 -04:00
Родитель 4ae84caa93
Коммит c2cbe72d86
3 изменённых файлов: 21 добавлений и 17 удалений

Просмотреть файл

@ -1719,12 +1719,11 @@ static int vcmEnsureExternalCodec(
// Register H.264 codec. // Register H.264 codec.
if (send) { if (send) {
VideoEncoder* encoder = nullptr; VideoEncoder* encoder = nullptr;
#ifdef MOZ_WEBRTC_OMX #ifdef MOZ_WEBRTC_OMX
encoder = OMXVideoCodec::CreateEncoder( encoder = OMXVideoCodec::CreateEncoder(OMXVideoCodec::CodecType::CODEC_H264);
OMXVideoCodec::CodecType::CODEC_H264);
#else #else
encoder = mozilla::GmpVideoCodec::CreateEncoder(); encoder = mozilla::GmpVideoCodec::CreateEncoder();
#endif #endif
if (encoder) { if (encoder) {
return conduit->SetExternalSendCodec(config, encoder); return conduit->SetExternalSendCodec(config, encoder);
@ -2311,16 +2310,15 @@ int vcmGetH264SupportedPacketizationModes()
*/ */
uint32_t vcmGetVideoH264ProfileLevelID() uint32_t vcmGetVideoH264ProfileLevelID()
{ {
// constrained baseline level 1.2 // For OMX, constrained baseline level 1.2 (via a pref)
// XXX make variable based on openh264 and OMX support
#ifdef MOZ_WEBRTC_OMX
// Max resolution CIF; we should include max-mbps // Max resolution CIF; we should include max-mbps
return 0x42E00C; int32_t level = 13; // minimum suggested for WebRTC spec
#else
// XXX See bug 1043515 - we may want to support a higher profile than vcmGetVideoLevel(0, &level);
// 1.3, depending on hardware(?) level &= 0xFF;
return 0x42E00D; level |= 0x42E000;
#endif
return (uint32_t) level;
} }
/** /**
@ -2786,6 +2784,13 @@ static short vcmGetVideoPref(uint16_t codec,
return VCM_ERROR; 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, short vcmGetVideoMaxFs(uint16_t codec,
int32_t *max_fs) { int32_t *max_fs) {
return vcmGetVideoPref(codec, return vcmGetVideoPref(codec,

Просмотреть файл

@ -1083,14 +1083,11 @@ int vcmOnSdpParseError(const char *peercconnection, const char *message);
*/ */
int vcmDisableRtcpComponent(const char *peerconnection, int level); 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 vcmGetVideoMaxFs(uint16_t codec, int32_t *max_fs);
short vcmGetVideoMaxFr(uint16_t codec, int32_t *max_fr); short vcmGetVideoMaxFr(uint16_t codec, int32_t *max_fr);
short vcmGetVideoMaxBr(uint16_t codec, int32_t *max_br); short vcmGetVideoMaxBr(uint16_t codec, int32_t *max_br);
short vcmGetVideoMaxMbps(uint16_t codec, int32_t *max_mbps); short vcmGetVideoMaxMbps(uint16_t codec, int32_t *max_mbps);
short vcmGetVideoPreferredCodec(int32_t *preferred_codec); short vcmGetVideoPreferredCodec(int32_t *preferred_codec);
//Using C++ for gips. This is the end of extern "C" above. //Using C++ for gips. This is the end of extern "C" above.

Просмотреть файл

@ -303,6 +303,7 @@ pref("media.peerconnection.enabled", true);
pref("media.peerconnection.video.enabled", true); pref("media.peerconnection.video.enabled", true);
pref("media.navigator.video.max_fs", 1200); // 640x480 == 1200mb pref("media.navigator.video.max_fs", 1200); // 640x480 == 1200mb
pref("media.navigator.video.max_fr", 30); 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_br", 700); // 8x10
pref("media.navigator.video.h264.max_mbps", 11880); // CIF@30fps pref("media.navigator.video.h264.max_mbps", 11880); // CIF@30fps
pref("media.peerconnection.video.h264_enabled", false); pref("media.peerconnection.video.h264_enabled", false);
@ -314,6 +315,7 @@ pref("media.peerconnection.enabled", true);
pref("media.peerconnection.video.enabled", true); pref("media.peerconnection.video.enabled", true);
pref("media.navigator.video.max_fs", 0); // unrestricted pref("media.navigator.video.max_fs", 0); // unrestricted
pref("media.navigator.video.max_fr", 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_br", 0);
pref("media.navigator.video.h264.max_mbps", 0); pref("media.navigator.video.h264.max_mbps", 0);
pref("media.peerconnection.video.h264_enabled", false); pref("media.peerconnection.video.h264_enabled", false);