Merge "Expose an API to run the WV extractor in crypto plugin mode." into jb-dev
diff --git a/media/libstagefright/WVMExtractor.cpp b/media/libstagefright/WVMExtractor.cpp
index effe336..08d2ae2 100644
--- a/media/libstagefright/WVMExtractor.cpp
+++ b/media/libstagefright/WVMExtractor.cpp
@@ -127,6 +127,12 @@
     }
 }
 
+void WVMExtractor::setCryptoPluginMode(bool cryptoPluginMode) {
+    if (mImpl != NULL) {
+        mImpl->setCryptoPluginMode(cryptoPluginMode);
+    }
+}
+
 void WVMExtractor::setUID(uid_t uid) {
     if (mImpl != NULL) {
         mImpl->setUID(uid);
diff --git a/media/libstagefright/include/WVMExtractor.h b/media/libstagefright/include/WVMExtractor.h
index 3c3ca89..2b952e2 100644
--- a/media/libstagefright/include/WVMExtractor.h
+++ b/media/libstagefright/include/WVMExtractor.h
@@ -34,6 +34,7 @@
 
     virtual int64_t getCachedDurationUs(status_t *finalStatus) = 0;
     virtual void setAdaptiveStreamingMode(bool adaptive) = 0;
+    virtual void setCryptoPluginMode(bool cryptoPluginMode) = 0;
     virtual void setUID(uid_t uid) = 0;
 };
 
@@ -61,6 +62,12 @@
     // is used.
     void setAdaptiveStreamingMode(bool adaptive);
 
+    // setCryptoPluginMode(true) to select crypto plugin mode.
+    // In this mode, the extractor returns encrypted data for use
+    // with the MediaCodec model, which handles the decryption in the
+    // codec.
+    void setCryptoPluginMode(bool cryptoPluginMode);
+
     void setUID(uid_t uid);
 
     static bool getVendorLibHandle();