Beispiel #1
0
void
DecoderCallbackFuzzingWrapper::Shutdown()
{
  DFW_LOGV("Shutting down mTaskQueue");
  mTaskQueue->BeginShutdown();
  mTaskQueue->AwaitIdle();
  DFW_LOGV("mTaskQueue shut down");
}
Beispiel #2
0
nsresult
DecoderFuzzingWrapper::Flush()
{
  DFW_LOGV("Calling mDecoder[%p]->Flush()", mDecoder.get());
  MOZ_ASSERT(mDecoder);
  // Flush may output some frames (though unlikely).
  // Flush may block a bit, it's ok if we output some frames in the meantime.
  nsresult result = mDecoder->Flush();
  DFW_LOGV("mDecoder[%p]->Flush() -> result=%u", mDecoder.get(), uint32_t(result));
  // Clear any delayed output we may have.
  mCallbackWrapper->ClearDelayedOutput();
  return result;
}
Beispiel #3
0
void
DecoderCallbackFuzzingWrapper::ClearDelayedOutput()
{
  if (!mTaskQueue->IsCurrentThreadIn()) {
    DFW_LOGV("(dispatching self)");
    mTaskQueue->Dispatch(NewRunnableMethod(this, &DecoderCallbackFuzzingWrapper::ClearDelayedOutput));
    return;
  }
  DFW_LOGV("");
  // In case a timer hasn't lapsed yet, before destroying the timer and its
  // attached waitUntil() promise, the 'Then' request must be disconnected.
  mDelayedOutputRequest.DisconnectIfExists();
  mDelayedOutputTimer = nullptr;
  mDelayedOutput.clear();
}
Beispiel #4
0
nsresult
DecoderFuzzingWrapper::ConfigurationChanged(const TrackInfo& aConfig)
{
  DFW_LOGV("");
  MOZ_ASSERT(mDecoder);
  return mDecoder->ConfigurationChanged(aConfig);
}
Beispiel #5
0
bool
DecoderFuzzingWrapper::IsHardwareAccelerated(nsACString& aFailureReason) const
{
  DFW_LOGV("");
  MOZ_ASSERT(mDecoder);
  return mDecoder->IsHardwareAccelerated(aFailureReason);
}
Beispiel #6
0
nsresult
DecoderFuzzingWrapper::Input(MediaRawData* aData)
{
  DFW_LOGV("aData.mTime=%lld", aData->mTime);
  MOZ_ASSERT(mDecoder);
  return mDecoder->Input(aData);
}
Beispiel #7
0
nsRefPtr<MediaDataDecoder::InitPromise>
DecoderFuzzingWrapper::Init()
{
  DFW_LOGV("");
  MOZ_ASSERT(mDecoder);
  return mDecoder->Init();
}
Beispiel #8
0
DecoderFuzzingWrapper::DecoderFuzzingWrapper(
    already_AddRefed<MediaDataDecoder> aDecoder,
    already_AddRefed<DecoderCallbackFuzzingWrapper> aCallbackWrapper)
  : mDecoder(aDecoder)
  , mCallbackWrapper(aCallbackWrapper)
{
  DFW_LOGV("aDecoder=%p aCallbackWrapper=%p", mDecoder.get(), mCallbackWrapper.get());
}
Beispiel #9
0
nsresult
DecoderFuzzingWrapper::Drain()
{
  DFW_LOGV("");
  MOZ_ASSERT(mDecoder);
  // Note: The decoder should callback DrainComplete(), we'll drain the
  // delayed output (if any) then.
  return mDecoder->Drain();
}
Beispiel #10
0
nsresult
DecoderFuzzingWrapper::Shutdown()
{
  DFW_LOGV("");
  MOZ_ASSERT(mDecoder);
  // Both shutdowns below may block a bit.
  nsresult result = mDecoder->Shutdown();
  mCallbackWrapper->Shutdown();
  return result;
}
Beispiel #11
0
DecoderFuzzingWrapper::~DecoderFuzzingWrapper()
{
  DFW_LOGV("");
}