From 4abd5e4c78e702116d84334583706802b97bc2bb Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Mon, 11 Apr 2016 16:13:26 +0200 Subject: [PATCH] Bug 1206708 - Make all WebRTC ImageContainers async. r=jesup,nical This avoids expensive copying when compositing these frames on e10s. MozReview-Commit-ID: LIeUhh6rjCf --HG-- extra : rebase_source : 1919596f2cb61d25474993f209a632531d3797fa --- dom/media/VideoSegment.cpp | 3 ++- dom/media/webrtc/MediaEngineDefault.cpp | 3 ++- dom/media/webrtc/MediaEngineRemoteVideoSource.cpp | 3 ++- dom/media/webrtc/MediaEngineTabVideoSource.cpp | 3 ++- media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dom/media/VideoSegment.cpp b/dom/media/VideoSegment.cpp index 83555e8b4f25..b504be4d266c 100644 --- a/dom/media/VideoSegment.cpp +++ b/dom/media/VideoSegment.cpp @@ -46,7 +46,8 @@ VideoFrame::TakeFrom(VideoFrame* aFrame) /* static */ already_AddRefed VideoFrame::CreateBlackImage(const gfx::IntSize& aSize) { - RefPtr container = LayerManager::CreateImageContainer(); + RefPtr container = + LayerManager::CreateImageContainer(ImageContainer::ASYNCHRONOUS); RefPtr image = container->CreatePlanarYCbCrImage(); if (!image) { MOZ_ASSERT(false); diff --git a/dom/media/webrtc/MediaEngineDefault.cpp b/dom/media/webrtc/MediaEngineDefault.cpp index 2c631831f1d9..6a07c6cef400 100644 --- a/dom/media/webrtc/MediaEngineDefault.cpp +++ b/dom/media/webrtc/MediaEngineDefault.cpp @@ -49,7 +49,8 @@ MediaEngineDefaultVideoSource::MediaEngineDefaultVideoSource() , mMonitor("Fake video") , mCb(16), mCr(16) { - mImageContainer = layers::LayerManager::CreateImageContainer(); + mImageContainer = + layers::LayerManager::CreateImageContainer(layers::ImageContainer::ASYNCHRONOUS); } MediaEngineDefaultVideoSource::~MediaEngineDefaultVideoSource() diff --git a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp index ebccc4936611..136ea338ddbf 100644 --- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp @@ -190,7 +190,8 @@ MediaEngineRemoteVideoSource::Start(SourceMediaStream* aStream, TrackID aID, if (mState == kStarted) { return NS_OK; } - mImageContainer = layers::LayerManager::CreateImageContainer(); + mImageContainer = + layers::LayerManager::CreateImageContainer(layers::ImageContainer::ASYNCHRONOUS); mState = kStarted; mTrackID = aID; diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.cpp b/dom/media/webrtc/MediaEngineTabVideoSource.cpp index cc9db78c33ac..b03a2f5c8c6a 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp @@ -288,7 +288,8 @@ MediaEngineTabVideoSource::Draw() { presShell = presContext->PresShell(); } - RefPtr container = layers::LayerManager::CreateImageContainer(); + RefPtr container = + layers::LayerManager::CreateImageContainer(layers::ImageContainer::ASYNCHRONOUS); RefPtr dt = Factory::CreateDrawTargetForData(BackendType::CAIRO, mData.get(), diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp index f7d5ec0a602e..99bda507e2bf 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp @@ -2142,7 +2142,8 @@ public: monitor_("Video PipelineListener") { #if !defined(MOZILLA_EXTERNAL_LINKAGE) - image_container_ = LayerManager::CreateImageContainer(); + image_container_ = + LayerManager::CreateImageContainer(ImageContainer::ASYNCHRONOUS); #endif }