Bug 886891: Don't show recording indicator when using fake sources r=jesup

This commit is contained in:
Suhas Nandakumar 2013-07-04 22:53:10 -07:00
Родитель 97ebf79d0c
Коммит 8a3f1d02db
4 изменённых файлов: 25 добавлений и 3 удалений

Просмотреть файл

@ -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()