mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Backed out changeset 49a711e67d8b (bug 1190379) for various android crashes CLOSED TREE
This commit is contained in:
parent
cd079d2bf9
commit
38fc20426e
@ -19,6 +19,7 @@
|
||||
#include "nsPromiseFlatString.h"
|
||||
|
||||
#include <jni.h>
|
||||
#include <string.h>
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gl;
|
||||
@ -33,21 +34,10 @@ namespace mozilla {
|
||||
NS_WARNING("callback not set"); \
|
||||
}
|
||||
|
||||
static const char* TranslateMimeType(const nsACString& aMimeType)
|
||||
{
|
||||
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
|
||||
return "video/x-vnd.on2.vp8";
|
||||
} else if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) {
|
||||
return "video/x-vnd.on2.vp9";
|
||||
}
|
||||
return PromiseFlatCString(aMimeType).get();
|
||||
}
|
||||
|
||||
static MediaCodec::LocalRef CreateDecoder(const nsACString& aMimeType)
|
||||
{
|
||||
MediaCodec::LocalRef codec;
|
||||
NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(TranslateMimeType(aMimeType),
|
||||
&codec), nullptr);
|
||||
NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(PromiseFlatCString(aMimeType).get(), &codec), nullptr);
|
||||
return codec;
|
||||
}
|
||||
|
||||
@ -297,7 +287,7 @@ AndroidDecoderModule::CreateVideoDecoder(
|
||||
MediaFormat::LocalRef format;
|
||||
|
||||
NS_ENSURE_SUCCESS(MediaFormat::CreateVideoFormat(
|
||||
TranslateMimeType(aConfig.mMimeType),
|
||||
aConfig.mMimeType,
|
||||
aConfig.mDisplay.width,
|
||||
aConfig.mDisplay.height,
|
||||
&format), nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user