зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1233410 - Support VP8 video in OpenMAX PDM. r=alfredo
MozReview-Commit-ID: HVxynPLlXKJ
This commit is contained in:
Родитель
86ade93f25
Коммит
4ca43175f3
|
@ -35,6 +35,9 @@ extern mozilla::LogModule* GetPDMLog();
|
|||
return NS_ERROR_FAILURE; \
|
||||
} \
|
||||
|
||||
// Android proprietary value.
|
||||
#define ANDROID_OMX_VIDEO_CodingVP8 (static_cast<OMX_VIDEO_CODINGTYPE>(9))
|
||||
|
||||
using namespace android;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -618,12 +621,16 @@ GonkOmxPlatformLayer::FindComponents(const nsACString& aMimeType,
|
|||
useHardwareCodecOnly = true;
|
||||
}
|
||||
|
||||
const char* mime = aMimeType.Data();
|
||||
// Translate VP8 MIME type to Android format.
|
||||
if (aMimeType.EqualsLiteral("video/webm; codecs=vp8")) {
|
||||
mime = "video/x-vnd.on2.vp8";
|
||||
}
|
||||
|
||||
size_t start = 0;
|
||||
bool found = false;
|
||||
while (true) {
|
||||
ssize_t index = codecs->findCodecByType(aMimeType.Data(),
|
||||
false /* encoder */,
|
||||
start);
|
||||
ssize_t index = codecs->findCodecByType(mime, false /* encoder */, start);
|
||||
if (index < 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -652,4 +659,13 @@ GonkOmxPlatformLayer::FindComponents(const nsACString& aMimeType,
|
|||
return found;
|
||||
}
|
||||
|
||||
OMX_VIDEO_CODINGTYPE
|
||||
GonkOmxPlatformLayer::CompressionFormat()
|
||||
{
|
||||
MOZ_ASSERT(mInfo);
|
||||
|
||||
return mInfo->mMimeType.EqualsLiteral("video/webm; codecs=vp8") ?
|
||||
ANDROID_OMX_VIDEO_CodingVP8 : OmxPlatformLayer::CompressionFormat();
|
||||
}
|
||||
|
||||
} // mozilla
|
||||
|
|
|
@ -156,6 +156,11 @@ public:
|
|||
static bool FindComponents(const nsACString& aMimeType,
|
||||
nsTArray<ComponentInfo>* aComponents = nullptr);
|
||||
|
||||
// Android/QCOM decoder uses its own OMX_VIDEO_CodingVP8 definition in
|
||||
// frameworks/native/media/include/openmax/OMX_Video.h, not the one defined
|
||||
// in OpenMAX v1.1.2 OMX_VideoExt.h
|
||||
OMX_VIDEO_CODINGTYPE CompressionFormat() override;
|
||||
|
||||
protected:
|
||||
friend GonkBufferData;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче