зеркало из https://github.com/mozilla/gecko-dev.git
Bug 886891: Don't show recording indicator when using fake sources r=jesup
This commit is contained in:
Родитель
97ebf79d0c
Коммит
8a3f1d02db
|
@ -101,6 +101,11 @@ public:
|
||||||
bool aAgcOn, uint32_t aAGC,
|
bool aAgcOn, uint32_t aAGC,
|
||||||
bool aNoiseOn, uint32_t aNoise) = 0;
|
bool aNoiseOn, uint32_t aNoise) = 0;
|
||||||
|
|
||||||
|
/* Returns true if a source represents a fake capture device and
|
||||||
|
* false otherwise
|
||||||
|
*/
|
||||||
|
virtual bool IsFake() = 0;
|
||||||
|
|
||||||
/* Return false if device is currently allocated or started */
|
/* Return false if device is currently allocated or started */
|
||||||
bool IsAvailable() {
|
bool IsAvailable() {
|
||||||
if (mState == kAllocated || mState == kStarted) {
|
if (mState == kAllocated || mState == kStarted) {
|
||||||
|
|
|
@ -55,6 +55,10 @@ public:
|
||||||
StreamTime aDesiredTime,
|
StreamTime aDesiredTime,
|
||||||
TrackTicks &aLastEndTime) {}
|
TrackTicks &aLastEndTime) {}
|
||||||
|
|
||||||
|
virtual bool IsFake() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSITIMERCALLBACK
|
NS_DECL_NSITIMERCALLBACK
|
||||||
|
|
||||||
|
@ -97,6 +101,10 @@ public:
|
||||||
StreamTime aDesiredTime,
|
StreamTime aDesiredTime,
|
||||||
TrackTicks &aLastEndTime) {}
|
TrackTicks &aLastEndTime) {}
|
||||||
|
|
||||||
|
virtual bool IsFake() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
NS_DECL_NSITIMERCALLBACK
|
NS_DECL_NSITIMERCALLBACK
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,10 @@ public:
|
||||||
StreamTime aDesiredTime,
|
StreamTime aDesiredTime,
|
||||||
TrackTicks &aLastEndTime);
|
TrackTicks &aLastEndTime);
|
||||||
|
|
||||||
|
virtual bool IsFake() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
#ifdef MOZ_B2G_CAMERA
|
#ifdef MOZ_B2G_CAMERA
|
||||||
NS_DECL_NSICAMERAGETCAMERACALLBACK
|
NS_DECL_NSICAMERAGETCAMERACALLBACK
|
||||||
|
@ -292,6 +296,10 @@ public:
|
||||||
StreamTime aDesiredTime,
|
StreamTime aDesiredTime,
|
||||||
TrackTicks &aLastEndTime);
|
TrackTicks &aLastEndTime);
|
||||||
|
|
||||||
|
virtual bool IsFake() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// VoEMediaProcess.
|
// VoEMediaProcess.
|
||||||
void Process(const int channel, const webrtc::ProcessingTypes type,
|
void Process(const int channel, const webrtc::ProcessingTypes type,
|
||||||
WebRtc_Word16 audio10ms[], const int length,
|
WebRtc_Word16 audio10ms[], const int length,
|
||||||
|
|
|
@ -92,16 +92,17 @@ public:
|
||||||
return mStream->AsSourceStream();
|
return mStream->AsSourceStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
// mVideo/AudioSource are set by Activate(), so we assume they're capturing if set
|
// mVideo/AudioSource are set by Activate(), so we assume they're capturing
|
||||||
|
// if set and represent a real capture device.
|
||||||
bool CapturingVideo()
|
bool CapturingVideo()
|
||||||
{
|
{
|
||||||
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
|
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
|
||||||
return mVideoSource && !mStopped;
|
return mVideoSource && !mVideoSource->IsFake() && !mStopped;
|
||||||
}
|
}
|
||||||
bool CapturingAudio()
|
bool CapturingAudio()
|
||||||
{
|
{
|
||||||
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
|
NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
|
||||||
return mAudioSource && !mStopped;
|
return mAudioSource && !mAudioSource->IsFake() && !mStopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetStopped()
|
void SetStopped()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче