Merge "MediaCodec: Pass the crop rect to SoftwareRenderer"
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index f412dc8..674e6e5 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -729,6 +729,10 @@
                             CHECK(msg->findInt32("width", &width));
                             CHECK(msg->findInt32("height", &height));
 
+                            int32_t cropLeft, cropTop, cropRight, cropBottom;
+                            CHECK(msg->findRect("crop",
+                                &cropLeft, &cropTop, &cropRight, &cropBottom));
+
                             int32_t colorFormat;
                             CHECK(msg->findInt32(
                                         "color-format", &colorFormat));
@@ -736,6 +740,8 @@
                             sp<MetaData> meta = new MetaData;
                             meta->setInt32(kKeyWidth, width);
                             meta->setInt32(kKeyHeight, height);
+                            meta->setRect(kKeyCropRect,
+                                cropLeft, cropTop, cropRight, cropBottom);
                             meta->setInt32(kKeyColorFormat, colorFormat);
 
                             mSoftRenderer =