Files
palemoon27/dom/media/platforms/gonk/GonkDecoderModule.cpp
T
roytam1 b7de16bdeb import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1261900: [webm] Use block duration if known. r=kinetik (0455c4de93)
- Bug 1261900: [MSE] P2. Prevent assertion if first media segment contains no usable frames. r=gerald (a1cdf83be3)
- Bug 1261900: P3. Re-add MediaDataDemuxer::GetEvictionOffset() API. r=gerald (fc45da3ca8)
- Bug 1261900: [MSE] P4. Only evict no longer used data from resource. r=gerald (d3e3c59f4c)
- Bug 1261900: [MSE/webm] P5. Re-add WebMTrackDemuxer::GetEvictionOffset. r=gerald (ee8fd8e5dc)
- Bug 1261900: [MSE/webm] P6. Don't unnecessarily calculate the next keyframe time. r=kinetik (aa9345d6eb)
- Bug 1261900: [webm] P9. Prevent null deref when webm logs are turned on. r=kinetik (dfe061a463)
- Bug 1261900 - Allow WebMDemuxer to resume demuxing even after encountering EOS. r=jya (65bd6409fd)
- Bug 1274445: [webm] P1. Track separately audio track from video track. r=kinetik (35f04cd778)
- Bug 1274445: P2. Don't unnecessarily reset the decoder context. r=kamidphish (eaa0d94c25)
- Bug 1275807 - Remove remaining use of FlushableTaskQueue. r=cpearce. (d0834f0a03)
- Bug 1272225. Part 3 - remove use of FlushableTaskQueue. r=jya. (ed25bc636f)
- Bug 1274205 - remove use of FlushableTaskQueue. r=bechen. (9f340e7a97)
- Bug 1274214 - remove use of FlushableTaskQueue. r=kaku. (1c90ec8e7f)
- bug 1256614 - replace mozglue/linker/tests/Makefile.in with a PYTHON_UNIT_TEST. r=glandium (b0f885f8bd)
- Bug 1266644 - Remove unused codes. r=jesup r=pehrsons (ffb303f3ee)
- Bug 1266647 - Clean NotifyQueuedTrackChange to only notify when command is track create and track end. r=jesup r=pehrsons (2ed23f22f0)
2024-10-08 23:52:26 +08:00

72 lines
2.5 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GonkDecoderModule.h"
#include "GonkVideoDecoderManager.h"
#include "GonkAudioDecoderManager.h"
#include "mozilla/DebugOnly.h"
#include "GonkMediaDataDecoder.h"
namespace mozilla {
GonkDecoderModule::GonkDecoderModule()
{
}
GonkDecoderModule::~GonkDecoderModule()
{
}
already_AddRefed<MediaDataDecoder>
GonkDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig,
mozilla::layers::LayersBackend aLayersBackend,
mozilla::layers::ImageContainer* aImageContainer,
TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
DecoderDoctorDiagnostics* aDiagnostics)
{
RefPtr<MediaDataDecoder> decoder =
new GonkMediaDataDecoder(new GonkVideoDecoderManager(aImageContainer, aConfig),
aCallback);
return decoder.forget();
}
already_AddRefed<MediaDataDecoder>
GonkDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig,
TaskQueue* aTaskQueue,
MediaDataDecoderCallback* aCallback,
DecoderDoctorDiagnostics* aDiagnostics)
{
RefPtr<MediaDataDecoder> decoder =
new GonkMediaDataDecoder(new GonkAudioDecoderManager(aConfig),
aCallback);
return decoder.forget();
}
PlatformDecoderModule::ConversionRequired
GonkDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
if (aConfig.IsVideo()) {
return kNeedAnnexB;
} else {
return kNeedNone;
}
}
bool
GonkDecoderModule::SupportsMimeType(const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const
{
return aMimeType.EqualsLiteral("audio/mp4a-latm") ||
aMimeType.EqualsLiteral("audio/3gpp") ||
aMimeType.EqualsLiteral("audio/amr-wb") ||
aMimeType.EqualsLiteral("audio/mpeg") ||
aMimeType.EqualsLiteral("video/mp4") ||
aMimeType.EqualsLiteral("video/mp4v-es") ||
aMimeType.EqualsLiteral("video/avc") ||
aMimeType.EqualsLiteral("video/3gpp");
}
} // namespace mozilla