From 14da65f440783132508c140d523556fcc696e5f0 Mon Sep 17 00:00:00 2001 From: John Lin Date: Mon, 21 Apr 2014 23:44:00 +0200 Subject: [PATCH] Bug 911046 - Part 6: Make H.264 preferred video codec when enabled in preferences. r=jesup, ekr --- .../signaling/src/peerconnection/PeerConnectionCtx.cpp | 7 ++++++- .../signaling/src/sipcc/core/common/prot_configmgr.c | 8 ++++---- media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp index 8c6b2f5b8b19..c4d7cbc28413 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionCtx.cpp @@ -273,7 +273,12 @@ nsresult PeerConnectionCtx::Initialize() { // Only adding codecs supported //codecMask |= VCM_CODEC_RESOURCE_H263; - //codecMask |= VCM_CODEC_RESOURCE_H264; +#ifdef MOZILLA_INTERNAL_API + if (Preferences::GetBool("media.peerconnection.video.h264_enabled")) { + codecMask |= VCM_CODEC_RESOURCE_H264; + } +#endif + codecMask |= VCM_CODEC_RESOURCE_VP8; //codecMask |= VCM_CODEC_RESOURCE_I420; mCCM->setVideoCodecs(codecMask); diff --git a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c index 004dec7ac51a..876b19ae0cf1 100755 --- a/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c +++ b/media/webrtc/signaling/src/sipcc/core/common/prot_configmgr.c @@ -614,10 +614,6 @@ sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], //codec_mask = vcmGetVideoCodecList(DSP_ENCODEONLY); codec_mask = vcmGetVideoCodecList(VCM_DSP_IGNORE); } - if ( codec_mask & VCM_CODEC_RESOURCE_VP8) { - aSupportedCodecs[count] = RTP_VP8; - count++; - } if ( codec_mask & VCM_CODEC_RESOURCE_H264) { /* * include payload type for packetization mode 1 only if ucm sis version @@ -635,6 +631,10 @@ sip_config_video_supported_codecs_get (rtp_ptype aSupportedCodecs[], aSupportedCodecs[count] = RTP_H264_P0; count++; } + if ( codec_mask & VCM_CODEC_RESOURCE_VP8) { + aSupportedCodecs[count] = RTP_VP8; + count++; + } if ( codec_mask & VCM_CODEC_RESOURCE_H263) { aSupportedCodecs[count] = RTP_H263; count++; diff --git a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c index 41492a58b31b..23852fa8d909 100644 --- a/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c +++ b/media/webrtc/signaling/src/sipcc/core/gsm/gsm_sdp.c @@ -4666,6 +4666,7 @@ gsmsdp_negotiate_rtcp_fb (cc_sdp_t *cc_sdp_p, */ switch (codec) { case RTP_VP8: + case RTP_I420: fb_types &= sdp_rtcp_fb_nack_to_bitmap(SDP_RTCP_FB_NACK_BASIC) | sdp_rtcp_fb_nack_to_bitmap(SDP_RTCP_FB_NACK_PLI) |