codec2: libv4l2_codec2_vndk is only for arc-nyc
In codec2 standard, allocators should be implemented under framework's vndk
library. However, master's allocator design is not compilable on arc-nyc. For
this reason, we implement libv4l2_codec2_vndk with allocators which should only
be used in arc-nyc (not in arc-pic).
Bug: 72354012
Test: run native tests on both arc-nyc and arc-pic
Change-Id: I2b2677e65a370c992f70bcd7fa3eb581a1c7f298
(cherry picked from commit e2dae6a1a56fb331a8789bd24b83ed4bdfc33ddd)
diff --git a/C2VDAComponent.cpp b/C2VDAComponent.cpp
index aa21370..5a303e5 100644
--- a/C2VDAComponent.cpp
+++ b/C2VDAComponent.cpp
@@ -13,11 +13,18 @@
#define __C2_GENERATE_GLOBAL_VARS__
#include <C2VDAComponent.h>
+
+#ifdef ANDROID_VERSION_NYC
+// Get allocators from NYC-specific implementation
#include <C2VDASupport.h>
+#else
+// Get allocators from framework
+#include <C2PlatformSupport.h>
+#endif
#include <videodev2.h>
-#include <C2PlatformSupport.h>
+#include <C2ComponentFactory.h>
#include <base/bind.h>
#include <base/bind_helpers.h>
@@ -956,7 +963,7 @@
ALOGI("Using C2BlockPool ID = %" PRIu64 " for allocating output buffers", poolId);
c2_status_t err;
if (!mOutputBlockPool || mOutputBlockPool->getLocalId() != poolId) {
- err = getCodec2BlockPool(poolId, shared_from_this(), &mOutputBlockPool);
+ err = GetCodec2BlockPool(poolId, shared_from_this(), &mOutputBlockPool);
if (err != C2_OK) {
ALOGE("Graphic block allocator is invalid");
reportError(err);
@@ -984,7 +991,7 @@
void C2VDAComponent::appendOutputBuffer(std::shared_ptr<C2GraphicBlock> block) {
GraphicBlockInfo info;
- info.mBlockId = mGraphicBlocks.size();
+ info.mBlockId = static_cast<int32_t>(mGraphicBlocks.size());
info.mGraphicBlock = std::move(block);
C2ConstGraphicBlock constBlock = info.mGraphicBlock->share(
@@ -995,7 +1002,7 @@
CHECK_NE(data, nullptr);
const C2PlanarLayout& layout = view.layout();
- ALOGV("allocate graphic buffer: %p, id: %u, size: %dx%d", info.mGraphicBlock->handle(),
+ ALOGV("allocate graphic buffer: %p, id: %d, size: %dx%d", info.mGraphicBlock->handle(),
info.mBlockId, info.mGraphicBlock->width(), info.mGraphicBlock->height());
// get offset from data pointers