diff options
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 23 |
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(¶ms); + + params.bEnableSecureMode = OMX_TRUE; + + return mOMX->setConfig(mNode, index, ¶ms, sizeof(params)); +} + void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) { OMX_PARAM_PORTDEFINITIONTYPE def; InitOMXParams(&def); |