diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index b82c2cda775..74bbe06fe05 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -89,8 +89,6 @@ public: mStream = aStream; mAudioSource = aAudioSource; mVideoSource = aVideoSource; - mLastEndTimeAudio = 0; - mLastEndTimeVideo = 0; mStream->AddListener(this); } @@ -187,10 +185,10 @@ public: // Currently audio sources ignore NotifyPull, but they could // watch it especially for fake audio. if (mAudioSource) { - mAudioSource->NotifyPull(aGraph, mStream, kAudioTrack, aDesiredTime, mLastEndTimeAudio); + mAudioSource->NotifyPull(aGraph, mStream, kAudioTrack, aDesiredTime); } if (mVideoSource) { - mVideoSource->NotifyPull(aGraph, mStream, kVideoTrack, aDesiredTime, mLastEndTimeVideo); + mVideoSource->NotifyPull(aGraph, mStream, kVideoTrack, aDesiredTime); } } @@ -239,8 +237,6 @@ private: nsRefPtr mAudioSource; // threadsafe refcnt nsRefPtr mVideoSource; // threadsafe refcnt nsRefPtr mStream; // threadsafe refcnt - StreamTime mLastEndTimeAudio; - StreamTime mLastEndTimeVideo; bool mFinished; // Accessed from MainThread and MSG thread diff --git a/dom/media/webrtc/MediaEngine.h b/dom/media/webrtc/MediaEngine.h index cb62def6aad..b7c33405b9c 100644 --- a/dom/media/webrtc/MediaEngine.h +++ b/dom/media/webrtc/MediaEngine.h @@ -110,8 +110,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream *aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) = 0; + StreamTime aDesiredTime) = 0; /* Stop the device and release the corresponding MediaStream */ virtual nsresult Stop(SourceMediaStream *aSource, TrackID aID) = 0; diff --git a/dom/media/webrtc/MediaEngineDefault.cpp b/dom/media/webrtc/MediaEngineDefault.cpp index b0025a82ab8..bb0015da25b 100644 --- a/dom/media/webrtc/MediaEngineDefault.cpp +++ b/dom/media/webrtc/MediaEngineDefault.cpp @@ -244,8 +244,7 @@ void MediaEngineDefaultVideoSource::NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream *aSource, TrackID aID, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) + StreamTime aDesiredTime) { // AddTrack takes ownership of segment VideoSegment segment; @@ -264,9 +263,7 @@ MediaEngineDefaultVideoSource::NotifyPull(MediaStreamGraph* aGraph, segment.AppendFrame(image.forget(), delta, size); // This can fail if either a) we haven't added the track yet, or b) // we've removed or finished the track. - if (aSource->AppendToTrack(aID, &segment)) { - aLastEndTime = aDesiredTime; - } + aSource->AppendToTrack(aID, &segment); // Generate null data for fake tracks. if (mHasFakeTracks) { for (int i = 0; i < kFakeVideoTrackCount; ++i) { diff --git a/dom/media/webrtc/MediaEngineDefault.h b/dom/media/webrtc/MediaEngineDefault.h index e64863855f6..efb6b05eb78 100644 --- a/dom/media/webrtc/MediaEngineDefault.h +++ b/dom/media/webrtc/MediaEngineDefault.h @@ -53,8 +53,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream *aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime); + StreamTime aDesiredTime) MOZ_OVERRIDE; virtual bool SatisfiesConstraintSets( const nsTArray& aConstraintSets) { @@ -122,8 +121,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream *aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) {} + StreamTime aDesiredTime) MOZ_OVERRIDE {} virtual bool IsFake() { return true; diff --git a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp index be01b334396..b204f19858f 100644 --- a/dom/media/webrtc/MediaEngineGonkVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineGonkVideoSource.cpp @@ -70,8 +70,7 @@ void MediaEngineGonkVideoSource::NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream* aSource, TrackID aID, - StreamTime aDesiredTime, - StreamTime& aLastEndTime) + StreamTime aDesiredTime) { VideoSegment segment; diff --git a/dom/media/webrtc/MediaEngineGonkVideoSource.h b/dom/media/webrtc/MediaEngineGonkVideoSource.h index 2d361705b8d..c03a9d4a049 100644 --- a/dom/media/webrtc/MediaEngineGonkVideoSource.h +++ b/dom/media/webrtc/MediaEngineGonkVideoSource.h @@ -68,8 +68,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream* aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) MOZ_OVERRIDE; + StreamTime aDesiredTime) MOZ_OVERRIDE; virtual bool SatisfiesConstraintSets( const nsTArray& aConstraintSets) { diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.cpp b/dom/media/webrtc/MediaEngineTabVideoSource.cpp index 2519a12fda7..32fb303df0d 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp +++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp @@ -192,8 +192,7 @@ MediaEngineTabVideoSource::Start(SourceMediaStream* aStream, TrackID aID) void MediaEngineTabVideoSource::NotifyPull(MediaStreamGraph*, SourceMediaStream* aSource, - TrackID aID, StreamTime aDesiredTime, - StreamTime& aLastEndTime) + TrackID aID, StreamTime aDesiredTime) { VideoSegment segment; MonitorAutoLock mon(mMonitor); @@ -207,9 +206,7 @@ MediaEngineTabVideoSource::NotifyPull(MediaStreamGraph*, segment.AppendFrame(image.forget().downcast(), delta, size); // This can fail if either a) we haven't added the track yet, or b) // we've removed or finished the track. - if (aSource->AppendToTrack(aID, &(segment))) { - aLastEndTime = aDesiredTime; - } + aSource->AppendToTrack(aID, &(segment)); } } diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.h b/dom/media/webrtc/MediaEngineTabVideoSource.h index 6820788663f..ae4b3abb979 100644 --- a/dom/media/webrtc/MediaEngineTabVideoSource.h +++ b/dom/media/webrtc/MediaEngineTabVideoSource.h @@ -25,7 +25,7 @@ class MediaEngineTabVideoSource : public MediaEngineVideoSource, nsIDOMEventList virtual nsresult Deallocate(); virtual nsresult Start(mozilla::SourceMediaStream*, mozilla::TrackID); virtual void SetDirectListeners(bool aHasDirectListeners) {}; - virtual void NotifyPull(mozilla::MediaStreamGraph*, mozilla::SourceMediaStream*, mozilla::TrackID, mozilla::StreamTime, mozilla::StreamTime&); + virtual void NotifyPull(mozilla::MediaStreamGraph*, mozilla::SourceMediaStream*, mozilla::TrackID, mozilla::StreamTime) MOZ_OVERRIDE; virtual nsresult Stop(mozilla::SourceMediaStream*, mozilla::TrackID); virtual nsresult Config(bool, uint32_t, bool, uint32_t, bool, uint32_t, int32_t); virtual bool IsFake(); diff --git a/dom/media/webrtc/MediaEngineWebRTC.h b/dom/media/webrtc/MediaEngineWebRTC.h index 0954380e247..7ebb9d99992 100644 --- a/dom/media/webrtc/MediaEngineWebRTC.h +++ b/dom/media/webrtc/MediaEngineWebRTC.h @@ -97,8 +97,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream* aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime); + StreamTime aDesiredTime) MOZ_OVERRIDE; virtual const MediaSourceType GetMediaSource() { return mMediaSource; @@ -180,8 +179,7 @@ public: virtual void NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream* aSource, TrackID aId, - StreamTime aDesiredTime, - StreamTime &aLastEndTime); + StreamTime aDesiredTime) MOZ_OVERRIDE; virtual bool IsFake() { return false; diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index b95fea5641b..ba5378ab966 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -398,16 +398,10 @@ void MediaEngineWebRTCAudioSource::NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream *aSource, TrackID aID, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) + StreamTime aDesiredTime) { // Ignore - we push audio data -#ifdef DEBUG - StreamTime delta = aDesiredTime - aLastEndTime; - LOG(("Audio: NotifyPull: aDesiredTime %ld, delta %ld",(int64_t) aDesiredTime, - (int64_t) delta)); - aLastEndTime = aDesiredTime; -#endif + LOG_FRAMES(("NotifyPull, desired = %ld", (int64_t) aDesiredTime)); } void diff --git a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp index 7558557e4f5..b2c73861c51 100644 --- a/dom/media/webrtc/MediaEngineWebRTCVideo.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCVideo.cpp @@ -124,8 +124,7 @@ void MediaEngineWebRTCVideoSource::NotifyPull(MediaStreamGraph* aGraph, SourceMediaStream* aSource, TrackID aID, - StreamTime aDesiredTime, - StreamTime &aLastEndTime) + StreamTime aDesiredTime) { VideoSegment segment; @@ -150,9 +149,7 @@ MediaEngineWebRTCVideoSource::NotifyPull(MediaStreamGraph* aGraph, // Doing so means a negative delta and thus messes up handling of the graph if (delta > 0) { // nullptr images are allowed - if (AppendToTrack(aSource, mImage, aID, delta)) { - aLastEndTime = aDesiredTime; - } + AppendToTrack(aSource, mImage, aID, delta); } }