diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp index c337de74a946..4d5c90037464 100644 --- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -2205,7 +2205,6 @@ public: explicit StreamCaptureTrackSource(MediaStreamTrackSource* aCapturedTrackSource) : MediaStreamTrackSource(aCapturedTrackSource->GetPrincipal(), - true, nsString()) , mCapturedTrackSource(aCapturedTrackSource) { @@ -2239,6 +2238,7 @@ public: void Stop() override { + // XXX fix in later patch NS_ERROR("We're reporting remote=true to not be stoppable. " "Stop() should not be called."); } @@ -2276,7 +2276,6 @@ public: explicit DecoderCaptureTrackSource(HTMLMediaElement* aElement) : MediaStreamTrackSource(nsCOMPtr(aElement->GetCurrentPrincipal()).get(), - true, nsString()) , mElement(aElement) { @@ -2315,6 +2314,7 @@ public: void Stop() override { + // XXX Fix in later patch. NS_ERROR("We're reporting remote=true to not be stoppable. " "Stop() should not be called."); } diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 76b46e492e9a..931f1158823f 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -1170,7 +1170,7 @@ public: const MediaSourceEnum aSource, const TrackID aTrackID, const PeerIdentity* aPeerIdentity) - : MediaStreamTrackSource(aPrincipal, false, aLabel), mListener(aListener), + : MediaStreamTrackSource(aPrincipal, aLabel), mListener(aListener), mSource(aSource), mTrackID(aTrackID), mPeerIdentity(aPeerIdentity) {} MediaSourceEnum GetMediaSource() const override diff --git a/dom/media/MediaStreamTrack.cpp b/dom/media/MediaStreamTrack.cpp index ea34789d5ebe..8ccdeb90cea8 100644 --- a/dom/media/MediaStreamTrack.cpp +++ b/dom/media/MediaStreamTrack.cpp @@ -124,8 +124,7 @@ MediaStreamTrack::MediaStreamTrack(DOMMediaStream* aStream, TrackID aTrackID, mInputTrackID(aInputTrackID), mSource(aSource), mPrincipal(aSource->GetPrincipal()), mReadyState(MediaStreamTrackState::Live), - mEnabled(true), mRemote(aSource->IsRemote()), - mConstraints(aConstraints) + mEnabled(true), mConstraints(aConstraints) { GetSource().RegisterSink(this); @@ -236,11 +235,6 @@ MediaStreamTrack::Stop() return; } - if (mRemote) { - LOG(LogLevel::Warning, ("MediaStreamTrack %p is remote. Can't be stopped.", this)); - return; - } - if (!mSource) { MOZ_ASSERT(false); return; diff --git a/dom/media/MediaStreamTrack.h b/dom/media/MediaStreamTrack.h index fd8b88b54a74..5ba5b435add7 100644 --- a/dom/media/MediaStreamTrack.h +++ b/dom/media/MediaStreamTrack.h @@ -61,10 +61,8 @@ public: }; MediaStreamTrackSource(nsIPrincipal* aPrincipal, - const bool aIsRemote, const nsString& aLabel) : mPrincipal(aPrincipal), - mIsRemote(aIsRemote), mLabel(aLabel), mStopped(false) { @@ -106,12 +104,6 @@ public: */ virtual const PeerIdentity* GetPeerIdentity() const { return nullptr; } - /** - * Indicates whether the track is remote or not per the MediaCapture and - * Streams spec. - */ - virtual bool IsRemote() const { return mIsRemote; } - /** * MediaStreamTrack::GetLabel (see spec) calls through to here. */ @@ -164,7 +156,7 @@ public: void UnregisterSink(Sink* aSink) { MOZ_ASSERT(NS_IsMainThread()); - if (mSinks.RemoveElement(aSink) && mSinks.IsEmpty() && !IsRemote()) { + if (mSinks.RemoveElement(aSink) && mSinks.IsEmpty()) { Stop(); mStopped = true; } @@ -193,14 +185,11 @@ protected: // Currently registered sinks. nsTArray mSinks; - // True if this is a remote track source, i.e., a PeerConnection. - const bool mIsRemote; - // The label of the track we are the source of per the MediaStreamTrack spec. const nsString mLabel; - // True if this source is not remote, all MediaStreamTrack users have - // unregistered from this source and Stop() has been called. + // True if all MediaStreamTrack users have unregistered from this source and + // Stop() has been called. bool mStopped; }; @@ -213,14 +202,13 @@ public: explicit BasicUnstoppableTrackSource(nsIPrincipal* aPrincipal, const MediaSourceEnum aMediaSource = MediaSourceEnum::Other) - : MediaStreamTrackSource(aPrincipal, true, nsString()) + : MediaStreamTrackSource(aPrincipal, nsString()) , mMediaSource(aMediaSource) {} MediaSourceEnum GetMediaSource() const override { return mMediaSource; } - void - GetSettings(dom::MediaTrackSettings& aResult) override {} + void GetSettings(dom::MediaTrackSettings& aResult) override {} void Stop() override {} @@ -485,7 +473,6 @@ protected: nsString mID; MediaStreamTrackState mReadyState; bool mEnabled; - const bool mRemote; dom::MediaTrackConstraints mConstraints; }; diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h index 35a6205f4098..4d5dd63bbec3 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h @@ -161,7 +161,7 @@ class RemoteTrackSource : public dom::MediaStreamTrackSource { public: explicit RemoteTrackSource(nsIPrincipal* aPrincipal, const nsString& aLabel) - : dom::MediaStreamTrackSource(aPrincipal, true, aLabel) {} + : dom::MediaStreamTrackSource(aPrincipal, aLabel) {} dom::MediaSourceEnum GetMediaSource() const override { @@ -172,7 +172,11 @@ public: ApplyConstraints(nsPIDOMWindowInner* aWindow, const dom::MediaTrackConstraints& aConstraints) override; - void Stop() override { NS_ERROR("Can't stop a remote source!"); } + void Stop() override + { + // XXX Fix in later patch. + NS_ERROR("Can't stop a remote source!"); + } void SetPrincipal(nsIPrincipal* aPrincipal) {