зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1189506. Remove unused NotifyConsumptionChanged. r=karlt
--HG-- extra : commitid : 844LybDIKss extra : rebase_source : 6a514c1ef0926e540e4d27a1e3f9561636c38ddb
This commit is contained in:
Родитель
888a6d633f
Коммит
d745ffaf22
|
@ -40,7 +40,6 @@ CameraPreviewMediaStream::CameraPreviewMediaStream(DOMMediaStream* aWrapper)
|
|||
MediaStreamGraph::GetInstance(
|
||||
MediaStreamGraph::SYSTEM_THREAD_DRIVER, AudioChannel::Normal));
|
||||
mFakeMediaStreamGraph = new FakeMediaStreamGraph();
|
||||
mIsConsumed = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -64,15 +63,6 @@ CameraPreviewMediaStream::AddVideoOutput(VideoFrameContainer* aContainer)
|
|||
MutexAutoLock lock(mMutex);
|
||||
nsRefPtr<VideoFrameContainer> container = aContainer;
|
||||
AddVideoOutputImpl(container.forget());
|
||||
|
||||
if (mVideoOutputs.Length() > 1) {
|
||||
return;
|
||||
}
|
||||
mIsConsumed = true;
|
||||
for (uint32_t j = 0; j < mListeners.Length(); ++j) {
|
||||
MediaStreamListener* l = mListeners[j];
|
||||
l->NotifyConsumptionChanged(mFakeMediaStreamGraph, MediaStreamListener::CONSUMED);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -80,15 +70,6 @@ CameraPreviewMediaStream::RemoveVideoOutput(VideoFrameContainer* aContainer)
|
|||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
RemoveVideoOutputImpl(aContainer);
|
||||
|
||||
if (!mVideoOutputs.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
mIsConsumed = false;
|
||||
for (uint32_t j = 0; j < mListeners.Length(); ++j) {
|
||||
MediaStreamListener* l = mListeners[j];
|
||||
l->NotifyConsumptionChanged(mFakeMediaStreamGraph, MediaStreamListener::NOT_CONSUMED);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -126,21 +126,6 @@ MediaStreamGraphImpl::RemoveStreamGraphThread(MediaStream* aStream)
|
|||
STREAM_LOG(LogLevel::Debug, ("Removing media stream %p from the graph", aStream));
|
||||
}
|
||||
|
||||
void
|
||||
MediaStreamGraphImpl::UpdateConsumptionState(SourceMediaStream* aStream)
|
||||
{
|
||||
MediaStreamListener::Consumption state =
|
||||
aStream->mIsConsumed ? MediaStreamListener::CONSUMED
|
||||
: MediaStreamListener::NOT_CONSUMED;
|
||||
if (state != aStream->mLastConsumptionState) {
|
||||
aStream->mLastConsumptionState = state;
|
||||
for (uint32_t j = 0; j < aStream->mListeners.Length(); ++j) {
|
||||
MediaStreamListener* l = aStream->mListeners[j];
|
||||
l->NotifyConsumptionChanged(this, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
|
||||
GraphTime aDesiredUpToTime,
|
||||
|
@ -383,24 +368,6 @@ MediaStreamGraphImpl::WillUnderrun(MediaStream* aStream,
|
|||
return std::min(bufferEnd, aEndBlockingDecisions);
|
||||
}
|
||||
|
||||
void
|
||||
MediaStreamGraphImpl::MarkConsumed(MediaStream* aStream)
|
||||
{
|
||||
if (aStream->mIsConsumed) {
|
||||
return;
|
||||
}
|
||||
aStream->mIsConsumed = true;
|
||||
|
||||
ProcessedMediaStream* ps = aStream->AsProcessedStream();
|
||||
if (!ps) {
|
||||
return;
|
||||
}
|
||||
// Mark all the inputs to this stream as consumed
|
||||
for (uint32_t i = 0; i < ps->mInputs.Length(); ++i) {
|
||||
MarkConsumed(ps->mInputs[i]->mSource);
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Value of mCycleMarker for unvisited streams in cycle detection.
|
||||
const uint32_t NOT_VISITED = UINT32_MAX;
|
||||
|
@ -417,7 +384,6 @@ MediaStreamGraphImpl::UpdateStreamOrder()
|
|||
bool audioTrackPresent = false;
|
||||
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
|
||||
MediaStream* stream = mStreams[i];
|
||||
stream->mIsConsumed = false;
|
||||
#ifdef MOZ_WEBRTC
|
||||
if (stream->AsSourceStream() &&
|
||||
stream->AsSourceStream()->NeedsMixing()) {
|
||||
|
@ -487,9 +453,6 @@ MediaStreamGraphImpl::UpdateStreamOrder()
|
|||
|
||||
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
|
||||
MediaStream* s = mStreams[i];
|
||||
if (s->IsIntrinsicallyConsumed()) {
|
||||
MarkConsumed(s);
|
||||
}
|
||||
ProcessedMediaStream* ps = s->AsProcessedStream();
|
||||
if (ps) {
|
||||
// The dfsStack initially contains a list of all processed streams in
|
||||
|
@ -1113,7 +1076,6 @@ MediaStreamGraphImpl::UpdateGraph(GraphTime aEndBlockingDecisions)
|
|||
// Grab pending stream input and compute blocking time
|
||||
for (MediaStream* stream : mStreams) {
|
||||
if (SourceMediaStream* is = stream->AsSourceStream()) {
|
||||
UpdateConsumptionState(is);
|
||||
ExtractPendingInput(is, aEndBlockingDecisions, &ensureNextIteration);
|
||||
}
|
||||
|
||||
|
@ -2946,7 +2908,6 @@ MediaStreamGraphImpl::DecrementSuspendCount(MediaStream* aStream)
|
|||
ProcessedMediaStream* ps = aStream->AsProcessedStream();
|
||||
if (ps) {
|
||||
ps->mCycleMarker = NOT_VISITED;
|
||||
ps->mIsConsumed = false;
|
||||
}
|
||||
SetStreamOrderDirty();
|
||||
}
|
||||
|
|
|
@ -101,18 +101,6 @@ protected:
|
|||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStreamListener)
|
||||
|
||||
enum Consumption {
|
||||
CONSUMED,
|
||||
NOT_CONSUMED
|
||||
};
|
||||
|
||||
/**
|
||||
* Notify that the stream is hooked up and we'd like to start or stop receiving
|
||||
* data on it. Only fires on SourceMediaStreams.
|
||||
* The initial state is assumed to be NOT_CONSUMED.
|
||||
*/
|
||||
virtual void NotifyConsumptionChanged(MediaStreamGraph* aGraph, Consumption aConsuming) {}
|
||||
|
||||
/**
|
||||
* When a SourceMediaStream has pulling enabled, and the MediaStreamGraph
|
||||
* control loop is ready to pull, this gets called. A NotifyPull implementation
|
||||
|
@ -470,16 +458,6 @@ public:
|
|||
void RemoveListenerImpl(MediaStreamListener* aListener);
|
||||
void RemoveAllListenersImpl();
|
||||
virtual void SetTrackEnabledImpl(TrackID aTrackID, bool aEnabled);
|
||||
/**
|
||||
* Returns true when this stream requires the contents of its inputs even if
|
||||
* its own outputs are not being consumed. This is used to signal inputs to
|
||||
* this stream that they are being consumed; when they're not being consumed,
|
||||
* we make some optimizations.
|
||||
*/
|
||||
virtual bool IsIntrinsicallyConsumed() const
|
||||
{
|
||||
return !mAudioOutputs.IsEmpty() || !mVideoOutputs.IsEmpty();
|
||||
}
|
||||
|
||||
void AddConsumer(MediaInputPort* aPort)
|
||||
{
|
||||
|
@ -684,10 +662,6 @@ protected:
|
|||
*/
|
||||
bool mNotifiedHasCurrentData;
|
||||
|
||||
// True if the stream is being consumed (i.e. has track data being played,
|
||||
// or is feeding into some stream that is being consumed).
|
||||
bool mIsConsumed;
|
||||
|
||||
// This state is only used on the main thread.
|
||||
DOMMediaStream* mWrapper;
|
||||
// Main-thread views of state
|
||||
|
@ -713,7 +687,6 @@ class SourceMediaStream : public MediaStream
|
|||
public:
|
||||
explicit SourceMediaStream(DOMMediaStream* aWrapper) :
|
||||
MediaStream(aWrapper),
|
||||
mLastConsumptionState(MediaStreamListener::NOT_CONSUMED),
|
||||
mMutex("mozilla::media::SourceMediaStream"),
|
||||
mUpdateKnownTracksTime(0),
|
||||
mPullEnabled(false),
|
||||
|
@ -910,9 +883,6 @@ protected:
|
|||
void NotifyDirectConsumers(TrackData *aTrack,
|
||||
MediaSegment *aSegment);
|
||||
|
||||
// Media stream graph thread only
|
||||
MediaStreamListener::Consumption mLastConsumptionState;
|
||||
|
||||
// This must be acquired *before* MediaStreamGraphImpl's lock, if they are
|
||||
// held together.
|
||||
Mutex mMutex;
|
||||
|
|
|
@ -250,10 +250,6 @@ public:
|
|||
* Update "have enough data" flags in aStream.
|
||||
*/
|
||||
void UpdateBufferSufficiencyState(SourceMediaStream* aStream);
|
||||
/**
|
||||
* Mark aStream and all its inputs (recursively) as consumed.
|
||||
*/
|
||||
static void MarkConsumed(MediaStream* aStream);
|
||||
|
||||
/**
|
||||
* Called when a suspend/resume/close operation has been completed, on the
|
||||
|
|
|
@ -135,10 +135,6 @@ public:
|
|||
return ((mFlags & NEED_MAIN_THREAD_FINISHED) && mFinished) ||
|
||||
(mFlags & NEED_MAIN_THREAD_CURRENT_TIME);
|
||||
}
|
||||
virtual bool IsIntrinsicallyConsumed() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Any thread
|
||||
AudioNodeEngine* Engine() { return mEngine; }
|
||||
|
|
Загрузка…
Ссылка в новой задаче