2014-07-21 22:57:28 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
2014-03-26 08:59:01 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2014-04-10 12:49:53 +04:00
|
|
|
#include "MediaEngineTabVideoSource.h"
|
|
|
|
|
|
|
|
#include "mozilla/gfx/2D.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2016-02-29 18:20:01 +03:00
|
|
|
#include "mozilla/UniquePtrExtensions.h"
|
2013-10-18 00:48:30 +04:00
|
|
|
#include "nsGlobalWindow.h"
|
|
|
|
#include "nsIDOMClientRect.h"
|
|
|
|
#include "nsIDocShell.h"
|
|
|
|
#include "nsIPresShell.h"
|
|
|
|
#include "nsPresContext.h"
|
|
|
|
#include "gfxContext.h"
|
2013-12-13 21:32:02 +04:00
|
|
|
#include "gfx2DGlue.h"
|
2013-10-18 00:48:30 +04:00
|
|
|
#include "ImageContainer.h"
|
|
|
|
#include "Layers.h"
|
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
|
|
|
#include "nsITabSource.h"
|
|
|
|
#include "VideoUtils.h"
|
|
|
|
#include "nsServiceManagerUtils.h"
|
|
|
|
#include "nsIPrefService.h"
|
2014-07-11 19:55:23 +04:00
|
|
|
#include "MediaTrackConstraints.h"
|
2014-03-26 08:59:01 +04:00
|
|
|
|
2013-10-18 00:48:30 +04:00
|
|
|
namespace mozilla {
|
|
|
|
|
2013-12-31 13:06:12 +04:00
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(MediaEngineTabVideoSource, nsIDOMEventListener, nsITimerCallback)
|
2013-10-18 00:48:30 +04:00
|
|
|
|
|
|
|
MediaEngineTabVideoSource::MediaEngineTabVideoSource()
|
2015-10-23 00:03:47 +03:00
|
|
|
: mBufWidthMax(0)
|
|
|
|
, mBufHeightMax(0)
|
|
|
|
, mWindowId(0)
|
|
|
|
, mScrollWithPage(false)
|
|
|
|
, mViewportOffsetX(0)
|
|
|
|
, mViewportOffsetY(0)
|
|
|
|
, mViewportWidth(0)
|
|
|
|
, mViewportHeight(0)
|
|
|
|
, mTimePerFrame(0)
|
|
|
|
, mDataSize(0)
|
2016-03-16 21:21:17 +03:00
|
|
|
, mBlackedoutWindow(false)
|
2015-10-23 00:03:47 +03:00
|
|
|
, mMonitor("MediaEngineTabVideoSource") {}
|
2014-03-18 23:05:46 +04:00
|
|
|
|
2013-10-18 00:48:30 +04:00
|
|
|
nsresult
|
|
|
|
MediaEngineTabVideoSource::StartRunnable::Run()
|
|
|
|
{
|
|
|
|
mVideoSource->Draw();
|
2014-07-12 01:03:47 +04:00
|
|
|
mVideoSource->mTimer = do_CreateInstance(NS_TIMER_CONTRACTID);
|
|
|
|
mVideoSource->mTimer->InitWithCallback(mVideoSource, mVideoSource->mTimePerFrame, nsITimer:: TYPE_REPEATING_SLACK);
|
2014-07-21 22:57:28 +04:00
|
|
|
if (mVideoSource->mTabSource) {
|
|
|
|
mVideoSource->mTabSource->NotifyStreamStart(mVideoSource->mWindow);
|
|
|
|
}
|
2013-10-18 00:48:30 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
MediaEngineTabVideoSource::StopRunnable::Run()
|
|
|
|
{
|
|
|
|
if (mVideoSource->mTimer) {
|
|
|
|
mVideoSource->mTimer->Cancel();
|
2013-10-24 00:34:10 +04:00
|
|
|
mVideoSource->mTimer = nullptr;
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
2014-07-21 22:57:28 +04:00
|
|
|
if (mVideoSource->mTabSource) {
|
|
|
|
mVideoSource->mTabSource->NotifyStreamStop(mVideoSource->mWindow);
|
|
|
|
}
|
2013-10-18 00:48:30 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
MediaEngineTabVideoSource::HandleEvent(nsIDOMEvent *event) {
|
|
|
|
Draw();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
MediaEngineTabVideoSource::Notify(nsITimer*) {
|
|
|
|
Draw();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
MediaEngineTabVideoSource::InitRunnable::Run()
|
|
|
|
{
|
2014-07-21 22:57:28 +04:00
|
|
|
if (mVideoSource->mWindowId != -1) {
|
2016-03-16 21:21:17 +03:00
|
|
|
nsGlobalWindow* globalWindow =
|
|
|
|
nsGlobalWindow::GetOuterWindowWithId(mVideoSource->mWindowId);
|
|
|
|
if (!globalWindow) {
|
|
|
|
// We can't access the window, just send a blacked out screen.
|
|
|
|
mVideoSource->mWindow = nullptr;
|
|
|
|
mVideoSource->mBlackedoutWindow = true;
|
|
|
|
} else {
|
|
|
|
nsCOMPtr<nsPIDOMWindowOuter> window = globalWindow->AsOuter();
|
|
|
|
if (window) {
|
|
|
|
mVideoSource->mWindow = window;
|
|
|
|
mVideoSource->mBlackedoutWindow = false;
|
|
|
|
}
|
2014-07-21 22:57:28 +04:00
|
|
|
}
|
|
|
|
}
|
2016-03-16 21:21:17 +03:00
|
|
|
if (!mVideoSource->mWindow && !mVideoSource->mBlackedoutWindow) {
|
2014-07-21 22:57:28 +04:00
|
|
|
nsresult rv;
|
|
|
|
mVideoSource->mTabSource = do_GetService(NS_TABSOURCESERVICE_CONTRACTID, &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
nsCOMPtr<mozIDOMWindowProxy> win;
|
2014-07-21 22:57:28 +04:00
|
|
|
rv = mVideoSource->mTabSource->GetTabToStream(getter_AddRefs(win));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
if (!win)
|
|
|
|
return NS_OK;
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
mVideoSource->mWindow = nsPIDOMWindowOuter::From(win);
|
2016-03-16 21:21:17 +03:00
|
|
|
MOZ_ASSERT(mVideoSource->mWindow);
|
2014-07-21 22:57:28 +04:00
|
|
|
}
|
2013-10-18 00:48:30 +04:00
|
|
|
nsCOMPtr<nsIRunnable> start(new StartRunnable(mVideoSource));
|
|
|
|
start->Run();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-06-21 03:15:39 +03:00
|
|
|
MediaEngineTabVideoSource::GetName(nsAString_internal& aName) const
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
2016-07-21 08:03:25 +03:00
|
|
|
aName.AssignLiteral(u"&getUserMedia.videoSource.tabShare;");
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2016-06-21 03:15:39 +03:00
|
|
|
MediaEngineTabVideoSource::GetUUID(nsACString_internal& aUuid) const
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
2015-06-18 18:46:36 +03:00
|
|
|
aUuid.AssignLiteral("tab");
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
|
|
|
|
2015-03-13 19:21:20 +03:00
|
|
|
#define DEFAULT_TABSHARE_VIDEO_MAX_WIDTH 4096
|
|
|
|
#define DEFAULT_TABSHARE_VIDEO_MAX_HEIGHT 4096
|
|
|
|
#define DEFAULT_TABSHARE_VIDEO_FRAMERATE 30
|
|
|
|
|
2013-10-18 00:48:30 +04:00
|
|
|
nsresult
|
2015-02-21 01:06:26 +03:00
|
|
|
MediaEngineTabVideoSource::Allocate(const dom::MediaTrackConstraints& aConstraints,
|
2015-07-03 01:01:52 +03:00
|
|
|
const MediaEnginePrefs& aPrefs,
|
2016-02-17 20:57:26 +03:00
|
|
|
const nsString& aDeviceId,
|
2016-06-30 22:43:24 +03:00
|
|
|
const nsACString& aOrigin,
|
2016-07-13 06:25:07 +03:00
|
|
|
AllocationHandle** aOutHandle,
|
2016-06-16 02:25:07 +03:00
|
|
|
const char** aOutBadConstraint)
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
2015-10-23 00:03:47 +03:00
|
|
|
// windowId is not a proper constraint, so just read it.
|
|
|
|
// It has no well-defined behavior in advanced, so ignore it there.
|
2015-02-21 01:06:26 +03:00
|
|
|
|
|
|
|
mWindowId = aConstraints.mBrowserWindow.WasPassed() ?
|
|
|
|
aConstraints.mBrowserWindow.Value() : -1;
|
2016-08-01 23:26:13 +03:00
|
|
|
*aOutHandle = nullptr;
|
2016-06-16 02:25:07 +03:00
|
|
|
return Restart(nullptr, aConstraints, aPrefs, aDeviceId, aOutBadConstraint);
|
2015-10-23 00:03:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2016-07-13 06:25:07 +03:00
|
|
|
MediaEngineTabVideoSource::Restart(AllocationHandle* aHandle,
|
2016-05-25 08:52:15 +03:00
|
|
|
const dom::MediaTrackConstraints& aConstraints,
|
2015-10-23 00:03:47 +03:00
|
|
|
const mozilla::MediaEnginePrefs& aPrefs,
|
2016-06-16 02:25:07 +03:00
|
|
|
const nsString& aDeviceId,
|
|
|
|
const char** aOutBadConstraint)
|
2015-10-23 00:03:47 +03:00
|
|
|
{
|
2016-05-25 08:52:15 +03:00
|
|
|
MOZ_ASSERT(!aHandle);
|
|
|
|
|
2015-10-23 00:03:47 +03:00
|
|
|
// scrollWithPage is not proper a constraint, so just read it.
|
|
|
|
// It has no well-defined behavior in advanced, so ignore it there.
|
|
|
|
|
2015-02-21 01:06:26 +03:00
|
|
|
mScrollWithPage = aConstraints.mScrollWithPage.WasPassed() ?
|
2015-10-23 00:03:47 +03:00
|
|
|
aConstraints.mScrollWithPage.Value() : false;
|
2015-02-21 01:06:26 +03:00
|
|
|
|
|
|
|
FlattenedConstraints c(aConstraints);
|
|
|
|
|
2015-10-23 00:03:47 +03:00
|
|
|
mBufWidthMax = c.mWidth.Get(DEFAULT_TABSHARE_VIDEO_MAX_WIDTH);
|
|
|
|
mBufHeightMax = c.mHeight.Get(DEFAULT_TABSHARE_VIDEO_MAX_HEIGHT);
|
|
|
|
double frameRate = c.mFrameRate.Get(DEFAULT_TABSHARE_VIDEO_FRAMERATE);
|
2015-02-21 01:06:26 +03:00
|
|
|
mTimePerFrame = std::max(10, int(1000.0 / (frameRate > 0? frameRate : 1)));
|
2015-10-23 00:03:47 +03:00
|
|
|
|
|
|
|
if (!mScrollWithPage) {
|
|
|
|
mViewportOffsetX = c.mViewportOffsetX.Get(0);
|
|
|
|
mViewportOffsetY = c.mViewportOffsetY.Get(0);
|
|
|
|
mViewportWidth = c.mViewportWidth.Get(INT32_MAX);
|
|
|
|
mViewportHeight = c.mViewportHeight.Get(INT32_MAX);
|
|
|
|
}
|
2013-10-18 00:48:30 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2016-07-13 06:25:07 +03:00
|
|
|
MediaEngineTabVideoSource::Deallocate(AllocationHandle* aHandle)
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
2016-06-30 22:43:24 +03:00
|
|
|
MOZ_ASSERT(!aHandle);
|
2013-10-18 00:48:30 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2016-04-06 15:56:44 +03:00
|
|
|
MediaEngineTabVideoSource::Start(SourceMediaStream* aStream, TrackID aID,
|
|
|
|
const PrincipalHandle& aPrincipalHandle)
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIRunnable> runnable;
|
|
|
|
if (!mWindow)
|
|
|
|
runnable = new InitRunnable(this);
|
|
|
|
else
|
|
|
|
runnable = new StartRunnable(this);
|
|
|
|
NS_DispatchToMainThread(runnable);
|
2014-09-18 03:50:02 +04:00
|
|
|
aStream->AddTrack(aID, 0, new VideoSegment());
|
2013-10-18 00:48:30 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-09-18 03:50:01 +04:00
|
|
|
MediaEngineTabVideoSource::NotifyPull(MediaStreamGraph*,
|
|
|
|
SourceMediaStream* aSource,
|
2016-04-06 15:56:44 +03:00
|
|
|
TrackID aID, StreamTime aDesiredTime,
|
|
|
|
const PrincipalHandle& aPrincipalHandle)
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
|
|
|
VideoSegment segment;
|
|
|
|
MonitorAutoLock mon(mMonitor);
|
|
|
|
|
|
|
|
// Note: we're not giving up mImage here
|
2015-12-18 09:52:16 +03:00
|
|
|
RefPtr<layers::SourceSurfaceImage> image = mImage;
|
2014-12-30 04:54:02 +03:00
|
|
|
StreamTime delta = aDesiredTime - aSource->GetEndOfAppendedData(aID);
|
2013-10-18 00:48:30 +04:00
|
|
|
if (delta > 0) {
|
2013-10-24 00:34:10 +04:00
|
|
|
// nullptr images are allowed
|
2014-03-15 23:00:17 +04:00
|
|
|
gfx::IntSize size = image ? image->GetSize() : IntSize(0, 0);
|
2016-04-06 15:56:44 +03:00
|
|
|
segment.AppendFrame(image.forget().downcast<layers::Image>(), delta, size,
|
|
|
|
aPrincipalHandle);
|
2013-10-18 00:48:30 +04:00
|
|
|
// This can fail if either a) we haven't added the track yet, or b)
|
|
|
|
// we've removed or finished the track.
|
2014-12-30 04:54:03 +03:00
|
|
|
aSource->AppendToTrack(aID, &(segment));
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MediaEngineTabVideoSource::Draw() {
|
2016-03-16 21:21:17 +03:00
|
|
|
if (!mWindow && !mBlackedoutWindow) {
|
2013-10-18 00:48:30 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-03-16 21:21:17 +03:00
|
|
|
if (mWindow) {
|
|
|
|
if (mScrollWithPage || mViewportWidth == INT32_MAX) {
|
|
|
|
mWindow->GetInnerWidth(&mViewportWidth);
|
|
|
|
}
|
|
|
|
if (mScrollWithPage || mViewportHeight == INT32_MAX) {
|
|
|
|
mWindow->GetInnerHeight(&mViewportHeight);
|
|
|
|
}
|
|
|
|
if (!mViewportWidth || !mViewportHeight) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
mViewportWidth = 640;
|
|
|
|
mViewportHeight = 480;
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
|
|
|
|
2015-01-20 22:54:19 +03:00
|
|
|
IntSize size;
|
2015-10-23 00:03:47 +03:00
|
|
|
{
|
|
|
|
float pixelRatio;
|
2016-03-16 21:21:17 +03:00
|
|
|
if (mWindow) {
|
|
|
|
mWindow->GetDevicePixelRatio(&pixelRatio);
|
|
|
|
} else {
|
|
|
|
pixelRatio = 1.0f;
|
|
|
|
}
|
2015-10-23 00:03:47 +03:00
|
|
|
const int32_t deviceWidth = (int32_t)(pixelRatio * mViewportWidth);
|
|
|
|
const int32_t deviceHeight = (int32_t)(pixelRatio * mViewportHeight);
|
|
|
|
|
|
|
|
if ((deviceWidth <= mBufWidthMax) && (deviceHeight <= mBufHeightMax)) {
|
|
|
|
size = IntSize(deviceWidth, deviceHeight);
|
|
|
|
} else {
|
|
|
|
const float scaleWidth = (float)mBufWidthMax / (float)deviceWidth;
|
|
|
|
const float scaleHeight = (float)mBufHeightMax / (float)deviceHeight;
|
|
|
|
const float scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight;
|
|
|
|
|
|
|
|
size = IntSize((int)(scale * deviceWidth), (int)(scale * deviceHeight));
|
|
|
|
}
|
2015-01-20 22:54:19 +03:00
|
|
|
}
|
|
|
|
|
2016-01-08 07:57:38 +03:00
|
|
|
gfxImageFormat format = SurfaceFormat::X8R8G8B8_UINT32;
|
2015-01-20 22:54:19 +03:00
|
|
|
uint32_t stride = gfxASurface::FormatStrideForWidth(format, size.width);
|
|
|
|
|
|
|
|
if (mDataSize < static_cast<size_t>(stride * size.height)) {
|
|
|
|
mDataSize = stride * size.height;
|
2016-02-29 18:20:01 +03:00
|
|
|
mData = MakeUniqueFallible<unsigned char[]>(mDataSize);
|
2015-01-20 22:54:19 +03:00
|
|
|
}
|
|
|
|
if (!mData) {
|
|
|
|
return;
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
|
|
|
|
2015-10-23 00:03:47 +03:00
|
|
|
nsCOMPtr<nsIPresShell> presShell;
|
2016-03-16 21:21:17 +03:00
|
|
|
if (mWindow) {
|
2015-10-23 00:03:47 +03:00
|
|
|
RefPtr<nsPresContext> presContext;
|
2016-01-30 20:05:36 +03:00
|
|
|
nsIDocShell* docshell = mWindow->GetDocShell();
|
2015-10-23 00:03:47 +03:00
|
|
|
if (docshell) {
|
|
|
|
docshell->GetPresContext(getter_AddRefs(presContext));
|
|
|
|
}
|
|
|
|
if (!presContext) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
presShell = presContext->PresShell();
|
2013-10-18 00:48:30 +04:00
|
|
|
}
|
2014-12-17 01:43:23 +03:00
|
|
|
|
2016-04-11 17:13:26 +03:00
|
|
|
RefPtr<layers::ImageContainer> container =
|
|
|
|
layers::LayerManager::CreateImageContainer(layers::ImageContainer::ASYNCHRONOUS);
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<DrawTarget> dt =
|
2014-04-10 12:49:53 +04:00
|
|
|
Factory::CreateDrawTargetForData(BackendType::CAIRO,
|
2016-02-29 18:20:01 +03:00
|
|
|
mData.get(),
|
2014-04-10 12:49:53 +04:00
|
|
|
size,
|
|
|
|
stride,
|
|
|
|
SurfaceFormat::B8G8R8X8);
|
2016-04-12 22:18:11 +03:00
|
|
|
if (!dt || !dt->IsValid()) {
|
2013-10-18 00:48:30 +04:00
|
|
|
return;
|
|
|
|
}
|
2016-06-07 02:39:56 +03:00
|
|
|
RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt);
|
2016-04-12 22:18:11 +03:00
|
|
|
MOZ_ASSERT(context); // already checked the draw target above
|
2015-10-23 00:03:47 +03:00
|
|
|
context->SetMatrix(context->CurrentMatrix().Scale((((float) size.width)/mViewportWidth),
|
|
|
|
(((float) size.height)/mViewportHeight)));
|
2013-10-18 00:48:30 +04:00
|
|
|
|
2016-03-16 21:21:17 +03:00
|
|
|
if (mWindow) {
|
|
|
|
nscolor bgColor = NS_RGB(255, 255, 255);
|
|
|
|
uint32_t renderDocFlags = mScrollWithPage? 0 :
|
|
|
|
(nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING |
|
|
|
|
nsIPresShell::RENDER_DOCUMENT_RELATIVE);
|
|
|
|
nsRect r(nsPresContext::CSSPixelsToAppUnits((float)mViewportOffsetX),
|
|
|
|
nsPresContext::CSSPixelsToAppUnits((float)mViewportOffsetY),
|
|
|
|
nsPresContext::CSSPixelsToAppUnits((float)mViewportWidth),
|
|
|
|
nsPresContext::CSSPixelsToAppUnits((float)mViewportHeight));
|
|
|
|
NS_ENSURE_SUCCESS_VOID(presShell->RenderDocument(r, renderDocFlags, bgColor, context));
|
|
|
|
}
|
2013-10-18 00:48:30 +04:00
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<SourceSurface> surface = dt->Snapshot();
|
2014-04-10 12:49:53 +04:00
|
|
|
if (!surface) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-12-18 09:52:16 +03:00
|
|
|
RefPtr<layers::SourceSurfaceImage> image = new layers::SourceSurfaceImage(size, surface);
|
2013-10-18 00:48:30 +04:00
|
|
|
|
|
|
|
MonitorAutoLock mon(mMonitor);
|
|
|
|
mImage = image;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2016-10-20 21:03:16 +03:00
|
|
|
MediaEngineTabVideoSource::Stop(mozilla::SourceMediaStream*, mozilla::TrackID)
|
2013-10-18 00:48:30 +04:00
|
|
|
{
|
2016-03-16 21:21:17 +03:00
|
|
|
// If mBlackedoutWindow is true, we may be running
|
|
|
|
// despite mWindow == nullptr.
|
|
|
|
if (!mWindow && !mBlackedoutWindow) {
|
2014-07-01 17:38:20 +04:00
|
|
|
return NS_OK;
|
2016-03-16 21:21:17 +03:00
|
|
|
}
|
2014-07-01 17:38:20 +04:00
|
|
|
|
2013-10-18 00:48:30 +04:00
|
|
|
NS_DispatchToMainThread(new StopRunnable(this));
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
MediaEngineTabVideoSource::IsFake()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|