diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index ed1a41bde28f..e7f20217ff63 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -3124,12 +3124,11 @@ private: }; class HTMLMediaElement::MediaStreamTracksAvailableCallback: - public DOMMediaStream::OnTracksAvailableCallback + public OnTracksAvailableCallback { public: explicit MediaStreamTracksAvailableCallback(HTMLMediaElement* aElement): - DOMMediaStream::OnTracksAvailableCallback(), - mElement(aElement) + OnTracksAvailableCallback(), mElement(aElement) {} virtual void NotifyTracksAvailable(DOMMediaStream* aStream) { diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 00e1d905730e..b7366171c176 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -33,6 +33,7 @@ namespace mozilla { class DOMHwMediaStream; class DOMLocalMediaStream; +class DOMMediaStream; class MediaStream; class MediaEngineSource; class MediaInputPort; @@ -64,6 +65,12 @@ class MediaStreamDirectListener; { 0x8cb65468, 0x66c0, 0x444e, \ { 0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c } } +class OnTracksAvailableCallback { +public: + virtual ~OnTracksAvailableCallback() {} + virtual void NotifyTracksAvailable(DOMMediaStream* aStream) = 0; +}; + /** * DOM wrapper for MediaStreams. * @@ -478,11 +485,6 @@ public: */ MediaStreamTrack* CreateOwnDOMTrack(TrackID aTrackID, MediaSegment::Type aType, const nsString& aLabel); - class OnTracksAvailableCallback { - public: - virtual ~OnTracksAvailableCallback() {} - virtual void NotifyTracksAvailable(DOMMediaStream* aStream) = 0; - }; // When the initial set of tracks has been added, run // aCallback->NotifyTracksAvailable. // It is allowed to do anything, including run script. diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 40f76a04c5df..5ac5bd8455f1 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -251,7 +251,7 @@ public: MediaOperationTask(MediaOperation aType, GetUserMediaCallbackMediaStreamListener* aListener, DOMMediaStream* aStream, - DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback, + OnTracksAvailableCallback* aOnTracksAvailableCallback, AudioDevice* aAudioDevice, VideoDevice* aVideoDevice, bool aBool, @@ -378,7 +378,7 @@ public: private: MediaOperation mType; RefPtr mStream; - nsAutoPtr mOnTracksAvailableCallback; + nsAutoPtr mOnTracksAvailableCallback; RefPtr mAudioDevice; // threadsafe RefPtr mVideoDevice; // threadsafe RefPtr mListener; // threadsafe @@ -886,7 +886,7 @@ public: ~GetUserMediaStreamRunnable() {} - class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback + class TracksAvailableCallback : public OnTracksAvailableCallback { public: TracksAvailableCallback(MediaManager* aManager, diff --git a/dom/media/MediaManager.h b/dom/media/MediaManager.h index fbc9891c2e3f..ac0dd422ea4e 100644 --- a/dom/media/MediaManager.h +++ b/dom/media/MediaManager.h @@ -350,7 +350,7 @@ class GetUserMediaNotificationEvent: public nsRunnable GetUserMediaNotificationEvent(GetUserMediaStatus aStatus, already_AddRefed aStream, - DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback, + OnTracksAvailableCallback* aOnTracksAvailableCallback, bool aIsAudio, bool aIsVideo, uint64_t aWindowID, already_AddRefed aError) : mStream(aStream), mOnTracksAvailableCallback(aOnTracksAvailableCallback), @@ -366,7 +366,7 @@ class GetUserMediaNotificationEvent: public nsRunnable protected: RefPtr mListener; // threadsafe RefPtr mStream; - nsAutoPtr mOnTracksAvailableCallback; + nsAutoPtr mOnTracksAvailableCallback; GetUserMediaStatus mStatus; bool mIsAudio; bool mIsVideo; @@ -388,13 +388,13 @@ class ReleaseMediaOperationResource : public nsRunnable { public: ReleaseMediaOperationResource(already_AddRefed aStream, - DOMMediaStream::OnTracksAvailableCallback* aOnTracksAvailableCallback): + OnTracksAvailableCallback* aOnTracksAvailableCallback): mStream(aStream), mOnTracksAvailableCallback(aOnTracksAvailableCallback) {} NS_IMETHOD Run() override {return NS_OK;} private: RefPtr mStream; - nsAutoPtr mOnTracksAvailableCallback; + nsAutoPtr mOnTracksAvailableCallback; }; typedef nsTArray > StreamListeners; diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index c2ed36a57f75..f699cc3a5566 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -288,7 +288,7 @@ class MediaRecorder::Session: public nsIObserver }; // For Ensure recorder has tracks to record. - class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback + class TracksAvailableCallback : public OnTracksAvailableCallback { public: explicit TracksAvailableCallback(Session *aSession) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp index e17f510d3a71..8326c601d410 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp @@ -172,14 +172,14 @@ private: } #if !defined(MOZILLA_EXTERNAL_LINKAGE) -class TracksAvailableCallback : public DOMMediaStream::OnTracksAvailableCallback +class TracksAvailableCallback : public OnTracksAvailableCallback { public: TracksAvailableCallback(size_t numNewAudioTracks, size_t numNewVideoTracks, const std::string& pcHandle, RefPtr aObserver) - : DOMMediaStream::OnTracksAvailableCallback() + : OnTracksAvailableCallback() , mObserver(aObserver) , mPcHandle(pcHandle) {}