Bug 1872315 - Rename DecodeAgent to DecoderAgent in DecoderTemplate r=media-playback-reviewers,alwu

Depends on D197398

Differential Revision: https://phabricator.services.mozilla.com/D197399
This commit is contained in:
Chun-Min Chang 2023-12-29 16:06:44 +00:00
Родитель 62e876725c
Коммит c5ea193a8a
1 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -548,7 +548,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessConfigureMessage(
ConfigureMessage* msg =
self->mProcessingMessage->AsConfigureMessage();
LOG("%s %p, DecodeAgent #%d %s has been %s. now unblocks "
LOG("%s %p, DecoderAgent #%d %s has been %s. now unblocks "
"message-queue-processing",
DecoderType::Name.get(), self.get(), id,
msg->ToString().get(),
@ -561,7 +561,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessConfigureMessage(
// The spec asks to close the decoder with an
// NotSupportedError so we log the exact error here.
const MediaResult& error = aResult.RejectValue();
LOGE("%s %p, DecodeAgent #%d failed to configure: %s",
LOGE("%s %p, DecoderAgent #%d failed to configure: %s",
DecoderType::Name.get(), self.get(), id,
error.Description().get());
@ -646,7 +646,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessDecodeMessage(
DecodeMessage* msg =
self->mProcessingMessage->AsDecodeMessage();
LOGV("%s %p, DecodeAgent #%d %s has been %s",
LOGV("%s %p, DecoderAgent #%d %s has been %s",
DecoderType::Name.get(), self.get(), id,
msg->ToString().get(),
aResult.IsResolve() ? "resolved" : "rejected");
@ -660,7 +660,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessDecodeMessage(
// The spec asks to queue a task to run close the decoder
// with an EncodingError so we log the exact error here.
const MediaResult& error = aResult.RejectValue();
LOGE("%s %p, DecodeAgent #%d %s failed: %s",
LOGE("%s %p, DecoderAgent #%d %s failed: %s",
DecoderType::Name.get(), self.get(), id, msgStr.get(),
error.Description().get());
self->QueueATask(
@ -739,7 +739,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessFlushMessage(
FlushMessage* msg =
self->mProcessingMessage->AsFlushMessage();
LOG("%s %p, DecodeAgent #%d %s has been %s",
LOG("%s %p, DecoderAgent #%d %s has been %s",
DecoderType::Name.get(), self.get(), id,
msg->ToString().get(),
aResult.IsResolve() ? "resolved" : "rejected");
@ -754,7 +754,7 @@ MessageProcessedResult DecoderTemplate<DecoderType>::ProcessFlushMessage(
// VideoDecoder with an EncodingError.
if (aResult.IsReject()) {
const MediaResult& error = aResult.RejectValue();
LOGE("%s %p, DecodeAgent #%d failed to flush: %s",
LOGE("%s %p, DecoderAgent #%d failed to flush: %s",
DecoderType::Name.get(), self.get(), id,
error.Description().get());
RefPtr<Promise> promise = msg->TakePromise();
@ -861,10 +861,10 @@ bool DecoderTemplate<DecoderType>::CreateDecoderAgent(
// ShutdownBlockingTicket requires an unique name to register its own
// nsIAsyncShutdownBlocker since each blocker needs a distinct name.
// To do that, we use DecodeAgent's unique id to create a unique name.
// To do that, we use DecoderAgent's unique id to create a unique name.
nsAutoString uniqueName;
uniqueName.AppendPrintf(
"Blocker for DecodeAgent #%d (codec: %s) @ %p", mAgent->mId,
"Blocker for DecoderAgent #%d (codec: %s) @ %p", mAgent->mId,
NS_ConvertUTF16toUTF8(mActiveConfig->mCodec).get(), mAgent.get());
mShutdownBlocker = media::ShutdownBlockingTicket::Create(
@ -881,19 +881,19 @@ bool DecoderTemplate<DecoderType>::CreateDecoderAgent(
GetCurrentSerialEventTarget(), __func__,
[self = RefPtr{this}, id = mAgent->mId,
ref = mWorkerRef](bool /* aUnUsed*/) MOZ_CAN_RUN_SCRIPT {
LOG("%s %p gets xpcom-will-shutdown notification for DecodeAgent #%d",
LOG("%s %p gets xpcom-will-shutdown notification for DecoderAgent #%d",
DecoderType::Name.get(), self.get(), id);
Unused << self->ResetInternal(NS_ERROR_DOM_ABORT_ERR);
},
[self = RefPtr{this}, id = mAgent->mId,
ref = mWorkerRef](bool /* aUnUsed*/) {
LOG("%s %p removes shutdown-blocker #%d before getting any "
"notification. DecodeAgent #%d should have been dropped",
"notification. DecoderAgent #%d should have been dropped",
DecoderType::Name.get(), self.get(), id, id);
MOZ_ASSERT(!self->mAgent || self->mAgent->mId != id);
});
LOG("%s %p creates DecodeAgent #%d @ %p and its shutdown-blocker",
LOG("%s %p creates DecoderAgent #%d @ %p and its shutdown-blocker",
DecoderType::Name.get(), this, mAgent->mId, mAgent.get());
resetOnFailure.release();
@ -905,7 +905,7 @@ void DecoderTemplate<DecoderType>::DestroyDecoderAgentIfAny() {
AssertIsOnOwningThread();
if (!mAgent) {
LOG("%s %p has no DecodeAgent to destroy", DecoderType::Name.get(), this);
LOG("%s %p has no DecoderAgent to destroy", DecoderType::Name.get(), this);
return;
}
@ -913,7 +913,7 @@ void DecoderTemplate<DecoderType>::DestroyDecoderAgentIfAny() {
MOZ_ASSERT(mShutdownBlocker);
MOZ_ASSERT_IF(!NS_IsMainThread(), mWorkerRef);
LOG("%s %p destroys DecodeAgent #%d @ %p", DecoderType::Name.get(), this,
LOG("%s %p destroys DecoderAgent #%d @ %p", DecoderType::Name.get(), this,
mAgent->mId, mAgent.get());
mActiveConfig = nullptr;
RefPtr<DecoderAgent> agent = std::move(mAgent);