am d8b00037: Merge "Opt in to the WVM extractor\'s secondary (cryptoPlugin) mode." into jb-dev

* commit 'd8b0003739768953b6e28080f434fdadec55c0e3':
  Opt in to the WVM extractor's secondary (cryptoPlugin) mode.
diff --git a/media/libstagefright/NuMediaExtractor.cpp b/media/libstagefright/NuMediaExtractor.cpp
index 5f3f63f..78b2469 100644
--- a/media/libstagefright/NuMediaExtractor.cpp
+++ b/media/libstagefright/NuMediaExtractor.cpp
@@ -98,6 +98,20 @@
         return ERROR_UNSUPPORTED;
     }
 
+    sp<MetaData> fileMeta = mImpl->getMetaData();
+    const char *containerMime;
+    if (fileMeta != NULL
+            && fileMeta->findCString(kKeyMIMEType, &containerMime)
+            && !strcasecmp(containerMime, "video/wvm")) {
+        // We always want to use "cryptoPluginMode" when using the wvm
+        // extractor. We can tell that it is this extractor by looking
+        // at the container mime type.
+        // The cryptoPluginMode ensures that the extractor will actually
+        // give us data in a call to MediaSource::read(), unlike its
+        // default mode that we use from AwesomePlayer.
+        static_cast<WVMExtractor *>(mImpl.get())->setCryptoPluginMode(true);
+    }
+
     mDataSource = dataSource;
 
     updateDurationAndBitrate();