Back out 5 changesets (bug 1059765, bug 1056350, bug 1049087, bug 1060249) for build bustage on a CLOSED TREE
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 29 Aug 2014 19:38:19 -0700
changeset 224187 2b60f30db362778c15a50f21b2fcd3cece8ac706
parent 224186 7991f98b920b5c8fcc2de8ce615e07cc5a67e6a0
child 224188 1f81a6902e968383ea5fb80d9da4c088a7aef8af
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1059765, 1056350, 1049087, 1060249
milestone34.0a1
backs outa202e2f54b458c9c64c9d3be6fb259d00f4b3d7b
13c8d9e68cb6ef4393bdf394beb7bce9942de770
9c86bdb3ff210afdc52febd81aea2947d63ca5e5
7b7cb046d45f8fa9546204469a0daa0ac2abdb26
c52e50a27c8c244c5d91d319fd0427223aafffdd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 5 changesets (bug 1059765, bug 1056350, bug 1049087, bug 1060249) for build bustage on a CLOSED TREE Backed out changeset a202e2f54b45 (bug 1056350) Backed out changeset 13c8d9e68cb6 (bug 1060249) Backed out changeset 9c86bdb3ff21 (bug 1049087) Backed out changeset 7b7cb046d45f (bug 1059765) Backed out changeset c52e50a27c8c (bug 1059765)
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h
media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
media/webrtc/signaling/src/sipcc/include/vcm.h
media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc
media/webrtc/trunk/webrtc/modules/video_coding/main/source/qm_select.cc
media/webrtc/trunk/webrtc/modules/video_processing/main/source/content_analysis.cc
media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
modules/libpref/init/all.js
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -138,23 +138,22 @@ GmpFrameTypeToWebrtcFrameType(GMPVideoFr
 }
 
 
 int32_t
 WebrtcGmpVideoEncoder::InitEncode(const webrtc::VideoCodec* aCodecSettings,
                                   int32_t aNumberOfCores,
                                   uint32_t aMaxPayloadSize)
 {
-  if (!mMPS) {
-    mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
-  }
+  mMPS = do_GetService("@mozilla.org/gecko-media-plugin-service;1");
   MOZ_ASSERT(mMPS);
 
   if (!mGMPThread) {
     if (NS_WARN_IF(NS_FAILED(mMPS->GetThread(getter_AddRefs(mGMPThread))))) {
+      mMPS = nullptr;
       return WEBRTC_VIDEO_CODEC_ERROR;
     }
   }
 
   int32_t ret;
   mGMPThread->Dispatch(WrapRunnableRet(this,
                                        &WebrtcGmpVideoEncoder::InitEncode_g,
                                        aCodecSettings,
@@ -178,40 +177,41 @@ WebrtcGmpVideoEncoder::InitEncode_g(cons
                                                     &mHost,
                                                     &mGMP)))) {
     mMPS = nullptr;
     mGMP = nullptr;
     mGMPThread = nullptr;
     mHost = nullptr;
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
+  mMPS = nullptr;
 
   if (!mGMP || !mHost) {
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
   // Bug XXXXXX: transfer settings from codecSettings to codec.
-  memset(&mCodecParams, 0, sizeof(mCodecParams));
+  GMPVideoCodec codec;
+  memset(&codec, 0, sizeof(codec));
 
-  mCodecParams.mGMPApiVersion = 33;
-  mCodecParams.mWidth = aCodecSettings->width;
-  mCodecParams.mHeight = aCodecSettings->height;
-  mCodecParams.mStartBitrate = aCodecSettings->startBitrate;
-  mCodecParams.mMinBitrate = aCodecSettings->minBitrate;
-  mCodecParams.mMaxBitrate = aCodecSettings->maxBitrate;
-  mCodecParams.mMaxFramerate = aCodecSettings->maxFramerate;
-  mMaxPayloadSize = aMaxPayloadSize;
+  codec.mGMPApiVersion = 33;
+  codec.mWidth = aCodecSettings->width;
+  codec.mHeight = aCodecSettings->height;
+  codec.mStartBitrate = aCodecSettings->startBitrate;
+  codec.mMinBitrate = aCodecSettings->minBitrate;
+  codec.mMaxBitrate = aCodecSettings->maxBitrate;
+  codec.mMaxFramerate = aCodecSettings->maxFramerate;
   if (aCodecSettings->codecSpecific.H264.packetizationMode == 1) {
-    mMaxPayloadSize = 4*1024*1024; // insanely large
+    aMaxPayloadSize = 4*1024*1024; // insanely large
   }
 
   // Pass dummy codecSpecific data for now...
   nsTArray<uint8_t> codecSpecific;
 
-  GMPErr err = mGMP->InitEncode(mCodecParams, codecSpecific, this, 1, mMaxPayloadSize);
+  GMPErr err = mGMP->InitEncode(codec, codecSpecific, this, 1, aMaxPayloadSize);
   if (err != GMPNoErr) {
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
 
@@ -240,48 +240,16 @@ WebrtcGmpVideoEncoder::Encode_g(const we
                                 const std::vector<webrtc::VideoFrameType>* aFrameTypes)
 {
   MOZ_ASSERT(mHost);
   if (!mGMP) {
     // destroyed via Terminate()
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
 
-  if (aInputImage->width() != mCodecParams.mWidth ||
-      aInputImage->height() != mCodecParams.mHeight) {
-    LOGD(("GMP Encode: resolution change from %ux%u to %ux%u",
-          mCodecParams.mWidth, mCodecParams.mHeight, aInputImage->width(), aInputImage->height()));
-
-    mGMP->Close();
-
-    // OpenH264 codec (at least) can't handle dynamic input resolution changes
-    // re-init the plugin when the resolution changes
-    // XXX allow codec to indicate it doesn't need re-init!
-    nsTArray<nsCString> tags;
-    tags.AppendElement(NS_LITERAL_CSTRING("h264"));
-    if (NS_WARN_IF(NS_FAILED(mMPS->GetGMPVideoEncoder(&tags,
-                                                      NS_LITERAL_STRING(""),
-                                                      &mHost,
-                                                      &mGMP)))) {
-      mGMP = nullptr;
-      mHost = nullptr;
-      return WEBRTC_VIDEO_CODEC_ERROR;
-    }
-
-    mCodecParams.mWidth = aInputImage->width();
-    mCodecParams.mHeight = aInputImage->height();
-    // Pass dummy codecSpecific data for now...
-    nsTArray<uint8_t> codecSpecific;
-
-    GMPErr err = mGMP->InitEncode(mCodecParams, codecSpecific, this, 1, mMaxPayloadSize);
-    if (err != GMPNoErr) {
-      return WEBRTC_VIDEO_CODEC_ERROR;
-    }
-  }
-
   GMPVideoFrame* ftmp = nullptr;
   GMPErr err = mHost->CreateFrame(kGMPI420VideoFrame, &ftmp);
   if (err != GMPNoErr) {
     return WEBRTC_VIDEO_CODEC_ERROR;
   }
   UniquePtr<GMPVideoi420Frame> frame(static_cast<GMPVideoi420Frame*>(ftmp));
 
   err = frame->CreateFrame(aInputImage->allocated_size(webrtc::kYPlane),
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.h
@@ -87,18 +87,16 @@ private:
 
   virtual int32_t SetRates_g(uint32_t aNewBitRate,
                              uint32_t aFrameRate);
 
   nsCOMPtr<mozIGeckoMediaPluginService> mMPS;
   nsCOMPtr<nsIThread> mGMPThread;
   GMPVideoEncoderProxy* mGMP;
   GMPVideoHost* mHost;
-  GMPVideoCodec mCodecParams;
-  uint32_t mMaxPayloadSize;
   webrtc::EncodedImageCallback* mCallback;
   uint64_t mCachedPluginId;
 };
 
 
 class WebrtcGmpVideoDecoder : public WebrtcVideoDecoder,
                               public GMPVideoDecoderCallbackProxy
 {
--- a/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
+++ b/media/webrtc/signaling/src/media/VcmSIPCCBinding.cpp
@@ -1714,21 +1714,22 @@ static int vcmEnsureExternalCodec(
   } else if (config->mName == "H264_P0" || config->mName == "H264_P1") {
     // Here we use "I420" to register H.264 because WebRTC.org code has a
     // whitelist of supported video codec in |webrtc::ViECodecImpl::CodecValid()|
     // and will reject registration of those not in it.
     // TODO: bug 995884 to support H.264 in WebRTC.org code.
 
     // 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);
       } else {
         return kMediaConduitInvalidSendCodec;
       }
     } else {
       VideoDecoder* decoder;
@@ -2305,25 +2306,26 @@ int vcmGetH264SupportedPacketizationMode
 }
 
 /**
  * Get supported H.264 profile-level-id
  * @return supported profile-level-id value
  */
 uint32_t vcmGetVideoH264ProfileLevelID()
 {
-  // For OMX, constrained baseline level 1.2 (via a pref)
+  // constrained baseline level 1.2
+  // XXX make variable based on openh264 and OMX support
+#ifdef MOZ_WEBRTC_OMX
   // Max resolution CIF; we should include max-mbps
-  int32_t level = 13; // minimum suggested for WebRTC spec
-
-  vcmGetVideoLevel(0, &level);
-  level &= 0xFF;
-  level |= 0x42E000;
-
-  return (uint32_t) level;
+  return 0x42E00C;
+#else
+  // XXX See bug 1043515 - we may want to support a higher profile than
+  // 1.3, depending on hardware(?)
+  return 0x42E00D;
+#endif
 }
 
 /**
  *  MEDIA control received from far end on signaling path
  *
  *  @param call_handle - call_handle of the call
  *  @param to_encoder - the control request received
  *        Only FAST_PICTURE_UPDATE is supported
@@ -2779,23 +2781,16 @@ static short vcmGetVideoPref(uint16_t co
                              int32_t *ret) {
   nsCOMPtr<nsIPrefBranch> branch = VcmSIPCCBinding::getPrefBranch();
   if (branch && NS_SUCCEEDED(branch->GetIntPref(pref, ret))) {
     return 0;
   }
   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,
                          "media.navigator.video.max_fs",
                          max_fs);
 }
 
 short vcmGetVideoMaxFr(uint16_t codec,
--- a/media/webrtc/signaling/src/sipcc/include/vcm.h
+++ b/media/webrtc/signaling/src/sipcc/include/vcm.h
@@ -1078,21 +1078,24 @@ int vcmOnSdpParseError(const char *peerc
 /**
  * vcmDisableRtcpComponent
  *
  * If we are doing rtcp-mux we need to disable component number 2 in the ICE
  * layer.  Otherwise we will wait for it to connect when it is unused
  */
 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.
 #ifdef __cplusplus
 }
 #endif
 
 
--- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/content_metrics_processing.cc
@@ -72,26 +72,17 @@ void VCMContentMetricsProcessing::ResetS
   frame_cnt_uniform_avg_ = 0;
 }
 
 int VCMContentMetricsProcessing::UpdateContentData(
     const VideoContentMetrics *contentMetrics) {
   if (contentMetrics == NULL) {
     return VCM_OK;
   }
-#if defined(WEBRTC_GONK)
-  // "average" values that should yield kDefault in qm_select.cc
-  contentMetrics->motion_magnitude = 0.05f;
-  contentMetrics->spatial_pred_err = 0.03f;
-  contentMetrics->spatial_pred_err_h = 0.03f;
-  contentMetrics->spatial_pred_err_v = 0.03f;
-  return VCM_OK;
-#else
   return ProcessContent(contentMetrics);
-#endif
 }
 
 int VCMContentMetricsProcessing::ProcessContent(
     const VideoContentMetrics *contentMetrics) {
   // Update the recursive averaged metrics: average is over longer window
   // of time: over QmMinIntervalMs ms.
   UpdateRecursiveAvg(contentMetrics);
   // Update the uniform averaged metrics: average is over shorter window
--- a/media/webrtc/trunk/webrtc/modules/video_coding/main/source/qm_select.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_coding/main/source/qm_select.cc
@@ -55,40 +55,30 @@ uint8_t VCMQmMethod::ComputeContentClass
   return content_class_ = 3 * motion_.level + spatial_.level;
 }
 
 void VCMQmMethod::UpdateContent(const VideoContentMetrics*  contentMetrics) {
   content_metrics_ = contentMetrics;
 }
 
 void VCMQmMethod::ComputeMotionNFD() {
-#if defined(WEBRTC_GONK)
-  motion_.value = (kHighMotionNfd + kLowMotionNfd)/2;
-  motion_.level = kDefault;
-#else
   if (content_metrics_) {
     motion_.value = content_metrics_->motion_magnitude;
   }
   // Determine motion level.
   if (motion_.value < kLowMotionNfd) {
     motion_.level = kLow;
   } else if (motion_.value > kHighMotionNfd) {
     motion_.level  = kHigh;
   } else {
     motion_.level = kDefault;
   }
-#endif
 }
 
 void VCMQmMethod::ComputeSpatial() {
-#if defined(WEBRTC_GONK)
-  float scale2 = image_type_ > kVGA ? kScaleTexture : 1.0;
-  spatial_.value = (kHighTexture + kLowTexture)*scale2/2;
-  spatial_.level = kDefault;
-#else
   float spatial_err = 0.0;
   float spatial_err_h = 0.0;
   float spatial_err_v = 0.0;
   if (content_metrics_) {
     spatial_err =  content_metrics_->spatial_pred_err;
     spatial_err_h = content_metrics_->spatial_pred_err_h;
     spatial_err_v = content_metrics_->spatial_pred_err_v;
   }
@@ -100,17 +90,16 @@ void VCMQmMethod::ComputeSpatial() {
 
   if (spatial_.value > scale2 * kHighTexture) {
     spatial_.level = kHigh;
   } else if (spatial_.value < scale2 * kLowTexture) {
     spatial_.level = kLow;
   } else {
     spatial_.level = kDefault;
   }
-#endif
 }
 
 ImageType VCMQmMethod::GetImageType(uint16_t width,
                                     uint16_t height) {
   // Get the image type for the encoder frame size.
   uint32_t image_size = width * height;
   if (image_size == kSizeOfImageType[kQCIF]) {
     return kQCIF;
--- a/media/webrtc/trunk/webrtc/modules/video_processing/main/source/content_analysis.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_processing/main/source/content_analysis.cc
@@ -53,17 +53,16 @@ VideoContentMetrics* VPMContentAnalysis:
   if (inputFrame.IsZeroSize())
     return NULL;
 
   // Init if needed (native dimension change).
   if (width_ != inputFrame.width() || height_ != inputFrame.height()) {
     if (VPM_OK != Initialize(inputFrame.width(), inputFrame.height()))
       return NULL;
   }
-#if !defined(WEBRTC_GONK)
   // Compute motion metrics
   if (ca_Init_) {
     // Only interested in the Y plane.
     orig_frame_ = inputFrame.buffer(kYPlane);
 
     // Compute spatial metrics: 3 spatial prediction errors.
     (this->*ComputeSpatialMetrics)();
 
@@ -71,17 +70,16 @@ VideoContentMetrics* VPMContentAnalysis:
       ComputeMotionMetrics();
     }
 
     // Saving current frame as previous one: Y only.
     memcpy(prev_frame_.get(), orig_frame_, width_ * height_);
 
     first_frame_ =  false;
   }
-#endif
 
   return ContentMetrics();
 }
 
 int32_t VPMContentAnalysis::Release() {
   content_metrics_.reset(NULL);
   prev_frame_.reset(NULL);
 
@@ -120,22 +118,20 @@ int32_t VPMContentAnalysis::Initialize(i
     return VPM_PARAMETER_ERROR;
   }
 
   content_metrics_.reset(new VideoContentMetrics());
   if (!content_metrics_) {
     return VPM_MEMORY;
   }
 
-#if !defined(WEBRTC_GONK)
   prev_frame_.reset(new uint8_t[width_ * height_]);  // Y only.
   if (!prev_frame_) {
     return VPM_MEMORY;
   }
-#endif
 
   // ok, all initialized
   ca_Init_ = true;
   return VPM_OK;
 }
 
 
 // Compute motion metrics: magnitude over non-zero motion vectors,
--- a/media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
+++ b/media/webrtc/trunk/webrtc/video_engine/vie_encoder.cc
@@ -700,18 +700,17 @@ void ViEEncoder::DeliverFrame(int id,
                    webrtc::kTraceVideo,
                    ViEId(engine_id_, channel_id_),
                    "%s: Error encoding frame %u", __FUNCTION__,
                    video_frame->timestamp());
     }
     return;
   }
 #endif
-  if (vcm_.AddVideoFrame(*decimated_frame,
-                         vpm_.ContentMetrics()) != VCM_OK) {
+  if (vcm_.AddVideoFrame(*decimated_frame) != VCM_OK) {
     WEBRTC_TRACE(webrtc::kTraceError,
                  webrtc::kTraceVideo,
                  ViEId(engine_id_, channel_id_),
                  "%s: Error encoding frame %u", __FUNCTION__,
                  video_frame->timestamp());
   }
 }
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -298,29 +298,27 @@ pref("media.webrtc.debug.aec_dump_max_si
 
 #ifdef MOZ_WIDGET_GONK
 pref("media.navigator.video.default_width",320);
 pref("media.navigator.video.default_height",240);
 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);
 pref("media.getusermedia.aec", 4);
 #else
 pref("media.navigator.video.default_width",0);  // adaptive default
 pref("media.navigator.video.default_height",0); // adaptive default
 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);
 pref("media.getusermedia.aec", 1);
 pref("media.getusermedia.browser.enabled", true);
 #endif
 pref("media.peerconnection.video.min_bitrate", 200);
 pref("media.peerconnection.video.start_bitrate", 300);
@@ -368,22 +366,17 @@ pref("media.getusermedia.playout_delay",
 #endif
 #else
 #ifdef ANDROID
 pref("media.navigator.enabled", true);
 #endif
 #endif
 
 pref("media.getusermedia.screensharing.enabled", true);
-#ifdef RELEASE_BUILD
 pref("media.getusermedia.screensharing.allowed_domains", "");
-#else
- // temporary value, not intended for release - bug 1049087
-pref("media.getusermedia.screensharing.allowed_domains", "mozilla.github.io");
-#endif
 // OS/X 10.6 and XP have screen/window sharing off by default due to various issues - Caveat emptor
 pref("media.getusermedia.screensharing.allow_on_old_platforms", false);
 
 // TextTrack support
 pref("media.webvtt.enabled", true);
 pref("media.webvtt.regions.enabled", false);
 
 // AudioTrack and VideoTrack support