зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1080484 - Support avi/divx, ts/m2ts, and mkv media formats. r=cajbir
This commit is contained in:
Родитель
b32479bd71
Коммит
bc4de955f9
|
@ -229,6 +229,20 @@ static const char* const gOmxTypes[] = {
|
|||
"video/webm",
|
||||
"audio/webm",
|
||||
#endif
|
||||
"audio/x-matroska",
|
||||
"video/mp2t",
|
||||
"video/avi",
|
||||
"video/x-matroska",
|
||||
nullptr
|
||||
};
|
||||
|
||||
static const char* const gB2GOnlyTypes[] = {
|
||||
"audio/3gpp",
|
||||
"audio/amr",
|
||||
"audio/x-matroska",
|
||||
"video/mp2t",
|
||||
"video/avi",
|
||||
"video/x-matroska",
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
@ -242,6 +256,12 @@ IsOmxSupportedType(const nsACString& aType)
|
|||
return CodecListContains(gOmxTypes, aType);
|
||||
}
|
||||
|
||||
static bool
|
||||
IsB2GSupportOnlyType(const nsACString& aType)
|
||||
{
|
||||
return CodecListContains(gB2GOnlyTypes, aType);
|
||||
}
|
||||
|
||||
static char const *const gH264Codecs[9] = {
|
||||
"avc1.42E01E", // H.264 Constrained Baseline Profile Level 3.0
|
||||
"avc1.42001E", // H.264 Baseline Profile Level 3.0
|
||||
|
@ -543,9 +563,9 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
|
|||
#endif
|
||||
#ifdef MOZ_OMX_DECODER
|
||||
if (IsOmxSupportedType(aType)) {
|
||||
// AMR audio is enabled for MMS, but we are discouraging Web and App
|
||||
// developers from using AMR, thus we only allow AMR to be played on WebApps.
|
||||
if (aType.EqualsLiteral(AUDIO_AMR) || aType.EqualsLiteral(AUDIO_3GPP)) {
|
||||
// we are discouraging Web and App developers from using those formats in
|
||||
// gB2GOnlyTypes, thus we only allow them to be played on WebApps.
|
||||
if (IsB2GSupportOnlyType(aType)) {
|
||||
dom::HTMLMediaElement* element = aOwner->GetMediaElement();
|
||||
if (!element) {
|
||||
return nullptr;
|
||||
|
@ -716,10 +736,11 @@ bool DecoderTraits::IsSupportedInVideoDocument(const nsACString& aType)
|
|||
return
|
||||
IsOggType(aType) ||
|
||||
#ifdef MOZ_OMX_DECODER
|
||||
// We support amr inside WebApps on firefoxOS but not in general web content.
|
||||
// Ensure we dont create a VideoDocument when accessing amr URLs directly.
|
||||
// We support the formats in gB2GOnlyTypes only inside WebApps on firefoxOS
|
||||
// but not in general web content. Ensure we dont create a VideoDocument
|
||||
// when accessing those format URLs directly.
|
||||
(IsOmxSupportedType(aType) &&
|
||||
(!aType.EqualsLiteral(AUDIO_AMR) && !aType.EqualsLiteral(AUDIO_3GPP))) ||
|
||||
!IsB2GSupportOnlyType(aType)) ||
|
||||
#endif
|
||||
#ifdef MOZ_WEBM
|
||||
IsWebMType(aType) ||
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
#define AUDIO_AMR "audio/amr"
|
||||
#define AUDIO_3GPP "audio/3gpp"
|
||||
#define AUDIO_MIDI "audio/x-midi"
|
||||
#define AUDIO_MATROSKA "audio/x-matroska"
|
||||
|
||||
#define BINARY_OCTET_STREAM "binary/octet-stream"
|
||||
|
||||
|
@ -148,6 +149,9 @@
|
|||
#define VIDEO_WEBM "video/webm"
|
||||
#define VIDEO_3GPP "video/3gpp"
|
||||
#define VIDEO_3GPP2 "video/3gpp2"
|
||||
#define VIDEO_MPEG_TS "video/mp2t"
|
||||
#define VIDEO_AVI "video/avi"
|
||||
#define VIDEO_MATROSKA "video/x-matroska"
|
||||
#define APPLICATION_OGG "application/ogg"
|
||||
|
||||
/* x-uuencode-apple-single. QuickMail made me do this. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Extensions we recognize for DeviceStorage storage areas
|
||||
pictures=*.jpe; *.jpg; *.jpeg; *.gif; *.png; *.bmp;
|
||||
music=*.mp3; *.oga; *.ogg; *.m4a; *.m4b; *.m4p; *.m4r; *.3gp; *.mp4; *.m3u; *.pls; *.opus; *.amr; *.wav; *.lcka;
|
||||
videos=*.mp4; *.mpeg; *.mpg; *.ogv; *.ogx; *.webm; *.3gp; *.3g2; *.ogg; *.m4v;
|
||||
music=*.mp3; *.oga; *.ogg; *.m4a; *.m4b; *.m4p; *.m4r; *.3gp; *.mp4; *.m3u; *.pls; *.opus; *.amr; *.wav; *.lcka; *.mka;
|
||||
videos=*.mp4; *.mpeg; *.mpg; *.ogv; *.ogx; *.webm; *.3gp; *.3g2; *.ogg; *.m4v; *.ts; *.m2ts; *.avi; *.divx; *.mkv;
|
||||
|
|
|
@ -542,6 +542,12 @@ static nsExtraMimeTypeEntry extraMimeEntries [] =
|
|||
{ AUDIO_OGG, "opus", "Opus Audio" },
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
{ AUDIO_AMR, "amr", "Adaptive Multi-Rate Audio" },
|
||||
{ VIDEO_AVI, "avi", "Audio Video Interleave" },
|
||||
{ VIDEO_AVI, "divx", "Audio Video Interleave" },
|
||||
{ VIDEO_MPEG_TS, "ts", "MPEG Transport Stream" },
|
||||
{ VIDEO_MPEG_TS, "m2ts", "MPEG-2 Transport Stream" },
|
||||
{ VIDEO_MATROSKA, "mkv", "MATROSKA VIDEO" },
|
||||
{ AUDIO_MATROSKA, "mka", "MATROSKA AUDIO" },
|
||||
#endif
|
||||
{ VIDEO_WEBM, "webm", "Web Media Video" },
|
||||
{ AUDIO_WEBM, "webm", "Web Media Audio" },
|
||||
|
|
Загрузка…
Ссылка в новой задаче