2013-03-27 05:32:51 +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
|
|
|
|
* 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 "AudioStreamTrack.h"
|
|
|
|
|
2019-10-02 11:46:23 +03:00
|
|
|
#include "MediaStreamGraph.h"
|
2017-10-13 06:57:25 +03:00
|
|
|
#include "nsContentUtils.h"
|
|
|
|
|
2013-03-27 05:32:51 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2019-07-31 10:58:17 +03:00
|
|
|
void AudioStreamTrack::AddAudioOutput(void* aKey) {
|
|
|
|
if (Ended()) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-02 11:46:23 +03:00
|
|
|
mStream->AddAudioOutput(aKey);
|
2019-07-31 10:58:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void AudioStreamTrack::RemoveAudioOutput(void* aKey) {
|
|
|
|
if (Ended()) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-02 11:46:23 +03:00
|
|
|
mStream->RemoveAudioOutput(aKey);
|
2019-07-31 10:58:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void AudioStreamTrack::SetAudioOutputVolume(void* aKey, float aVolume) {
|
|
|
|
if (Ended()) {
|
|
|
|
return;
|
|
|
|
}
|
2019-10-02 11:46:23 +03:00
|
|
|
mStream->SetAudioOutputVolume(aKey, aVolume);
|
2019-07-31 10:58:17 +03:00
|
|
|
}
|
|
|
|
|
2017-10-13 06:57:25 +03:00
|
|
|
void AudioStreamTrack::GetLabel(nsAString& aLabel, CallerType aCallerType) {
|
|
|
|
if (nsContentUtils::ResistFingerprinting(aCallerType)) {
|
|
|
|
aLabel.AssignLiteral("Internal Microphone");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
MediaStreamTrack::GetLabel(aLabel, aCallerType);
|
|
|
|
}
|
|
|
|
|
2019-08-19 22:26:25 +03:00
|
|
|
already_AddRefed<MediaStreamTrack> AudioStreamTrack::CloneInternal() {
|
2019-10-02 11:46:23 +03:00
|
|
|
return do_AddRef(new AudioStreamTrack(mWindow, mInputStream, mTrackID,
|
|
|
|
mSource, ReadyState(), mConstraints));
|
2019-08-19 22:26:25 +03:00
|
|
|
}
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|