45 lines
1.4 KiB
Diff
45 lines
1.4 KiB
Diff
From 9a240b125c01838dcd7be395354cd8d740b0923b Mon Sep 17 00:00:00 2001
|
|
From: Taehwan Kim <t_h.kim@samsung.com>
|
|
Date: Thu, 26 Nov 2020 22:40:40 +0900
|
|
Subject: [PATCH 30/30] CCodec: GraphicBufferSourceWrapper: fix to apply
|
|
nBufferCountActual for deciding number of inputs
|
|
|
|
Bug: 169398817
|
|
|
|
Change-Id: I58cd7da35a3ddc4abdb58df954307acf329c7ee7
|
|
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
|
|
(cherry picked from commit 8b3bcddbc98af38d64a1ffefd5932b498f9d4c36)
|
|
---
|
|
media/codec2/sfplugin/CCodec.cpp | 15 +++++++++++++--
|
|
1 file changed, 13 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/media/codec2/sfplugin/CCodec.cpp b/media/codec2/sfplugin/CCodec.cpp
|
|
index 54107bd852..2f16ca1104 100644
|
|
--- a/media/codec2/sfplugin/CCodec.cpp
|
|
+++ b/media/codec2/sfplugin/CCodec.cpp
|
|
@@ -246,8 +246,19 @@ public:
|
|
if (source == nullptr) {
|
|
return NO_INIT;
|
|
}
|
|
- constexpr size_t kNumSlots = 16;
|
|
- for (size_t i = 0; i < kNumSlots; ++i) {
|
|
+
|
|
+ size_t numSlots = 4;
|
|
+ constexpr OMX_U32 kPortIndexInput = 0;
|
|
+
|
|
+ OMX_PARAM_PORTDEFINITIONTYPE param;
|
|
+ param.nPortIndex = kPortIndexInput;
|
|
+ status_t err = mNode->getParameter(OMX_IndexParamPortDefinition,
|
|
+ ¶m, sizeof(param));
|
|
+ if (err == OK) {
|
|
+ numSlots = param.nBufferCountActual;
|
|
+ }
|
|
+
|
|
+ for (size_t i = 0; i < numSlots; ++i) {
|
|
source->onInputBufferAdded(i);
|
|
}
|
|
|
|
--
|
|
2.25.1
|
|
|