Bug 1190379: Use AndroidDecoderModule for VP8/9. r=jya

This commit is contained in:
Jan Gerber 2015-07-30 00:39:53 +02:00 committed by Jean-Yves Avenard
parent 8da0ca76c8
commit bf5e1cfc83

View File

@ -37,7 +37,13 @@ namespace mozilla {
static MediaCodec::LocalRef CreateDecoder(const nsACString& aMimeType)
{
MediaCodec::LocalRef codec;
NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(PromiseFlatCString(aMimeType).get(), &codec), nullptr);
nsACString type = *aMimeType;
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
type = "video/x-vnd.on2.vp8";
} else if (aMimeType.EqualsLiteral("video/webm; codecs=vp9")) {
type = "video/x-vnd.on2.vp9";
}
NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(PromiseFlatCString(type).get(), &codec), nullptr);
return codec;
}