mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Backed out changeset dba7a059ed22 (bug 843214)
This commit is contained in:
parent
3e2e757ae7
commit
d9ab95bc30
@ -100,10 +100,6 @@ public:
|
||||
* Insert aDuration of null data at the end of the segment.
|
||||
*/
|
||||
virtual void AppendNullData(TrackTicks aDuration) = 0;
|
||||
/**
|
||||
* Remove all contents, setting duration to 0.
|
||||
*/
|
||||
virtual void Clear() = 0;
|
||||
|
||||
protected:
|
||||
MediaSegment(Type aType) : mDuration(0), mType(aType)
|
||||
@ -190,11 +186,6 @@ public:
|
||||
}
|
||||
mDuration += aDuration;
|
||||
}
|
||||
virtual void Clear()
|
||||
{
|
||||
mDuration = 0;
|
||||
mChunks.Clear();
|
||||
}
|
||||
|
||||
class ChunkIterator {
|
||||
public:
|
||||
|
@ -118,9 +118,6 @@ MediaStreamGraphImpl::ExtractPendingInput(SourceMediaStream* aStream,
|
||||
StreamTime t =
|
||||
GraphTimeToStreamTime(aStream, mStateComputedTime) +
|
||||
(aDesiredUpToTime - mStateComputedTime);
|
||||
LOG(PR_LOG_DEBUG, ("Calling NotifyPull aStream=%p t=%f current end=%f", aStream,
|
||||
MediaTimeToSeconds(t),
|
||||
MediaTimeToSeconds(aStream->mBuffer.GetEnd())));
|
||||
if (t > aStream->mBuffer.GetEnd()) {
|
||||
*aEnsureNextIteration = true;
|
||||
for (uint32_t j = 0; j < aStream->mListeners.Length(); ++j) {
|
||||
@ -1640,25 +1637,22 @@ SourceMediaStream::AddTrack(TrackID aID, TrackRate aRate, TrackTicks aStart,
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
void
|
||||
SourceMediaStream::AppendToTrack(TrackID aID, MediaSegment* aSegment)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
// ::EndAllTrackAndFinished() can end these before the sources notice
|
||||
bool appended = false;
|
||||
if (!mFinished) {
|
||||
TrackData *track = FindDataForTrack(aID);
|
||||
if (track) {
|
||||
track->mData->AppendFrom(aSegment);
|
||||
appended = true;
|
||||
} else {
|
||||
aSegment->Clear();
|
||||
}
|
||||
NS_ERROR("Append to non-existent track!");
|
||||
}
|
||||
}
|
||||
if (!mDestroyed) {
|
||||
GraphImpl()->EnsureNextIteration();
|
||||
}
|
||||
return appended;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1669,7 +1663,8 @@ SourceMediaStream::HaveEnoughBuffered(TrackID aID)
|
||||
if (track) {
|
||||
return track->mHaveEnough;
|
||||
}
|
||||
return false;
|
||||
NS_ERROR("No track in HaveEnoughBuffered!");
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
@ -1679,7 +1674,7 @@ SourceMediaStream::DispatchWhenNotEnoughBuffered(TrackID aID,
|
||||
MutexAutoLock lock(mMutex);
|
||||
TrackData* data = FindDataForTrack(aID);
|
||||
if (!data) {
|
||||
aSignalThread->Dispatch(aSignalRunnable, 0);
|
||||
NS_ERROR("No track in DispatchWhenNotEnoughBuffered");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1699,6 +1694,8 @@ SourceMediaStream::EndTrack(TrackID aID)
|
||||
TrackData *track = FindDataForTrack(aID);
|
||||
if (track) {
|
||||
track->mCommands |= TRACK_END;
|
||||
} else {
|
||||
NS_ERROR("End of non-existant track");
|
||||
}
|
||||
}
|
||||
if (!mDestroyed) {
|
||||
|
@ -567,27 +567,22 @@ public:
|
||||
/**
|
||||
* Append media data to a track. Ownership of aSegment remains with the caller,
|
||||
* but aSegment is emptied.
|
||||
* Returns false if the data was not appended because no such track exists
|
||||
* or the stream was already finished.
|
||||
*/
|
||||
bool AppendToTrack(TrackID aID, MediaSegment* aSegment);
|
||||
void AppendToTrack(TrackID aID, MediaSegment* aSegment);
|
||||
/**
|
||||
* Returns true if the buffer currently has enough data.
|
||||
* Returns false if there isn't enough data or if no such track exists.
|
||||
*/
|
||||
bool HaveEnoughBuffered(TrackID aID);
|
||||
/**
|
||||
* Ensures that aSignalRunnable will be dispatched to aSignalThread
|
||||
* when we don't have enough buffered data in the track (which could be
|
||||
* immediately). Will dispatch the runnable immediately if the track
|
||||
* does not exist.
|
||||
* immediately).
|
||||
*/
|
||||
void DispatchWhenNotEnoughBuffered(TrackID aID,
|
||||
nsIThread* aSignalThread, nsIRunnable* aSignalRunnable);
|
||||
/**
|
||||
* Indicate that a track has ended. Do not do any more API calls
|
||||
* affecting this track.
|
||||
* Ignored if the track does not exist.
|
||||
*/
|
||||
void EndTrack(TrackID aID);
|
||||
/**
|
||||
@ -658,6 +653,7 @@ protected:
|
||||
return &mUpdateTracks[i];
|
||||
}
|
||||
}
|
||||
NS_ERROR("Bad track ID!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -124,11 +124,8 @@ MediaEngineWebRTCVideoSource::NotifyPull(MediaStreamGraph* aGraph,
|
||||
if (delta > 0) {
|
||||
// NULL images are allowed
|
||||
segment.AppendFrame(image ? image.forget() : nullptr, delta, gfxIntSize(mWidth, mHeight));
|
||||
// This can fail if either a) we haven't added the track yet, or b)
|
||||
// we've removed or finished the track.
|
||||
if (aSource->AppendToTrack(aID, &(segment))) {
|
||||
aLastEndTime = target;
|
||||
}
|
||||
aSource->AppendToTrack(aID, &(segment));
|
||||
aLastEndTime = target;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user