Skip to content

Commit

Permalink
CCodec: GraphicBufferSourceWrapper: fix to apply nBufferCountActual f…
Browse files Browse the repository at this point in the history
…or deciding number of inputs

Bug: 169398817

Change-Id: I58cd7da35a3ddc4abdb58df954307acf329c7ee7
Signed-off-by: Taehwan Kim <[email protected]>
(cherry picked from commit 8b3bcdd)
  • Loading branch information
Taehwan Kim authored and NurKeinNeid committed Apr 17, 2021
1 parent 3e51500 commit 1bf4bf8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions media/codec2/sfplugin/CCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,19 @@ class GraphicBufferSourceWrapper : public InputSurfaceWrapper {
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,
&param, sizeof(param));
if (err == OK) {
numSlots = param.nBufferCountActual;
}

for (size_t i = 0; i < numSlots; ++i) {
source->onInputBufferAdded(i);
}

Expand Down

0 comments on commit 1bf4bf8

Please sign in to comment.