mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
Bug 1219711 - Let fake stream take precedence in testing. r=jib
TL;DR requesting a fake stream always gives you a fake stream. No magic. The gUMConstraint `fake: true` should take precedence and if set always use MediaEngineDefault. If it is set the state of `faketracks` is passed on to MediaEngineDefault. If it is not set, but (any of) audio/video loopback devices are set, the device enumeration will filter out only those. --HG-- extra : commitid : IGZfna954PV extra : rebase_source : e9b5f69c176f6987ab6b0f9081147330a2bf87ad
This commit is contained in:
parent
62ceff0f0e
commit
4a2ca8f712
@ -1415,25 +1415,22 @@ MediaManager::EnumerateRawDevices(uint64_t aWindowId,
|
||||
RefPtr<PledgeSourceSet> p = new PledgeSourceSet();
|
||||
uint32_t id = mOutstandingPledges.Append(*p);
|
||||
|
||||
// Check if the preference for using audio/video loopback devices is
|
||||
// enabled. This is currently used for automated media tests only.
|
||||
//
|
||||
// If present (and we're doing non-exotic cameras and microphones) use them
|
||||
// instead of our built-in fake devices, except if fake tracks are requested
|
||||
// (a feature of the built-in ones only).
|
||||
|
||||
nsAdoptingCString audioLoopDev, videoLoopDev;
|
||||
if (!aFakeTracks) {
|
||||
if (aVideoType == dom::MediaSourceEnum::Camera) {
|
||||
audioLoopDev = Preferences::GetCString("media.audio_loopback_dev");
|
||||
if (!aFake) {
|
||||
// Fake stream not requested. The entire device stack is available.
|
||||
// Loop in loopback devices if they are set, and their respective type is
|
||||
// requested. This is currently used for automated media tests only.
|
||||
if (aVideoType == MediaSourceEnum::Camera) {
|
||||
videoLoopDev = Preferences::GetCString("media.video_loopback_dev");
|
||||
|
||||
if (aFake && !audioLoopDev.IsEmpty() && !videoLoopDev.IsEmpty()) {
|
||||
aFake = false;
|
||||
}
|
||||
} else {
|
||||
aFake = false;
|
||||
}
|
||||
if (aAudioType == MediaSourceEnum::Microphone) {
|
||||
audioLoopDev = Preferences::GetCString("media.audio_loopback_dev");
|
||||
}
|
||||
}
|
||||
|
||||
if (!aFake) {
|
||||
// Fake tracks only make sense when we have a fake stream.
|
||||
aFakeTracks = false;
|
||||
}
|
||||
|
||||
MediaManager::PostTask(FROM_HERE, NewTaskFrom([id, aWindowId, audioLoopDev,
|
||||
|
@ -59,7 +59,7 @@
|
||||
var playback = new LocalMediaStreamPlayback(testVideo, stream);
|
||||
return playback.playMediaWithDeprecatedStreamStop(false);
|
||||
})
|
||||
.then(() => getUserMedia({video: videoConstraints[0]}))
|
||||
.then(() => getUserMedia({video: videoConstraints[0], fake: false}))
|
||||
.then(stream => {
|
||||
var playback = new LocalMediaStreamPlayback(testVideo, stream);
|
||||
playback.startMedia(false);
|
||||
|
Loading…
Reference in New Issue
Block a user