OSDN Git Service

ACodec: only check crop rect on output port
authorLajos Molnar <lajos@google.com>
Wed, 8 Oct 2014 01:42:45 +0000 (18:42 -0700)
committerLajos Molnar <lajos@google.com>
Wed, 8 Oct 2014 01:44:46 +0000 (18:44 -0700)
Bug: 17789956
Change-Id: I0e17660d95ac0b3b051e7f555820188d9286571a

media/libstagefright/ACodec.cpp

index b693625..229e688 100644 (file)
@@ -3200,12 +3200,20 @@ status_t ACodec::getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify) {
                                         sizeof(describeParams.sMediaImage)));
                     }
 
+                    if (portIndex != kPortIndexOutput) {
+                        // TODO: also get input crop
+                        break;
+                    }
+
                     OMX_CONFIG_RECTTYPE rect;
                     InitOMXParams(&rect);
-                    rect.nPortIndex = kPortIndexOutput;
+                    rect.nPortIndex = portIndex;
 
                     if (mOMX->getConfig(
-                                mNode, OMX_IndexConfigCommonOutputCrop,
+                                mNode,
+                                (portIndex == kPortIndexOutput ?
+                                        OMX_IndexConfigCommonOutputCrop :
+                                        OMX_IndexConfigCommonInputCrop),
                                 &rect, sizeof(rect)) != OK) {
                         rect.nLeft = 0;
                         rect.nTop = 0;