Bug 1195185. Part 2 - Check if all output streams are from the same graph because we don't support connecting streams from different graphs. r=roc.

This commit is contained in:
JW Wang 2015-08-20 13:02:31 +08:00
Родитель 458aec0989
Коммит feaf8fea91
2 изменённых файлов: 17 добавлений и 0 удалений

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

@ -293,10 +293,19 @@ OutputStreamData::Remove()
mOwner->Remove(mStream);
}
MediaStreamGraph*
OutputStreamData::Graph() const
{
return mStream->Graph();
}
void
OutputStreamManager::Add(ProcessedMediaStream* aStream, bool aFinishWhenEnded)
{
MOZ_ASSERT(NS_IsMainThread());
// All streams must belong to the same graph.
MOZ_ASSERT(!Graph() || Graph() == aStream->Graph());
// Ensure that aStream finishes the moment mDecodedStream does.
if (aFinishWhenEnded) {
aStream->SetAutofinish(true);

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

@ -56,6 +56,8 @@ public:
{
return mStream == aStream;
}
// Return the graph mStream belongs to.
MediaStreamGraph* Graph() const;
private:
OutputStreamManager* mOwner;
@ -81,6 +83,12 @@ public:
void Connect(MediaStream* aStream);
// Disconnect all output streams from the input stream.
void Disconnect();
// Return the graph these streams belong to or null if empty.
MediaStreamGraph* Graph() const
{
MOZ_ASSERT(NS_IsMainThread());
return !IsEmpty() ? mStreams[0].Graph() : nullptr;
}
private:
// Keep the input stream so we can connect the output streams that