void DecoderCallbackFuzzingWrapper::Shutdown() { DFW_LOGV("Shutting down mTaskQueue"); mTaskQueue->BeginShutdown(); mTaskQueue->AwaitIdle(); DFW_LOGV("mTaskQueue shut down"); }
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; }
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(); }
nsresult DecoderFuzzingWrapper::ConfigurationChanged(const TrackInfo& aConfig) { DFW_LOGV(""); MOZ_ASSERT(mDecoder); return mDecoder->ConfigurationChanged(aConfig); }
bool DecoderFuzzingWrapper::IsHardwareAccelerated(nsACString& aFailureReason) const { DFW_LOGV(""); MOZ_ASSERT(mDecoder); return mDecoder->IsHardwareAccelerated(aFailureReason); }
nsresult DecoderFuzzingWrapper::Input(MediaRawData* aData) { DFW_LOGV("aData.mTime=%lld", aData->mTime); MOZ_ASSERT(mDecoder); return mDecoder->Input(aData); }
nsRefPtr<MediaDataDecoder::InitPromise> DecoderFuzzingWrapper::Init() { DFW_LOGV(""); MOZ_ASSERT(mDecoder); return mDecoder->Init(); }
DecoderFuzzingWrapper::DecoderFuzzingWrapper( already_AddRefed<MediaDataDecoder> aDecoder, already_AddRefed<DecoderCallbackFuzzingWrapper> aCallbackWrapper) : mDecoder(aDecoder) , mCallbackWrapper(aCallbackWrapper) { DFW_LOGV("aDecoder=%p aCallbackWrapper=%p", mDecoder.get(), mCallbackWrapper.get()); }
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(); }
nsresult DecoderFuzzingWrapper::Shutdown() { DFW_LOGV(""); MOZ_ASSERT(mDecoder); // Both shutdowns below may block a bit. nsresult result = mDecoder->Shutdown(); mCallbackWrapper->Shutdown(); return result; }
DecoderFuzzingWrapper::~DecoderFuzzingWrapper() { DFW_LOGV(""); }