Bug 1359668 - update mSettings.mWidth and mSettings.mHeight when there is a frame size change. r?jib
MozReview-Commit-ID: GGagmRai3YP
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -351,16 +351,23 @@ MediaEngineRemoteVideoSource::FrameSizeC
#if defined(MOZ_WIDGET_GONK)
mMonitor.AssertCurrentThreadOwns(); // mWidth and mHeight are protected...
#endif
if ((mWidth < 0) || (mHeight < 0) ||
(w != (unsigned int) mWidth) || (h != (unsigned int) mHeight)) {
LOG(("MediaEngineRemoteVideoSource Video FrameSizeChange: %ux%u was %ux%u", w, h, mWidth, mHeight));
mWidth = w;
mHeight = h;
+
+ RefPtr<MediaEngineRemoteVideoSource> that = this;
+ NS_DispatchToMainThread(media::NewRunnableFrom([that, w, h]() mutable {
+ that->mSettings.mWidth.Value() = w;
+ that->mSettings.mHeight.Value() = h;
+ return NS_OK;
+ }));
}
}
int
MediaEngineRemoteVideoSource::DeliverFrame(uint8_t* aBuffer ,
const camera::VideoFrameProperties& aProps)
{
// Check for proper state.