summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-xmedia/libstagefright/OMXCodec.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index a4f3922..5327f3b 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -720,9 +720,32 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
}
}
+ if (mFlags & kUseSecureInputBuffers) {
+ (void)enableSecureMode();
+ }
+
return OK;
}
+status_t OMXCodec::enableSecureMode() {
+ OMX_INDEXTYPE index;
+
+ status_t err =
+ mOMX->getExtensionIndex(
+ mNode, "OMX.google.android.index.enableSecureMode", &index);
+
+ if (err != OK) {
+ return err;
+ }
+
+ EnableSecureModeParams params;
+ InitOMXParams(&params);
+
+ params.bEnableSecureMode = OMX_TRUE;
+
+ return mOMX->setConfig(mNode, index, &params, sizeof(params));
+}
+
void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
OMX_PARAM_PORTDEFINITIONTYPE def;
InitOMXParams(&def);