Bug 1434946 - Report resolution change in settings already on first frame. r=jib
authorAndreas Pehrson <pehrsons@mozilla.com>
Thu, 01 Feb 2018 16:58:35 +0100
changeset 402725 c6e90b3e141fc1d47bc3ffb0bb673b78e171030b
parent 402724 8932202ed0b9ada7c3fd14e0c69c9571744eb56a
child 402726 cf134b262f6a7223d9c94ffde7b110bc08a37bb0
push id33401
push useraciure@mozilla.com
push dateWed, 07 Feb 2018 22:04:30 +0000
treeherdermozilla-central@fc3d9de1f56c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1434946
milestone60.0a1
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
Bug 1434946 - Report resolution change in settings already on first frame. r=jib MozReview-Commit-ID: IzhdiHgVKOc
dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -39,16 +39,18 @@ MediaEngineRemoteVideoSource::MediaEngin
   , mCapEngine(aCapEngine)
   , mScary(aScary)
   , mMutex("MediaEngineRemoteVideoSource::mMutex")
   , mRescalingBufferPool(/* zero_initialize */ false,
                          /* max_number_of_buffers */ 1)
   , mSettings(MakeAndAddRef<media::Refcountable<MediaTrackSettings>>())
 {
   MOZ_ASSERT(aMediaSource != MediaSourceEnum::Other);
+  mSettings->mWidth.Construct(0);
+  mSettings->mHeight.Construct(0);
   Init();
 }
 
 void
 MediaEngineRemoteVideoSource::Init()
 {
   LOG((__PRETTY_FUNCTION__));
   AssertIsOnOwningThread();
@@ -532,17 +534,18 @@ MediaEngineRemoteVideoSource::DeliverFra
             frame_num++, aProps.width(), aProps.height(), dst_width, dst_height,
             aProps.timeStamp(), aProps.ntpTimeMs(), aProps.renderTimeMs()));
 #endif
 
   bool sizeChanged = false;
   {
     MutexAutoLock lock(mMutex);
     // implicitly releases last image
-    sizeChanged = mImage && image && mImage->GetSize() != image->GetSize();
+    sizeChanged = (!mImage && image) ||
+                  (mImage && image && mImage->GetSize() != image->GetSize());
     mImage = image.forget();
     mImageSize = mImage->GetSize();
   }
 
   if (sizeChanged) {
     NS_DispatchToMainThread(NS_NewRunnableFunction(
         "MediaEngineRemoteVideoSource::FrameSizeChange",
         [settings = mSettings, dst_width, dst_height]() mutable {