Bug 1422389 - Limit default engine resolution. r=mchiang, a=abillings
authorJan-Ivar Bruaroey <jib@mozilla.com>
Fri, 01 Dec 2017 20:49:46 -0500
changeset 445237 9d5bd4981da9467e86b7d512a4c0c82678b53c54
parent 445236 ff143543997be6ade6aa526ace6a0bc18359e0eb
child 445238 e315475845ed21650b93c799a3cb32c3a6b2ea20
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchiang, abillings
bugs1422389
milestone58.0
Bug 1422389 - Limit default engine resolution. r=mchiang, a=abillings MozReview-Commit-ID: LS1z7I4myeb
dom/media/webrtc/MediaEngineDefault.cpp
--- a/dom/media/webrtc/MediaEngineDefault.cpp
+++ b/dom/media/webrtc/MediaEngineDefault.cpp
@@ -115,16 +115,18 @@ MediaEngineDefaultVideoSource::Allocate(
                               );
   mOpts.mHeight = c.mHeight.Get(aPrefs.mHeight ? aPrefs.mHeight :
 #ifdef DEBUG
                                 MediaEngine::DEFAULT_43_VIDEO_HEIGHT/2
 #else
                                 MediaEngine::DEFAULT_43_VIDEO_HEIGHT
 #endif
                                 );
+  mOpts.mWidth = std::max(160, std::min(mOpts.mWidth, 4096));
+  mOpts.mHeight = std::max(90, std::min(mOpts.mHeight, 2160));
   mState = kAllocated;
   *aOutHandle = nullptr;
   return NS_OK;
 }
 
 nsresult
 MediaEngineDefaultVideoSource::Deallocate(AllocationHandle* aHandle)
 {