Skip to content
Snippets Groups Projects
Commit 210185e4 authored by Bartłomiej Grzesik's avatar Bartłomiej Grzesik
Browse files

V4L2DecodeInterface: Switch to GRALLOC allocator

This CL switches to output allocator to C2PlatformAllocatorStore::GRALLOC
that enforces use of C2PooledBufferPool without need of allocating a
separate allocator ID. For this reason V4L2AllocatorId::V4L2_BUFFERPOOL
is no longer used and is removed in this change.

Bug: 268301611
Bug: 268305422
Bug: 270329448
Bug: 238710012
Bug: 238390060
Bug: 270331759
Bug: 238709912
Test: CtsMediaCodecTestCases
Test: CtsMediaDecoderTestCases
Test: CtsMediaV2TestCases
Test: GtsExoPlayerTestCases com.google.android.exoplayer.gts.CommonEncryptionDrmTest#cencSchemeTypeV*
Change-Id: Ife2fbb6ac4ff2dc25e006792f8dad2d8ec6f4ac4
parent 347ef462
No related branches found
No related tags found
No related merge requests found
...@@ -329,7 +329,7 @@ V4L2DecodeInterface::V4L2DecodeInterface(const std::string& name, ...@@ -329,7 +329,7 @@ V4L2DecodeInterface::V4L2DecodeInterface(const std::string& name,
const C2Allocator::id_t inputAllocators[] = {secureMode ? V4L2AllocatorId::SECURE_LINEAR const C2Allocator::id_t inputAllocators[] = {secureMode ? V4L2AllocatorId::SECURE_LINEAR
: C2AllocatorStore::DEFAULT_LINEAR}; : C2AllocatorStore::DEFAULT_LINEAR};
const C2Allocator::id_t outputAllocators[] = {V4L2AllocatorId::V4L2_BUFFERPOOL}; const C2Allocator::id_t outputAllocators[] = {C2PlatformAllocatorStore::GRALLOC};
const C2Allocator::id_t surfaceAllocator = const C2Allocator::id_t surfaceAllocator =
secureMode ? V4L2AllocatorId::SECURE_GRAPHIC : C2PlatformAllocatorStore::BUFFERQUEUE; secureMode ? V4L2AllocatorId::SECURE_GRAPHIC : C2PlatformAllocatorStore::BUFFERQUEUE;
const C2BlockPool::local_id_t outputBlockPools[] = {C2BlockPool::BASIC_GRAPHIC}; const C2BlockPool::local_id_t outputBlockPools[] = {C2BlockPool::BASIC_GRAPHIC};
......
...@@ -43,7 +43,7 @@ std::optional<uint32_t> VideoFramePool::getBufferIdFromGraphicBlock(C2BlockPool& ...@@ -43,7 +43,7 @@ std::optional<uint32_t> VideoFramePool::getBufferIdFromGraphicBlock(C2BlockPool&
} }
return dmabufId.value(); return dmabufId.value();
} }
case V4L2AllocatorId::V4L2_BUFFERPOOL: case C2PlatformAllocatorStore::GRALLOC:
FALLTHROUGH; FALLTHROUGH;
case V4L2AllocatorId::SECURE_LINEAR: { case V4L2AllocatorId::SECURE_LINEAR: {
std::shared_ptr<_C2BlockPoolData> blockPoolData = std::shared_ptr<_C2BlockPoolData> blockPoolData =
...@@ -75,7 +75,7 @@ std::unique_ptr<VideoFramePool> VideoFramePool::Create( ...@@ -75,7 +75,7 @@ std::unique_ptr<VideoFramePool> VideoFramePool::Create(
uint64_t usage = static_cast<uint64_t>(BufferUsage::VIDEO_DECODER); uint64_t usage = static_cast<uint64_t>(BufferUsage::VIDEO_DECODER);
if (isSecure) { if (isSecure) {
usage |= C2MemoryUsage::READ_PROTECTED; usage |= C2MemoryUsage::READ_PROTECTED;
} else if (blockPool->getAllocatorId() == android::V4L2AllocatorId::V4L2_BUFFERPOOL) { } else if (blockPool->getAllocatorId() == C2PlatformAllocatorStore::GRALLOC) {
// CPU access to buffers is only required in byte buffer mode. // CPU access to buffers is only required in byte buffer mode.
usage |= C2MemoryUsage::CPU_READ; usage |= C2MemoryUsage::CPU_READ;
} }
......
...@@ -66,9 +66,6 @@ C2BlockPool* createBlockPool(C2Allocator::id_t allocatorId, C2BlockPool::local_i ...@@ -66,9 +66,6 @@ C2BlockPool* createBlockPool(C2Allocator::id_t allocatorId, C2BlockPool::local_i
} }
switch (allocatorId) { switch (allocatorId) {
case V4L2AllocatorId::V4L2_BUFFERPOOL:
return new C2PooledBlockPool(allocator, poolId);
case V4L2AllocatorId::SECURE_LINEAR: case V4L2AllocatorId::SECURE_LINEAR:
return new C2PooledBlockPool(allocator, poolId); return new C2PooledBlockPool(allocator, poolId);
......
...@@ -12,8 +12,7 @@ namespace V4L2AllocatorId { ...@@ -12,8 +12,7 @@ namespace V4L2AllocatorId {
// The allocator ids used for V4L2DecodeComponent. // The allocator ids used for V4L2DecodeComponent.
enum : C2AllocatorStore::id_t { enum : C2AllocatorStore::id_t {
V4L2_BUFFERPOOL = C2PlatformAllocatorStore::PLATFORM_END, SECURE_LINEAR = C2PlatformAllocatorStore::PLATFORM_END,
SECURE_LINEAR,
SECURE_GRAPHIC, SECURE_GRAPHIC,
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment