C2SoftFlacEnc: Update max input buffer size calculation
INPUT_MAX_BUFFER_SIZE is now set based on channel count and
pcm encoding mode.
Bug: 332051852
Test: atest CtsMediaV2TestCases -- --module-arg CtsMediaV2TestCases:\
instrumentation-arg:codec-prefix:=c2.android.flac
Change-Id: I9edf56de98e5ad73dd2cbec15f74d04e90f62124
diff --git a/media/codec2/components/flac/C2SoftFlacEnc.h b/media/codec2/components/flac/C2SoftFlacEnc.h
index a971ab5..1f3be3c 100644
--- a/media/codec2/components/flac/C2SoftFlacEnc.h
+++ b/media/codec2/components/flac/C2SoftFlacEnc.h
@@ -63,7 +63,8 @@
std::shared_ptr<IntfImpl> mIntf;
const unsigned int kInBlockSize = 1152;
- const unsigned int kMaxNumChannels = 2;
+ static constexpr unsigned int kMaxNumChannels = 2;
+ static constexpr unsigned int kMaxBlockSize = 4608;
FLAC__StreamEncoder* mFlacStreamEncoder;
FLAC__int32* mInputBufferPcm32;
std::shared_ptr<C2LinearBlock> mOutputBlock;