summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshuanglong.wang <shuanglong.wang@amlogic.com>2023-02-17 20:55:51 +0800
committerSungtak Lee <taklee@google.com>2023-03-07 21:24:31 +0000
commit480a8368385055a16dbabf95d112d2a06acb21c5 (patch)
tree5635cd631e6d951b55e385ac0a0dfa6a7de9ab32
parentce238dd4a6a4a860dd4a992c3aa50949b5f6b4bf (diff)
downloadav-480a8368385055a16dbabf95d112d2a06acb21c5.tar.gz
CCodec: Push blank buffer at the end of protected content
Push blank buffer at the end of playback if secure decoder was used or the content was specified as protected. Test: manual Bug: 268122557 Bug: 231689951 Change-Id: I71e87611b022a4c5216b27d9ebf181ff46b5a0c6
-rw-r--r--media/codec2/sfplugin/CCodec.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/codec2/sfplugin/CCodec.cpp b/media/codec2/sfplugin/CCodec.cpp
index 72301db7f3..f22db13f79 100644
--- a/media/codec2/sfplugin/CCodec.cpp
+++ b/media/codec2/sfplugin/CCodec.cpp
@@ -877,6 +877,16 @@ void CCodec::configure(const sp<AMessage> &msg) {
if (msg->findInt32(KEY_PUSH_BLANK_BUFFERS_ON_STOP, &pushBlankBuffersOnStop)) {
config->mPushBlankBuffersOnStop = pushBlankBuffersOnStop == 1;
}
+ // secure compoment or protected content default with
+ // "push-blank-buffers-on-shutdown" flag
+ if (!config->mPushBlankBuffersOnStop) {
+ int32_t usageProtected;
+ if (comp->getName().find(".secure") != std::string::npos) {
+ config->mPushBlankBuffersOnStop = true;
+ } else if (msg->findInt32("protected", &usageProtected) && usageProtected) {
+ config->mPushBlankBuffersOnStop = true;
+ }
+ }
}
}
setSurface(surface);