Bug 1573102 - Remove mGraph from HTMLMediaElement::OutputMediaStream and OutputStreamManager. r=karlt

Differential Revision: https://phabricator.services.mozilla.com/D43666
This commit is contained in:
Andreas Pehrson
2019-08-29 13:32:50 +00:00
parent e50d387ec9
commit ee66e4c075
8 changed files with 21 additions and 17 deletions

View File

@@ -3304,13 +3304,14 @@ already_AddRefed<DOMMediaStream> HTMLMediaElement::CaptureStreamInternal(
MarkAsTainted();
// We don't support routing to a different graph.
if (!mOutputStreams.IsEmpty() && aGraph != mOutputStreams[0].mGraph) {
if (!mOutputStreams.IsEmpty() &&
aGraph !=
mOutputStreams[0].mGraphKeepAliveDummyStream->mStream->Graph()) {
return nullptr;
}
OutputMediaStream* out = mOutputStreams.AppendElement();
nsPIDOMWindowInner* window = OwnerDoc()->GetInnerWindow();
out->mGraph = static_cast<MediaStreamGraphImpl*>(aGraph);
out->mGraphKeepAliveDummyStream =
mOutputStreams.Length() == 1
? MakeRefPtr<SharedDummyStream>(aGraph->CreateSourceStream())
@@ -3338,7 +3339,8 @@ already_AddRefed<DOMMediaStream> HTMLMediaElement::CaptureStreamInternal(
if (mDecoder) {
out->mCapturingDecoder = true;
mDecoder->AddOutputStream(out->mStream, out->mGraph);
mDecoder->AddOutputStream(
out->mStream, out->mGraphKeepAliveDummyStream->mStream->Graph());
} else if (mSrcStream) {
out->mCapturingMediaStream = true;
}
@@ -4663,7 +4665,8 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder) {
}
ms.mCapturingDecoder = true;
aDecoder->AddOutputStream(ms.mStream, ms.mGraph);
aDecoder->AddOutputStream(ms.mStream,
ms.mGraphKeepAliveDummyStream->mStream->Graph());
}
if (mMediaKeys) {