2014-10-13 03:37:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
|
|
|
|
|
|
|
#include "MediaEngineCameraVideoSource.h"
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
#include <limits>
|
|
|
|
|
2014-10-13 03:37:37 +00:00
|
|
|
namespace mozilla {
|
|
|
|
|
2014-10-24 12:57:03 +00:00
|
|
|
using namespace mozilla::gfx;
|
2015-06-18 15:46:36 +00:00
|
|
|
using namespace mozilla::dom;
|
2014-10-13 03:37:37 +00:00
|
|
|
|
|
|
|
extern PRLogModuleInfo* GetMediaManagerLog();
|
2015-06-03 22:25:57 +00:00
|
|
|
#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg)
|
|
|
|
#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg)
|
2014-10-13 03:37:37 +00:00
|
|
|
|
2014-10-24 12:57:03 +00:00
|
|
|
// guts for appending data to the MSG track
|
|
|
|
bool MediaEngineCameraVideoSource::AppendToTrack(SourceMediaStream* aSource,
|
|
|
|
layers::Image* aImage,
|
|
|
|
TrackID aID,
|
2014-09-18 05:20:43 +00:00
|
|
|
StreamTime delta)
|
2014-10-24 12:57:03 +00:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(aSource);
|
|
|
|
|
|
|
|
VideoSegment segment;
|
|
|
|
nsRefPtr<layers::Image> image = aImage;
|
|
|
|
IntSize size(image ? mWidth : 0, image ? mHeight : 0);
|
|
|
|
segment.AppendFrame(image.forget(), delta, size);
|
|
|
|
|
|
|
|
// This is safe from any thread, and is safe if the track is Finished
|
|
|
|
// or Destroyed.
|
|
|
|
// This can fail if either a) we haven't added the track yet, or b)
|
|
|
|
// we've removed or finished the track.
|
|
|
|
return aSource->AppendToTrack(aID, &(segment));
|
|
|
|
}
|
|
|
|
|
2015-02-18 18:06:01 +00:00
|
|
|
// Sub-classes (B2G or desktop) should overload one of both of these two methods
|
|
|
|
// to provide capabilities
|
|
|
|
size_t
|
|
|
|
MediaEngineCameraVideoSource::NumCapabilities()
|
|
|
|
{
|
|
|
|
return mHardcodedCapabilities.Length();
|
|
|
|
}
|
|
|
|
|
2014-10-13 03:37:37 +00:00
|
|
|
void
|
2015-02-18 18:06:01 +00:00
|
|
|
MediaEngineCameraVideoSource::GetCapability(size_t aIndex,
|
|
|
|
webrtc::CaptureCapability& aOut)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aIndex < mHardcodedCapabilities.Length());
|
|
|
|
aOut = mHardcodedCapabilities[aIndex];
|
|
|
|
}
|
|
|
|
|
2015-06-18 15:46:36 +00:00
|
|
|
uint32_t
|
2015-02-20 22:06:26 +00:00
|
|
|
MediaEngineCameraVideoSource::GetFitnessDistance(const webrtc::CaptureCapability& aCandidate,
|
2015-05-07 03:01:17 +00:00
|
|
|
const MediaTrackConstraintSet &aConstraints,
|
2015-07-02 22:01:52 +00:00
|
|
|
bool aAdvanced,
|
|
|
|
const nsString& aDeviceId)
|
2015-02-20 22:06:26 +00:00
|
|
|
{
|
2015-03-12 16:37:25 +00:00
|
|
|
// Treat width|height|frameRate == 0 on capability as "can do any".
|
|
|
|
// This allows for orthogonal capabilities that are not in discrete steps.
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
uint64_t distance =
|
2015-07-02 22:01:52 +00:00
|
|
|
uint64_t(FitnessDistance(aDeviceId, aConstraints.mDeviceId, aAdvanced)) +
|
2015-06-18 15:46:36 +00:00
|
|
|
uint64_t(FitnessDistance(mFacingMode, aConstraints.mFacingMode, aAdvanced)) +
|
2015-03-12 16:37:25 +00:00
|
|
|
uint64_t(aCandidate.width? FitnessDistance(int32_t(aCandidate.width),
|
2015-05-07 03:01:17 +00:00
|
|
|
aConstraints.mWidth,
|
|
|
|
aAdvanced) : 0) +
|
2015-03-12 16:37:25 +00:00
|
|
|
uint64_t(aCandidate.height? FitnessDistance(int32_t(aCandidate.height),
|
2015-05-07 03:01:17 +00:00
|
|
|
aConstraints.mHeight,
|
|
|
|
aAdvanced) : 0) +
|
2015-03-12 16:37:25 +00:00
|
|
|
uint64_t(aCandidate.maxFPS? FitnessDistance(double(aCandidate.maxFPS),
|
2015-05-07 03:01:17 +00:00
|
|
|
aConstraints.mFrameRate,
|
|
|
|
aAdvanced) : 0);
|
2015-02-20 22:06:26 +00:00
|
|
|
return uint32_t(std::min(distance, uint64_t(UINT32_MAX)));
|
|
|
|
}
|
|
|
|
|
|
|
|
// Find best capability by removing inferiors. May leave >1 of equal distance
|
|
|
|
|
|
|
|
/* static */ void
|
|
|
|
MediaEngineCameraVideoSource::TrimLessFitCandidates(CapabilitySet& set) {
|
|
|
|
uint32_t best = UINT32_MAX;
|
|
|
|
for (auto& candidate : set) {
|
|
|
|
if (best > candidate.mDistance) {
|
|
|
|
best = candidate.mDistance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (size_t i = 0; i < set.Length();) {
|
|
|
|
if (set[i].mDistance > best) {
|
|
|
|
set.RemoveElementAt(i);
|
|
|
|
} else {
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MOZ_ASSERT(set.Length());
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetBestFitnessDistance returns the best distance the capture device can offer
|
|
|
|
// as a whole, given an accumulated number of ConstraintSets.
|
|
|
|
// Ideal values are considered in the first ConstraintSet only.
|
2015-05-07 03:01:17 +00:00
|
|
|
// Plain values are treated as Ideal in the first ConstraintSet.
|
|
|
|
// Plain values are treated as Exact in subsequent ConstraintSets.
|
2015-02-20 22:06:26 +00:00
|
|
|
// Infinity = UINT32_MAX e.g. device cannot satisfy accumulated ConstraintSets.
|
|
|
|
// A finite result may be used to calculate this device's ranking as a choice.
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
MediaEngineCameraVideoSource::GetBestFitnessDistance(
|
2015-07-02 22:01:52 +00:00
|
|
|
const nsTArray<const MediaTrackConstraintSet*>& aConstraintSets,
|
|
|
|
const nsString& aDeviceId)
|
2014-10-13 03:37:37 +00:00
|
|
|
{
|
2015-02-18 18:06:01 +00:00
|
|
|
size_t num = NumCapabilities();
|
|
|
|
|
|
|
|
CapabilitySet candidateSet;
|
|
|
|
for (size_t i = 0; i < num; i++) {
|
|
|
|
candidateSet.AppendElement(i);
|
|
|
|
}
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
bool first = true;
|
2015-02-18 18:06:01 +00:00
|
|
|
for (const MediaTrackConstraintSet* cs : aConstraintSets) {
|
|
|
|
for (size_t i = 0; i < candidateSet.Length(); ) {
|
2015-02-20 22:06:26 +00:00
|
|
|
auto& candidate = candidateSet[i];
|
2015-02-18 18:06:01 +00:00
|
|
|
webrtc::CaptureCapability cap;
|
2015-02-20 22:06:26 +00:00
|
|
|
GetCapability(candidate.mIndex, cap);
|
2015-07-02 22:01:52 +00:00
|
|
|
uint32_t distance = GetFitnessDistance(cap, *cs, !first, aDeviceId);
|
2015-02-20 22:06:26 +00:00
|
|
|
if (distance == UINT32_MAX) {
|
2015-02-18 18:06:01 +00:00
|
|
|
candidateSet.RemoveElementAt(i);
|
|
|
|
} else {
|
|
|
|
++i;
|
2015-02-20 22:06:26 +00:00
|
|
|
if (first) {
|
|
|
|
candidate.mDistance = distance;
|
|
|
|
}
|
2015-02-18 18:06:01 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-20 22:06:26 +00:00
|
|
|
first = false;
|
|
|
|
}
|
|
|
|
if (!candidateSet.Length()) {
|
|
|
|
return UINT32_MAX;
|
2015-02-18 18:06:01 +00:00
|
|
|
}
|
2015-02-20 22:06:26 +00:00
|
|
|
TrimLessFitCandidates(candidateSet);
|
|
|
|
return candidateSet[0].mDistance;
|
2015-02-18 18:06:01 +00:00
|
|
|
}
|
|
|
|
|
2015-04-08 16:06:39 +00:00
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::LogConstraints(
|
|
|
|
const MediaTrackConstraintSet& aConstraints, bool aAdvanced)
|
|
|
|
{
|
|
|
|
NormalizedConstraintSet c(aConstraints, aAdvanced);
|
|
|
|
LOG(((c.mWidth.mIdeal.WasPassed()?
|
|
|
|
"Constraints: width: { min: %d, max: %d, ideal: %d }" :
|
|
|
|
"Constraints: width: { min: %d, max: %d }"),
|
|
|
|
c.mWidth.mMin, c.mWidth.mMax,
|
|
|
|
c.mWidth.mIdeal.WasPassed()? c.mWidth.mIdeal.Value() : 0));
|
|
|
|
LOG(((c.mHeight.mIdeal.WasPassed()?
|
|
|
|
" height: { min: %d, max: %d, ideal: %d }" :
|
|
|
|
" height: { min: %d, max: %d }"),
|
|
|
|
c.mHeight.mMin, c.mHeight.mMax,
|
|
|
|
c.mHeight.mIdeal.WasPassed()? c.mHeight.mIdeal.Value() : 0));
|
|
|
|
LOG(((c.mFrameRate.mIdeal.WasPassed()?
|
|
|
|
" frameRate: { min: %f, max: %f, ideal: %f }" :
|
|
|
|
" frameRate: { min: %f, max: %f }"),
|
|
|
|
c.mFrameRate.mMin, c.mFrameRate.mMax,
|
|
|
|
c.mFrameRate.mIdeal.WasPassed()? c.mFrameRate.mIdeal.Value() : 0));
|
|
|
|
}
|
|
|
|
|
2015-09-03 19:07:45 +00:00
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::LogCapability(const char* aHeader,
|
|
|
|
const webrtc::CaptureCapability &aCapability, uint32_t aDistance)
|
|
|
|
{
|
|
|
|
// RawVideoType and VideoCodecType media/webrtc/trunk/webrtc/common_types.h
|
|
|
|
static const char* const types[] = {
|
|
|
|
"I420",
|
|
|
|
"YV12",
|
|
|
|
"YUY2",
|
|
|
|
"UYVY",
|
|
|
|
"IYUV",
|
|
|
|
"ARGB",
|
|
|
|
"RGB24",
|
|
|
|
"RGB565",
|
|
|
|
"ARGB4444",
|
|
|
|
"ARGB1555",
|
|
|
|
"MJPEG",
|
|
|
|
"NV12",
|
|
|
|
"NV21",
|
|
|
|
"BGRA",
|
|
|
|
"Unknown type"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char* const codec[] = {
|
|
|
|
"VP8",
|
|
|
|
"VP9",
|
|
|
|
"H264",
|
|
|
|
"I420",
|
|
|
|
"RED",
|
|
|
|
"ULPFEC",
|
|
|
|
"Generic codec",
|
|
|
|
"Unknown codec"
|
|
|
|
};
|
|
|
|
|
|
|
|
LOG(("%s: %4u x %4u x %2u maxFps, %s, %s. Distance = %lu",
|
|
|
|
aHeader, aCapability.width, aCapability.height, aCapability.maxFPS,
|
|
|
|
types[std::min(std::max(uint32_t(0), uint32_t(aCapability.rawType)),
|
|
|
|
uint32_t(sizeof(types) / sizeof(*types) - 1))],
|
|
|
|
codec[std::min(std::max(uint32_t(0), uint32_t(aCapability.codecType)),
|
|
|
|
uint32_t(sizeof(codec) / sizeof(*codec) - 1))],
|
|
|
|
aDistance));
|
|
|
|
}
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
bool
|
2015-02-18 18:06:01 +00:00
|
|
|
MediaEngineCameraVideoSource::ChooseCapability(
|
2015-06-18 15:46:36 +00:00
|
|
|
const MediaTrackConstraints &aConstraints,
|
2015-07-02 22:01:52 +00:00
|
|
|
const MediaEnginePrefs &aPrefs,
|
|
|
|
const nsString& aDeviceId)
|
2015-02-18 18:06:01 +00:00
|
|
|
{
|
2015-06-03 22:25:57 +00:00
|
|
|
if (MOZ_LOG_TEST(GetMediaManagerLog(), LogLevel::Debug)) {
|
2015-05-14 17:13:23 +00:00
|
|
|
LOG(("ChooseCapability: prefs: %dx%d @%d-%dfps",
|
|
|
|
aPrefs.GetWidth(), aPrefs.GetHeight(),
|
|
|
|
aPrefs.mFPS, aPrefs.mMinFPS));
|
|
|
|
LogConstraints(aConstraints, false);
|
|
|
|
if (aConstraints.mAdvanced.WasPassed()) {
|
|
|
|
LOG(("Advanced array[%u]:", aConstraints.mAdvanced.Value().Length()));
|
|
|
|
for (auto& advanced : aConstraints.mAdvanced.Value()) {
|
|
|
|
LogConstraints(advanced, true);
|
|
|
|
}
|
2015-04-08 16:06:39 +00:00
|
|
|
}
|
|
|
|
}
|
2014-10-13 03:37:37 +00:00
|
|
|
|
2015-02-18 18:06:01 +00:00
|
|
|
size_t num = NumCapabilities();
|
|
|
|
|
|
|
|
CapabilitySet candidateSet;
|
|
|
|
for (size_t i = 0; i < num; i++) {
|
|
|
|
candidateSet.AppendElement(i);
|
|
|
|
}
|
2014-10-13 03:37:37 +00:00
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
// First, filter capabilities by required constraints (min, max, exact).
|
2015-02-18 18:06:01 +00:00
|
|
|
|
|
|
|
for (size_t i = 0; i < candidateSet.Length();) {
|
2015-02-20 22:06:26 +00:00
|
|
|
auto& candidate = candidateSet[i];
|
2015-02-18 18:06:01 +00:00
|
|
|
webrtc::CaptureCapability cap;
|
2015-02-20 22:06:26 +00:00
|
|
|
GetCapability(candidate.mIndex, cap);
|
2015-07-02 22:01:52 +00:00
|
|
|
candidate.mDistance = GetFitnessDistance(cap, aConstraints, false, aDeviceId);
|
2015-09-03 19:07:45 +00:00
|
|
|
LogCapability("Capability", cap, candidate.mDistance);
|
2015-02-20 22:06:26 +00:00
|
|
|
if (candidate.mDistance == UINT32_MAX) {
|
2015-02-18 18:06:01 +00:00
|
|
|
candidateSet.RemoveElementAt(i);
|
|
|
|
} else {
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
// Filter further with all advanced constraints (that don't overconstrain).
|
2014-10-13 03:37:37 +00:00
|
|
|
|
|
|
|
if (aConstraints.mAdvanced.WasPassed()) {
|
2015-02-18 18:06:01 +00:00
|
|
|
for (const MediaTrackConstraintSet &cs : aConstraints.mAdvanced.Value()) {
|
|
|
|
CapabilitySet rejects;
|
|
|
|
for (size_t i = 0; i < candidateSet.Length();) {
|
2015-02-20 22:06:26 +00:00
|
|
|
auto& candidate = candidateSet[i];
|
2015-02-18 18:06:01 +00:00
|
|
|
webrtc::CaptureCapability cap;
|
2015-02-20 22:06:26 +00:00
|
|
|
GetCapability(candidate.mIndex, cap);
|
2015-07-02 22:01:52 +00:00
|
|
|
if (GetFitnessDistance(cap, cs, true, aDeviceId) == UINT32_MAX) {
|
2015-02-20 22:06:26 +00:00
|
|
|
rejects.AppendElement(candidate);
|
2015-02-18 18:06:01 +00:00
|
|
|
candidateSet.RemoveElementAt(i);
|
|
|
|
} else {
|
|
|
|
++i;
|
|
|
|
}
|
2014-10-13 03:37:37 +00:00
|
|
|
}
|
2015-02-20 22:06:26 +00:00
|
|
|
if (!candidateSet.Length()) {
|
2015-08-11 15:29:46 +00:00
|
|
|
candidateSet.AppendElements(Move(rejects));
|
2015-02-20 22:06:26 +00:00
|
|
|
}
|
2014-10-13 03:37:37 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-18 18:06:01 +00:00
|
|
|
if (!candidateSet.Length()) {
|
2015-02-20 22:06:26 +00:00
|
|
|
LOG(("failed to find capability match from %d choices",num));
|
|
|
|
return false;
|
2015-02-18 18:06:01 +00:00
|
|
|
}
|
|
|
|
|
2015-02-20 22:06:26 +00:00
|
|
|
// Remaining algorithm is up to the UA.
|
|
|
|
|
|
|
|
TrimLessFitCandidates(candidateSet);
|
|
|
|
|
|
|
|
// Any remaining multiples all have the same distance. A common case of this
|
|
|
|
// occurs when no ideal is specified. Lean toward defaults.
|
2015-09-03 19:07:45 +00:00
|
|
|
uint32_t sameDistance = candidateSet[0].mDistance;
|
2015-02-20 22:06:26 +00:00
|
|
|
{
|
|
|
|
MediaTrackConstraintSet prefs;
|
|
|
|
prefs.mWidth.SetAsLong() = aPrefs.GetWidth();
|
|
|
|
prefs.mHeight.SetAsLong() = aPrefs.GetHeight();
|
2015-04-08 16:07:37 +00:00
|
|
|
prefs.mFrameRate.SetAsDouble() = aPrefs.mFPS;
|
2015-02-20 22:06:26 +00:00
|
|
|
|
|
|
|
for (auto& candidate : candidateSet) {
|
|
|
|
webrtc::CaptureCapability cap;
|
|
|
|
GetCapability(candidate.mIndex, cap);
|
2015-07-02 22:01:52 +00:00
|
|
|
candidate.mDistance = GetFitnessDistance(cap, prefs, false, aDeviceId);
|
2015-02-18 18:06:01 +00:00
|
|
|
}
|
2015-02-20 22:06:26 +00:00
|
|
|
TrimLessFitCandidates(candidateSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Any remaining multiples all have the same distance, but may vary on
|
|
|
|
// format. Some formats are more desirable for certain use like WebRTC.
|
|
|
|
// E.g. I420 over RGB24 can remove a needless format conversion.
|
|
|
|
|
|
|
|
bool found = false;
|
|
|
|
for (auto& candidate : candidateSet) {
|
|
|
|
webrtc::CaptureCapability cap;
|
|
|
|
GetCapability(candidate.mIndex, cap);
|
|
|
|
if (cap.rawType == webrtc::RawVideoType::kVideoI420 ||
|
|
|
|
cap.rawType == webrtc::RawVideoType::kVideoYUY2 ||
|
|
|
|
cap.rawType == webrtc::RawVideoType::kVideoYV12) {
|
|
|
|
mCapability = cap;
|
|
|
|
found = true;
|
|
|
|
break;
|
2014-10-13 03:37:37 +00:00
|
|
|
}
|
|
|
|
}
|
2015-02-20 22:06:26 +00:00
|
|
|
if (!found) {
|
|
|
|
GetCapability(candidateSet[0].mIndex, mCapability);
|
|
|
|
}
|
|
|
|
|
2015-09-03 19:07:45 +00:00
|
|
|
LogCapability("Chosen capability", mCapability, sameDistance);
|
2015-02-20 22:06:26 +00:00
|
|
|
return true;
|
2014-10-13 03:37:37 +00:00
|
|
|
}
|
|
|
|
|
2015-06-18 15:46:36 +00:00
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::SetName(nsString aName)
|
|
|
|
{
|
|
|
|
mDeviceName = aName;
|
|
|
|
bool hasFacingMode = false;
|
|
|
|
VideoFacingModeEnum facingMode = VideoFacingModeEnum::User;
|
|
|
|
|
|
|
|
// Set facing mode based on device name.
|
|
|
|
#if defined(MOZ_B2G_CAMERA) && defined(MOZ_WIDGET_GONK)
|
|
|
|
if (aName.EqualsLiteral("back")) {
|
|
|
|
hasFacingMode = true;
|
|
|
|
facingMode = VideoFacingModeEnum::Environment;
|
|
|
|
} else if (aName.EqualsLiteral("front")) {
|
|
|
|
hasFacingMode = true;
|
|
|
|
facingMode = VideoFacingModeEnum::User;
|
|
|
|
}
|
|
|
|
#endif // MOZ_B2G_CAMERA
|
|
|
|
#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
|
|
|
|
// Names are generated. Example: "Camera 0, Facing back, Orientation 90"
|
|
|
|
//
|
|
|
|
// See media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/
|
|
|
|
// webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java
|
|
|
|
|
|
|
|
if (aName.Find(NS_LITERAL_STRING("Facing back")) != kNotFound) {
|
|
|
|
hasFacingMode = true;
|
|
|
|
facingMode = VideoFacingModeEnum::Environment;
|
|
|
|
} else if (aName.Find(NS_LITERAL_STRING("Facing front")) != kNotFound) {
|
|
|
|
hasFacingMode = true;
|
|
|
|
facingMode = VideoFacingModeEnum::User;
|
|
|
|
}
|
|
|
|
#endif // ANDROID
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
// Kludge to test user-facing cameras on OSX.
|
|
|
|
if (aName.Find(NS_LITERAL_STRING("Face")) != -1) {
|
|
|
|
hasFacingMode = true;
|
|
|
|
facingMode = VideoFacingModeEnum::User;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (hasFacingMode) {
|
|
|
|
mFacingMode.Assign(NS_ConvertUTF8toUTF16(
|
|
|
|
VideoFacingModeEnumValues::strings[uint32_t(facingMode)].value));
|
|
|
|
} else {
|
|
|
|
mFacingMode.Truncate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-13 03:37:37 +00:00
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::GetName(nsAString& aName)
|
|
|
|
{
|
|
|
|
aName = mDeviceName;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2015-06-18 15:46:36 +00:00
|
|
|
MediaEngineCameraVideoSource::SetUUID(const char* aUUID)
|
|
|
|
{
|
|
|
|
mUniqueId.Assign(aUUID);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::GetUUID(nsACString& aUUID)
|
2014-10-13 03:37:37 +00:00
|
|
|
{
|
|
|
|
aUUID = mUniqueId;
|
|
|
|
}
|
|
|
|
|
2015-06-18 15:46:36 +00:00
|
|
|
const nsCString&
|
|
|
|
MediaEngineCameraVideoSource::GetUUID()
|
|
|
|
{
|
|
|
|
return mUniqueId;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-13 03:37:37 +00:00
|
|
|
void
|
|
|
|
MediaEngineCameraVideoSource::SetDirectListeners(bool aHasDirectListeners)
|
|
|
|
{
|
|
|
|
LOG((__FUNCTION__));
|
|
|
|
mHasDirectListeners = aHasDirectListeners;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace mozilla
|