示例#1
0
void
SourceBuffer::AppendDataCompletedWithSuccess(bool aHasActiveTracks)
{
    mPendingAppend.Complete();
    if (!mUpdating) {
        // The buffer append algorithm has been interrupted by abort().
        return;
    }

    if (aHasActiveTracks) {
        if (!mActive) {
            mActive = true;
            mMediaSource->SourceBufferIsActive(this);
            mMediaSource->QueueInitializationEvent();
            if (mIsUsingFormatReader) {
                mMediaSource->GetDecoder()->NotifyWaitingForResourcesStatusChanged();
            }
        }
    }
    if (mActive && mIsUsingFormatReader) {
        // Tell our parent decoder that we have received new data.
        // The information provided do not matter much so long as it is monotonically
        // increasing.
        mMediaSource->GetDecoder()->NotifyDataArrived(1, mReportedOffset++, /* aThrottleUpdates = */ false);
        // Send progress event.
        mMediaSource->GetDecoder()->NotifyBytesDownloaded();
    }

    CheckEndTime();

    StopUpdating();
}
示例#2
0
void
SourceBuffer::AppendDataCompletedWithSuccess(SourceBufferTask::AppendBufferResult aResult)
{
  MOZ_ASSERT(mUpdating);
  mPendingAppend.Complete();

  if (aResult.first()) {
    if (!mActive) {
      mActive = true;
      mMediaSource->SourceBufferIsActive(this);
    }
  }
  if (mActive) {
    // Tell our parent decoder that we have received new data.
    mMediaSource->GetDecoder()->NotifyDataArrived();
    // Send progress event.
    mMediaSource->GetDecoder()->NotifyBytesDownloaded();
  }

  mCurrentAttributes = aResult.second();

  CheckEndTime();

  StopUpdating();
}
示例#3
0
void
SourceBuffer::AppendDataCompletedWithSuccess(bool aHasActiveTracks)
{
  mPendingAppend.Complete();
  if (!mUpdating) {
    // The buffer append algorithm has been interrupted by abort().
    return;
  }

  if (aHasActiveTracks) {
    if (!mActive) {
      mActive = true;
      mMediaSource->SourceBufferIsActive(this);
    }
  }
  if (mActive) {
    // Tell our parent decoder that we have received new data.
    mMediaSource->GetDecoder()->NotifyDataArrived();
    // Send progress event.
    mMediaSource->GetDecoder()->NotifyBytesDownloaded();
  }

  CheckEndTime();

  StopUpdating();
}
示例#4
0
void
SourceBuffer::AppendDataCompletedWithSuccess(bool aGotMedia)
{
  mPendingAppend.Complete();
  if (!mUpdating) {
    // The buffer append algorithm has been interrupted by abort().
    return;
  }

  if (mTrackBuffer->HasInitSegment()) {
    if (!mActive) {
      mActive = true;
      mMediaSource->SourceBufferIsActive(this);
      mMediaSource->QueueInitializationEvent();
    }
  }

  if (aGotMedia) {
    CheckEndTime();
  }

  StopUpdating();
}