Loading include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ private: enum { kFlagIsSecure = 1, kFlagPushBlankBuffersToNativeWindowOnShutdown = 2, kFlagIsGrallocUsageProtected = 4, }; struct BufferInfo { Loading media/libmediaplayerservice/nuplayer/GenericSource.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ void NuPlayer::GenericSource::onPrepareAsync() { notifyFlagsChanged( (mIsSecure ? FLAG_SECURE : 0) | (mDecryptHandle != NULL ? FLAG_PROTECTED : 0) | FLAG_CAN_PAUSE | FLAG_CAN_SEEK_BACKWARD | FLAG_CAN_SEEK_FORWARD Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -1190,6 +1190,10 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { if (mSourceFlags & Source::FLAG_SECURE) { format->setInt32("secure", true); } if (mSourceFlags & Source::FLAG_PROTECTED) { format->setInt32("protected", true); } } if (audio) { Loading media/libmediaplayerservice/nuplayer/NuPlayerSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ struct NuPlayer::Source : public AHandler { FLAG_CAN_SEEK = 8, // the "seek bar" FLAG_DYNAMIC_DURATION = 16, FLAG_SECURE = 32, FLAG_PROTECTED = 64, }; enum { Loading media/libstagefright/ACodec.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( usage = 0; } if (mFlags & kFlagIsSecure) { if (mFlags & kFlagIsGrallocUsageProtected) { usage |= GRALLOC_USAGE_PROTECTED; } Loading Loading @@ -1262,6 +1262,16 @@ status_t ACodec::configureCodec( mStoreMetaDataInOutputBuffers = false; if (video && !encoder) { inputFormat->setInt32("adaptive-playback", false); int32_t usageProtected; if (msg->findInt32("protected", &usageProtected) && usageProtected) { if (!haveNativeWindow) { ALOGE("protected output buffers must be sent to an ANativeWindow"); return PERMISSION_DENIED; } mFlags |= kFlagIsGrallocUsageProtected; mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } } if (!encoder && video && haveNativeWindow) { sp<NativeWindowWrapper> windowWrapper( Loading Loading @@ -4627,6 +4637,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { if (componentName.endsWith(".secure")) { mCodec->mFlags |= kFlagIsSecure; mCodec->mFlags |= kFlagIsGrallocUsageProtected; mCodec->mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } Loading Loading
include/media/stagefright/ACodec.h +1 −0 Original line number Diff line number Diff line Loading @@ -131,6 +131,7 @@ private: enum { kFlagIsSecure = 1, kFlagPushBlankBuffersToNativeWindowOnShutdown = 2, kFlagIsGrallocUsageProtected = 4, }; struct BufferInfo { Loading
media/libmediaplayerservice/nuplayer/GenericSource.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ void NuPlayer::GenericSource::onPrepareAsync() { notifyFlagsChanged( (mIsSecure ? FLAG_SECURE : 0) | (mDecryptHandle != NULL ? FLAG_PROTECTED : 0) | FLAG_CAN_PAUSE | FLAG_CAN_SEEK_BACKWARD | FLAG_CAN_SEEK_FORWARD Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -1190,6 +1190,10 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { if (mSourceFlags & Source::FLAG_SECURE) { format->setInt32("secure", true); } if (mSourceFlags & Source::FLAG_PROTECTED) { format->setInt32("protected", true); } } if (audio) { Loading
media/libmediaplayerservice/nuplayer/NuPlayerSource.h +1 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ struct NuPlayer::Source : public AHandler { FLAG_CAN_SEEK = 8, // the "seek bar" FLAG_DYNAMIC_DURATION = 16, FLAG_SECURE = 32, FLAG_PROTECTED = 64, }; enum { Loading
media/libstagefright/ACodec.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -670,7 +670,7 @@ status_t ACodec::configureOutputBuffersFromNativeWindow( usage = 0; } if (mFlags & kFlagIsSecure) { if (mFlags & kFlagIsGrallocUsageProtected) { usage |= GRALLOC_USAGE_PROTECTED; } Loading Loading @@ -1262,6 +1262,16 @@ status_t ACodec::configureCodec( mStoreMetaDataInOutputBuffers = false; if (video && !encoder) { inputFormat->setInt32("adaptive-playback", false); int32_t usageProtected; if (msg->findInt32("protected", &usageProtected) && usageProtected) { if (!haveNativeWindow) { ALOGE("protected output buffers must be sent to an ANativeWindow"); return PERMISSION_DENIED; } mFlags |= kFlagIsGrallocUsageProtected; mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } } if (!encoder && video && haveNativeWindow) { sp<NativeWindowWrapper> windowWrapper( Loading Loading @@ -4627,6 +4637,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { if (componentName.endsWith(".secure")) { mCodec->mFlags |= kFlagIsSecure; mCodec->mFlags |= kFlagIsGrallocUsageProtected; mCodec->mFlags |= kFlagPushBlankBuffersToNativeWindowOnShutdown; } Loading