Backed out 2 changesets (bug 1571705) for causing liux debug gtest asertion failures CLOSED TREE

Backed out changeset 3d33cae2d9f9 (bug 1571705)
Backed out changeset decff7a230b7 (bug 1571705)
This commit is contained in:
Ciure Andrei 2019-08-19 19:48:25 +03:00
Родитель 6924e0a5d3
Коммит 2443b6b31a
8 изменённых файлов: 29 добавлений и 47 удалений

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

@ -40,10 +40,5 @@ void AudioStreamTrack::GetLabel(nsAString& aLabel, CallerType aCallerType) {
MediaStreamTrack::GetLabel(aLabel, aCallerType);
}
already_AddRefed<MediaStreamTrack> AudioStreamTrack::CloneInternal() {
return do_AddRef(new AudioStreamTrack(mWindow, mInputStream, mTrackID,
mSource, ReadyState(), mConstraints));
}
} // namespace dom
} // namespace mozilla

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

@ -17,9 +17,8 @@ class AudioStreamTrack : public MediaStreamTrack {
AudioStreamTrack(
nsPIDOMWindowInner* aWindow, MediaStream* aInputStream, TrackID aTrackID,
MediaStreamTrackSource* aSource,
MediaStreamTrackState aReadyState = MediaStreamTrackState::Live,
const MediaTrackConstraints& aConstraints = MediaTrackConstraints())
: MediaStreamTrack(aWindow, aInputStream, aTrackID, aSource, aReadyState,
: MediaStreamTrack(aWindow, aInputStream, aTrackID, aSource,
aConstraints) {}
AudioStreamTrack* AsAudioStreamTrack() override { return this; }
@ -35,7 +34,11 @@ class AudioStreamTrack : public MediaStreamTrack {
void GetLabel(nsAString& aLabel, CallerType aCallerType) override;
protected:
already_AddRefed<MediaStreamTrack> CloneInternal() override;
already_AddRefed<MediaStreamTrack> CloneInternal() override {
return do_AddRef(
new AudioStreamTrack(mWindow, Ended() ? nullptr : mInputStream.get(),
mTrackID, mSource, mConstraints));
}
};
} // namespace dom

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

@ -1180,7 +1180,6 @@ class GetUserMediaStreamRunnable : public Runnable {
MOZ_ASSERT(IsOn(mConstraints.mAudio));
RefPtr<MediaStreamTrack> track = new dom::AudioStreamTrack(
window, stream, kAudioTrack, audioTrackSource,
dom::MediaStreamTrackState::Live,
GetInvariant(mConstraints.mAudio));
domStream->AddTrackInternal(track);
}
@ -1194,7 +1193,6 @@ class GetUserMediaStreamRunnable : public Runnable {
MOZ_ASSERT(IsOn(mConstraints.mVideo));
RefPtr<MediaStreamTrack> track = new dom::VideoStreamTrack(
window, stream, kVideoTrack, videoTrackSource,
dom::MediaStreamTrackState::Live,
GetInvariant(mConstraints.mVideo));
domStream->AddTrackInternal(track);
switch (mVideoDevice->GetMediaSource()) {

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

@ -2959,11 +2959,8 @@ bool SourceMediaStream::HasPendingAudioTrack() {
void MediaInputPort::Init() {
LOG(LogLevel::Debug, ("%p: Adding MediaInputPort %p (from %p to %p)",
mSource->GraphImpl(), this, mSource, mDest));
// Only connect the port if it wasn't disconnected on allocation.
if (mSource) {
mSource->AddConsumer(this);
mDest->AddInput(this);
}
mSource->AddConsumer(this);
mDest->AddInput(this);
// mPortCount decremented via MediaInputPort::Destroy's message
++mDest->GraphImpl()->mPortCount;
}
@ -3107,6 +3104,7 @@ already_AddRefed<MediaInputPort> ProcessedMediaStream::AllocateInputPort(
RefPtr<MediaInputPort> mPort;
};
MOZ_ASSERT(aStream->GraphImpl() == GraphImpl());
MOZ_ASSERT(aTrackID == TRACK_ANY || IsTrackIDExplicit(aTrackID),
"Only TRACK_ANY and explicit ID are allowed for source track");
MOZ_ASSERT(
@ -3115,18 +3113,8 @@ already_AddRefed<MediaInputPort> ProcessedMediaStream::AllocateInputPort(
MOZ_ASSERT(
aTrackID != TRACK_ANY || aDestTrackID == TRACK_ANY,
"Generic MediaInputPort cannot produce a single destination track");
RefPtr<MediaInputPort> port;
if (aStream->IsDestroyed()) {
// Create a port that's disconnected, which is what it'd be after its source
// stream is Destroy()ed normally. Disconnect() is idempotent so destroying
// this later is fine.
port = new MediaInputPort(nullptr, aTrackID, nullptr, aDestTrackID,
aInputNumber, aOutputNumber);
} else {
MOZ_ASSERT(aStream->GraphImpl() == GraphImpl());
port = new MediaInputPort(aStream, aTrackID, this, aDestTrackID,
aInputNumber, aOutputNumber);
}
RefPtr<MediaInputPort> port = new MediaInputPort(
aStream, aTrackID, this, aDestTrackID, aInputNumber, aOutputNumber);
if (aBlockedTracks) {
for (TrackID trackID : *aBlockedTracks) {
port->BlockSourceTrackIdImpl(trackID, BlockingMode::CREATION);

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

@ -181,24 +181,22 @@ class MediaStreamTrack::TrackSink : public MediaStreamTrackSource::Sink {
MediaStreamTrack::MediaStreamTrack(nsPIDOMWindowInner* aWindow,
MediaStream* aInputStream, TrackID aTrackID,
MediaStreamTrackSource* aSource,
MediaStreamTrackState aReadyState,
const MediaTrackConstraints& aConstraints)
: mWindow(aWindow),
mInputStream(aInputStream),
mStream(aReadyState == MediaStreamTrackState::Live
? mInputStream->Graph()->CreateTrackUnionStream()
: nullptr),
mStream(mInputStream ? mInputStream->Graph()->CreateTrackUnionStream()
: nullptr),
mPort(mStream ? mStream->AllocateInputPort(mInputStream) : nullptr),
mTrackID(aTrackID),
mSource(aSource),
mSink(MakeUnique<TrackSink>(this)),
mPrincipal(aSource->GetPrincipal()),
mReadyState(aReadyState),
mReadyState(mStream ? MediaStreamTrackState::Live
: MediaStreamTrackState::Ended),
mEnabled(true),
mMuted(false),
mConstraints(aConstraints) {
if (!Ended()) {
MOZ_DIAGNOSTIC_ASSERT(!mInputStream->IsDestroyed());
GetSource().RegisterSink(mSink.get());
mMSGListener = new MSGListener(this);
@ -501,6 +499,7 @@ already_AddRefed<MediaStreamTrack> MediaStreamTrack::Clone() {
RefPtr<MediaStreamTrack> newTrack = CloneInternal();
newTrack->SetEnabled(Enabled());
newTrack->SetMuted(Muted());
MOZ_DIAGNOSTIC_ASSERT(newTrack->ReadyState() == ReadyState());
return newTrack.forget();
}
@ -604,7 +603,10 @@ already_AddRefed<MediaInputPort> MediaStreamTrack::ForwardTrackContentsTo(
ProcessedMediaStream* aStream) {
MOZ_ASSERT(NS_IsMainThread());
MOZ_RELEASE_ASSERT(aStream);
return aStream->AllocateInputPort(mStream, mTrackID, mTrackID);
MOZ_DIAGNOSTIC_ASSERT(!Ended());
RefPtr<MediaInputPort> port =
aStream->AllocateInputPort(mStream, mTrackID, mTrackID);
return port.forget();
}
} // namespace dom

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

@ -416,7 +416,6 @@ class MediaStreamTrack : public DOMEventTargetHelper,
MediaStreamTrack(
nsPIDOMWindowInner* aWindow, MediaStream* aInputStream, TrackID aTrackID,
MediaStreamTrackSource* aSource,
MediaStreamTrackState aReadyState = MediaStreamTrackState::Live,
const MediaTrackConstraints& aConstraints = MediaTrackConstraints());
NS_DECL_ISUPPORTS_INHERITED
@ -617,9 +616,9 @@ class MediaStreamTrack : public DOMEventTargetHelper,
// We need this to track our parent object.
nsCOMPtr<nsPIDOMWindowInner> mWindow;
// The input MediaStream assigned us by the data producer.
// The input MediaStream assigned us by the data producer. Valid until we end.
// Owned by the producer.
const RefPtr<MediaStream> mInputStream;
RefPtr<MediaStream> mInputStream;
// The MediaStream representing this MediaStreamTrack in the MediaStreamGraph.
// Valid until we end. Owned by us.
RefPtr<ProcessedMediaStream> mStream;

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

@ -17,10 +17,9 @@ namespace dom {
VideoStreamTrack::VideoStreamTrack(nsPIDOMWindowInner* aWindow,
MediaStream* aInputStream, TrackID aTrackID,
MediaStreamTrackSource* aSource,
MediaStreamTrackState aReadyState,
const MediaTrackConstraints& aConstraints)
: MediaStreamTrack(aWindow, aInputStream, aTrackID, aSource, aReadyState,
aConstraints) {}
: MediaStreamTrack(aWindow, aInputStream, aTrackID, aSource, aConstraints) {
}
void VideoStreamTrack::Destroy() {
mVideoOutputs.Clear();
@ -80,10 +79,5 @@ void VideoStreamTrack::GetLabel(nsAString& aLabel, CallerType aCallerType) {
MediaStreamTrack::GetLabel(aLabel, aCallerType);
}
already_AddRefed<MediaStreamTrack> VideoStreamTrack::CloneInternal() {
return do_AddRef(new VideoStreamTrack(mWindow, mInputStream, mTrackID,
mSource, ReadyState(), mConstraints));
}
} // namespace dom
} // namespace mozilla

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

@ -21,7 +21,6 @@ class VideoStreamTrack : public MediaStreamTrack {
VideoStreamTrack(
nsPIDOMWindowInner* aWindow, MediaStream* aInputStream, TrackID aTrackID,
MediaStreamTrackSource* aSource,
MediaStreamTrackState aState = MediaStreamTrackState::Live,
const MediaTrackConstraints& aConstraints = MediaTrackConstraints());
void Destroy() override;
@ -40,7 +39,11 @@ class VideoStreamTrack : public MediaStreamTrack {
void GetLabel(nsAString& aLabel, CallerType aCallerType) override;
protected:
already_AddRefed<MediaStreamTrack> CloneInternal() override;
already_AddRefed<MediaStreamTrack> CloneInternal() override {
return do_AddRef(
new VideoStreamTrack(mWindow, Ended() ? nullptr : mInputStream.get(),
mTrackID, mSource, mConstraints));
}
private:
nsTArray<RefPtr<VideoOutput>> mVideoOutputs;