summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/media/stagefright/FFMPEGSoftCodec.h4
-rw-r--r--media/libstagefright/FFMPEGSoftCodec.cpp51
2 files changed, 55 insertions, 0 deletions
diff --git a/include/media/stagefright/FFMPEGSoftCodec.h b/include/media/stagefright/FFMPEGSoftCodec.h
index 2f31e72..30dafb8 100644
--- a/include/media/stagefright/FFMPEGSoftCodec.h
+++ b/include/media/stagefright/FFMPEGSoftCodec.h
@@ -128,6 +128,10 @@ private:
const sp<AMessage> &msg, sp<IOMX> OMXhandle,
IOMX::node_id nodeID);
+ static status_t setQCDIVXFormat(
+ const sp<AMessage> &msg, const char* mime,
+ sp<IOMX> OMXhandle, IOMX::node_id nodeID, int port_index);
+
};
}
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) {