mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1148102: P5. Add Opus/VPX/Vorbis MediaDataDecoder. r=jya (b07fea1ea) - Bug 1148102: P6. Add WebMDemuxer object. r=jya (225cee37f) - reformat comment (9d12af823) - reformat comment (80765706d) - Bug 1148102: P7. Hookup WebMDemuxer. r=jya (78f973b17) - Bug 1185782 - Remove media.windows-media-foundation.enabled pref. r=jya (2fb2c5e4a) - Bug 1163486 - Remove MP4Reader. r=jya (0376d6d60) and some custom changes for our tree: - change MediaReadAt to SilentReadAt in new file dom/media/webm/WebMDemuxer.cpp - add missing export of "vpx_codec_err_to_string" in layout/media/symbols.def.in
This commit is contained in:
@@ -32,8 +32,13 @@
|
||||
#include "MediaInfo.h"
|
||||
#include "H264Converter.h"
|
||||
|
||||
#include "OpusDecoder.h"
|
||||
#include "VorbisDecoder.h"
|
||||
#include "VPXDecoder.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
|
||||
extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
|
||||
|
||||
bool PlatformDecoderModule::sUseBlankDecoder = false;
|
||||
@@ -99,7 +104,7 @@ PlatformDecoderModule::Create()
|
||||
if (m && NS_SUCCEEDED(m->Startup())) {
|
||||
return m.forget();
|
||||
}
|
||||
return nullptr;
|
||||
return CreateAgnosticDecoderModule();
|
||||
}
|
||||
|
||||
/* static */
|
||||
@@ -159,10 +164,22 @@ PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig,
|
||||
{
|
||||
nsRefPtr<MediaDataDecoder> m;
|
||||
|
||||
bool hasPlatformDecoder = SupportsMimeType(aConfig.mMimeType);
|
||||
|
||||
if (aConfig.GetAsAudioInfo()) {
|
||||
m = CreateAudioDecoder(*aConfig.GetAsAudioInfo(),
|
||||
aTaskQueue,
|
||||
aCallback);
|
||||
if (!hasPlatformDecoder && VorbisDataDecoder::IsVorbis(aConfig.mMimeType)) {
|
||||
m = new VorbisDataDecoder(*aConfig.GetAsAudioInfo(),
|
||||
aTaskQueue,
|
||||
aCallback);
|
||||
} else if (!hasPlatformDecoder && OpusDataDecoder::IsOpus(aConfig.mMimeType)) {
|
||||
m = new OpusDataDecoder(*aConfig.GetAsAudioInfo(),
|
||||
aTaskQueue,
|
||||
aCallback);
|
||||
} else {
|
||||
m = CreateAudioDecoder(*aConfig.GetAsAudioInfo(),
|
||||
aTaskQueue,
|
||||
aCallback);
|
||||
}
|
||||
return m.forget();
|
||||
}
|
||||
|
||||
@@ -185,6 +202,11 @@ PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig,
|
||||
// problem, for example WMF DLLs were missing.
|
||||
m = h.forget();
|
||||
}
|
||||
} else if (!hasPlatformDecoder && VPXDecoder::IsVPX(aConfig.mMimeType)) {
|
||||
m = new VPXDecoder(*aConfig.GetAsVideoInfo(),
|
||||
aImageContainer,
|
||||
aTaskQueue,
|
||||
aCallback);
|
||||
} else {
|
||||
m = CreateVideoDecoder(*aConfig.GetAsVideoInfo(),
|
||||
aLayersBackend,
|
||||
@@ -203,4 +225,14 @@ PlatformDecoderModule::SupportsMimeType(const nsACString& aMimeType)
|
||||
aMimeType.EqualsLiteral("video/avc");
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool
|
||||
PlatformDecoderModule::AgnosticMimeType(const nsACString& aMimeType)
|
||||
{
|
||||
return VPXDecoder::IsVPX(aMimeType) ||
|
||||
OpusDataDecoder::IsOpus(aMimeType) ||
|
||||
VorbisDataDecoder::IsVorbis(aMimeType);
|
||||
}
|
||||
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
Reference in New Issue
Block a user