summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/FFMPEGSoftCodec.cpp
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-02 10:04:24 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-02 10:04:24 -0800
commit53f30099f701ef110ad7f16c4bec0c26eff9457a (patch)
treec9234632ef4fbb3a00c6b7361e544cc52ff9811a /media/libstagefright/FFMPEGSoftCodec.cpp
parentf474d172dd6796e85f5a8b0ae4e28b946e0415cd (diff)
downloadframeworks_av-53f30099f701ef110ad7f16c4bec0c26eff9457a.zip
frameworks_av-53f30099f701ef110ad7f16c4bec0c26eff9457a.tar.gz
frameworks_av-53f30099f701ef110ad7f16c4bec0c26eff9457a.tar.bz2
stagefright: More HW codec support w/ FFMPEGExtractor
* Support QC DiVX codec Change-Id: I5591b4544a8f92a7cc309b45a8de009f572217b7
Diffstat (limited to 'media/libstagefright/FFMPEGSoftCodec.cpp')
-rw-r--r--media/libstagefright/FFMPEGSoftCodec.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/media/libstagefright/FFMPEGSoftCodec.cpp b/media/libstagefright/FFMPEGSoftCodec.cpp
index 2af53b3..3e51322 100644
--- a/media/libstagefright/FFMPEGSoftCodec.cpp
+++ b/media/libstagefright/FFMPEGSoftCodec.cpp
@@ -73,6 +73,7 @@ static const MetaKeyEntry MetaKeyTable[] {
{kKeyWMAVersion , "wma-version" , INT32}, // int32_t
{kKeyWMVVersion , "wmv-version" , INT32},
{kKeyPCMFormat , "pcm-format" , INT32},
+ {kKeyDivXVersion , "divx-version" , INT32},
};
const char* FFMPEGSoftCodec::getMsgKey(int key) {
@@ -277,6 +278,14 @@ status_t FFMPEGSoftCodec::setVideoFormat(
if (err != BAD_TYPE && (strncmp(componentName, "OMX.qcom.", 9) == 0)) {
status_t xerr = OK;
+ if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX, mime)) {
+ *compressionFormat= (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
+ } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX4, mime)) {
+ *compressionFormat= (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
+ } else if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX311, mime)) {
+ *compressionFormat= (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
+ }
+
int32_t mode = 0;
OMX_QCOM_PARAM_PORTDEFINITIONTYPE portFmt;
portFmt.nPortIndex = kPortIndexInput;
@@ -295,6 +304,8 @@ status_t FFMPEGSoftCodec::setVideoFormat(
ALOGW("Failed to set frame packing format on component");
}
+ setQCDIVXFormat(msg, mime, OMXhandle, nodeID, kPortIndexOutput);
+
// Enable timestamp reordering for mpeg4 and vc1 codec types, the AVI file
// type, and hevc content in the ts container
bool tsReorder = false;
@@ -344,6 +355,46 @@ status_t FFMPEGSoftCodec::setVideoFormat(
return err;
}
+status_t FFMPEGSoftCodec::setQCDIVXFormat(
+ const sp<AMessage> &msg, const char* mime, sp<IOMX> OMXhandle,
+ IOMX::node_id nodeID, int port_index) {
+ status_t err = OK;
+#ifdef QCOM_HARDWARE
+ if (!strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX, mime) ||
+ !strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX4, mime) ||
+ !strcasecmp(MEDIA_MIMETYPE_VIDEO_DIVX311, mime)) {
+ ALOGV("Setting the QOMX_VIDEO_PARAM_DIVXTYPE params ");
+ QOMX_VIDEO_PARAM_DIVXTYPE paramDivX;
+ InitOMXParams(&paramDivX);
+ paramDivX.nPortIndex = port_index;
+ int32_t DivxVersion = 0;
+ if (!msg->findInt32(getMsgKey(kKeyDivXVersion), &DivxVersion)) {
+ DivxVersion = kTypeDivXVer_4;
+ ALOGW("Divx version key missing, initializing the version to %d", DivxVersion);
+ }
+ ALOGV("Divx Version Type %d", DivxVersion);
+
+ if (DivxVersion == kTypeDivXVer_4) {
+ paramDivX.eFormat = QOMX_VIDEO_DIVXFormat4;
+ } else if (DivxVersion == kTypeDivXVer_5) {
+ paramDivX.eFormat = QOMX_VIDEO_DIVXFormat5;
+ } else if (DivxVersion == kTypeDivXVer_6) {
+ paramDivX.eFormat = QOMX_VIDEO_DIVXFormat6;
+ } else if (DivxVersion == kTypeDivXVer_3_11 ) {
+ paramDivX.eFormat = QOMX_VIDEO_DIVXFormat311;
+ } else {
+ paramDivX.eFormat = QOMX_VIDEO_DIVXFormatUnused;
+ }
+ paramDivX.eProfile = (QOMX_VIDEO_DIVXPROFILETYPE)0; //Not used for now.
+
+ err = OMXhandle->setParameter(nodeID,
+ (OMX_INDEXTYPE)OMX_QcomIndexParamVideoDivx,
+ &paramDivX, sizeof(paramDivX));
+ }
+#endif
+ return err;
+}
+
status_t FFMPEGSoftCodec::getVideoPortFormat(OMX_U32 portIndex, int coding,
sp<AMessage> &notify, sp<IOMX> OMXHandle, IOMX::node_id nodeId) {