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
Родитель 53878161ce
Коммит 00a116cb25
3 изменённых файлов: 21 добавлений и 17 удалений

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

@ -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,

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

@ -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.

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

@ -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);