summaryrefslogtreecommitdiffstats
path: root/dom/media/webcodecs/DecoderTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/webcodecs/DecoderTemplate.cpp')
-rw-r--r--dom/media/webcodecs/DecoderTemplate.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/dom/media/webcodecs/DecoderTemplate.cpp b/dom/media/webcodecs/DecoderTemplate.cpp
index 0fa25a208b..4d1c310737 100644
--- a/dom/media/webcodecs/DecoderTemplate.cpp
+++ b/dom/media/webcodecs/DecoderTemplate.cpp
@@ -139,8 +139,8 @@ void DecoderTemplate<DecoderType>::Configure(const ConfigType& aConfig,
nsCString errorMessage;
if (!DecoderType::Validate(aConfig, errorMessage)) {
- aRv.ThrowTypeError(
- nsPrintfCString("config is invalid: %s", errorMessage.get()));
+ LOG("Configure: Validate error: %s", errorMessage.get());
+ aRv.ThrowTypeError(errorMessage);
return;
}
@@ -322,13 +322,13 @@ void DecoderTemplate<DecoderType>::OutputDecodedData(
MOZ_ASSERT(mState == CodecState::Configured);
MOZ_ASSERT(mActiveConfig);
- nsTArray<RefPtr<VideoFrame>> frames = DecodedDataToOutputType(
+ nsTArray<RefPtr<OutputType>> frames = DecodedDataToOutputType(
GetParentObject(), std::move(aData), *mActiveConfig);
- RefPtr<VideoFrameOutputCallback> cb(mOutputCallback);
- for (RefPtr<VideoFrame>& frame : frames) {
+ RefPtr<OutputCallbackType> cb(mOutputCallback);
+ for (RefPtr<OutputType>& frame : frames) {
LOG("Outputing decoded data: ts: %" PRId64, frame->Timestamp());
- RefPtr<VideoFrame> f = frame;
- cb->Call((VideoFrame&)(*f));
+ RefPtr<OutputType> f = frame;
+ cb->Call((OutputType&)(*f));
}
}
@@ -881,6 +881,7 @@ void DecoderTemplate<DecoderType>::DestroyDecoderAgentIfAny() {
}
template class DecoderTemplate<VideoDecoderTraits>;
+template class DecoderTemplate<AudioDecoderTraits>;
#undef LOG
#undef LOGW