Bug 1200477 - Allow building with WebRTC disabled. r=glandium,mrbkap

This commit is contained in:
Gian-Carlo Pascutto 2015-09-18 08:29:14 +02:00
parent 07c2523a11
commit 2790328ed3
4 changed files with 42 additions and 24 deletions

View File

@ -11,6 +11,7 @@
#undef LOG
#undef LOG_ENABLED
extern PRLogModuleInfo *gCamerasParentLog;
#define LOG(args) MOZ_LOG(gCamerasParentLog, mozilla::LogLevel::Debug, args)
#define LOG_ENABLED() MOZ_LOG_TEST(gCamerasParentLog, mozilla::LogLevel::Debug)

View File

@ -5,22 +5,22 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_WEBRTC']:
EXPORTS += ['CamerasChild.h',
'CamerasParent.h',
'CamerasUtils.h',
'LoadManager.h',
'LoadManagerFactory.h',
'LoadMonitor.h',
EXPORTS += [
'CamerasChild.h',
'CamerasParent.h',
'CamerasUtils.h',
'LoadManager.h',
'LoadManagerFactory.h',
'LoadMonitor.h',
]
UNIFIED_SOURCES += ['CamerasChild.cpp',
'CamerasParent.cpp',
'CamerasUtils.cpp',
'LoadManager.cpp',
'LoadManagerFactory.cpp',
'LoadMonitor.cpp',
]
IPDL_SOURCES = [
'PCameras.ipdl',
UNIFIED_SOURCES += [
'CamerasChild.cpp',
'CamerasParent.cpp',
'CamerasUtils.cpp',
'LoadManager.cpp',
'LoadManagerFactory.cpp',
'LoadMonitor.cpp',
'ShmemPool.cpp',
]
LOCAL_INCLUDES += [
'/media/webrtc/signaling',
@ -63,17 +63,18 @@ EXPORTS.mozilla.media += ['MediaChild.h',
'MediaSystemResourceTypes.h',
'MediaUtils.h',
]
UNIFIED_SOURCES += ['MediaChild.cpp',
'MediaParent.cpp',
'MediaSystemResourceClient.cpp',
'MediaSystemResourceManager.cpp',
'MediaSystemResourceManagerChild.cpp',
'MediaSystemResourceManagerParent.cpp',
'MediaSystemResourceService.cpp',
'MediaUtils.cpp',
'ShmemPool.cpp',
UNIFIED_SOURCES += [
'MediaChild.cpp',
'MediaParent.cpp',
'MediaSystemResourceClient.cpp',
'MediaSystemResourceManager.cpp',
'MediaSystemResourceManagerChild.cpp',
'MediaSystemResourceManagerParent.cpp',
'MediaSystemResourceService.cpp',
'MediaUtils.cpp',
]
IPDL_SOURCES += [
'PCameras.ipdl',
'PMedia.ipdl',
'PMediaSystemResourceManager.ipdl',
]

View File

@ -8,7 +8,9 @@
#include "BroadcastChannelChild.h"
#include "ServiceWorkerManagerChild.h"
#include "FileDescriptorSetChild.h"
#ifdef MOZ_WEBRTC
#include "CamerasChild.h"
#endif
#include "mozilla/media/MediaChild.h"
#include "mozilla/Assertions.h"
#include "mozilla/dom/PBlobChild.h"
@ -271,17 +273,23 @@ BackgroundChildImpl::DeallocPBroadcastChannelChild(
camera::PCamerasChild*
BackgroundChildImpl::AllocPCamerasChild()
{
#ifdef MOZ_WEBRTC
nsRefPtr<camera::CamerasChild> agent =
new camera::CamerasChild();
return agent.forget().take();
#else
return nullptr;
#endif
}
bool
BackgroundChildImpl::DeallocPCamerasChild(camera::PCamerasChild *aActor)
{
#ifdef MOZ_WEBRTC
nsRefPtr<camera::CamerasChild> child =
dont_AddRef(static_cast<camera::CamerasChild*>(aActor));
MOZ_ASSERT(aActor);
#endif
return true;
}

View File

@ -6,7 +6,9 @@
#include "BroadcastChannelParent.h"
#include "FileDescriptorSetParent.h"
#ifdef MOZ_WEBRTC
#include "CamerasParent.h"
#endif
#include "mozilla/media/MediaParent.h"
#include "mozilla/AppProcessChecker.h"
#include "mozilla/Assertions.h"
@ -290,9 +292,13 @@ BackgroundParentImpl::AllocPCamerasParent()
AssertIsInMainProcess();
AssertIsOnBackgroundThread();
#ifdef MOZ_WEBRTC
nsRefPtr<mozilla::camera::CamerasParent> actor =
mozilla::camera::CamerasParent::Create();
return actor.forget().take();
#else
return nullptr;
#endif
}
bool
@ -302,8 +308,10 @@ BackgroundParentImpl::DeallocPCamerasParent(camera::PCamerasParent *aActor)
AssertIsOnBackgroundThread();
MOZ_ASSERT(aActor);
#ifdef MOZ_WEBRTC
nsRefPtr<mozilla::camera::CamerasParent> actor =
dont_AddRef(static_cast<mozilla::camera::CamerasParent*>(aActor));
#endif
return true;
}