Loading media/codec2/fuzzer/C2Fuzzer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ void Codec2Fuzzer::deInitDecoder() { } void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) { static const size_t kPageSize = getpagesize(); std::unique_ptr<BufferSource> bufferSource = std::make_unique<BufferSource>(data, size); if (!bufferSource) { return; Loading Loading @@ -270,7 +271,7 @@ void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) { work->input.ordinal.timestamp = 0; work->input.ordinal.frameIndex = ++numFrames; work->input.buffers.clear(); int32_t alignedSize = C2FUZZER_ALIGN(frameSize, PAGE_SIZE); int32_t alignedSize = C2FUZZER_ALIGN(frameSize, kPageSize); std::shared_ptr<C2LinearBlock> block; status = mLinearPool->fetchLinearBlock( Loading media/codec2/hal/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoDecTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -438,6 +438,7 @@ void decodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp std::ifstream& eleStream, android::Vector<FrameInfo>* Info, int offset, int range, bool signalEOS = true) { typedef std::unique_lock<std::mutex> ULock; static const size_t kPageSize = getpagesize(); int frameID = offset; int maxRetry = 0; while (1) { Loading Loading @@ -479,7 +480,7 @@ void decodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp ASSERT_EQ(eleStream.gcount(), size); work->input.buffers.clear(); auto alignedSize = ALIGN(size, PAGE_SIZE); auto alignedSize = ALIGN(size, kPageSize); if (size) { std::shared_ptr<C2LinearBlock> block; ASSERT_EQ(C2_OK, linearPool->fetchLinearBlock( Loading media/codec2/vndk/C2AllocatorIon.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public: static Impl *Alloc(int ionFd, size_t size, size_t align, unsigned heapMask, unsigned flags, C2Allocator::id_t id); c2_status_t map(size_t offset, size_t size, C2MemoryUsage usage, C2Fence *fence, void **addr) { static const size_t kPageSize = getpagesize(); (void)fence; // TODO: wait for fence *addr = nullptr; if (!mMappings.lock()->empty()) { Loading @@ -201,7 +202,7 @@ public: prot |= PROT_WRITE; } size_t alignmentBytes = offset % PAGE_SIZE; size_t alignmentBytes = offset % kPageSize; size_t mapOffset = offset - alignmentBytes; size_t mapSize = size + alignmentBytes; Mapping map = { nullptr, alignmentBytes, mapSize }; Loading media/codec2/vndk/C2DmaBufAllocator.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ class C2DmaBufAllocation : public C2LinearAllocation { c2_status_t C2DmaBufAllocation::map(size_t offset, size_t size, C2MemoryUsage usage, C2Fence* fence, void** addr) { static const size_t kPageSize = getpagesize(); (void)fence; // TODO: wait for fence *addr = nullptr; if (!mMappings.lock()->empty()) { Loading @@ -192,7 +193,7 @@ c2_status_t C2DmaBufAllocation::map(size_t offset, size_t size, C2MemoryUsage us prot |= PROT_WRITE; } size_t alignmentBytes = offset % PAGE_SIZE; size_t alignmentBytes = offset % kPageSize; size_t mapOffset = offset - alignmentBytes; size_t mapSize = size + alignmentBytes; Mapping map = {nullptr, alignmentBytes, mapSize}; Loading Loading
media/codec2/fuzzer/C2Fuzzer.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ void Codec2Fuzzer::deInitDecoder() { } void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) { static const size_t kPageSize = getpagesize(); std::unique_ptr<BufferSource> bufferSource = std::make_unique<BufferSource>(data, size); if (!bufferSource) { return; Loading Loading @@ -270,7 +271,7 @@ void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) { work->input.ordinal.timestamp = 0; work->input.ordinal.frameIndex = ++numFrames; work->input.buffers.clear(); int32_t alignedSize = C2FUZZER_ALIGN(frameSize, PAGE_SIZE); int32_t alignedSize = C2FUZZER_ALIGN(frameSize, kPageSize); std::shared_ptr<C2LinearBlock> block; status = mLinearPool->fetchLinearBlock( Loading
media/codec2/hal/hidl/1.0/vts/functional/video/VtsHalMediaC2V1_0TargetVideoDecTest.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -438,6 +438,7 @@ void decodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp std::ifstream& eleStream, android::Vector<FrameInfo>* Info, int offset, int range, bool signalEOS = true) { typedef std::unique_lock<std::mutex> ULock; static const size_t kPageSize = getpagesize(); int frameID = offset; int maxRetry = 0; while (1) { Loading Loading @@ -479,7 +480,7 @@ void decodeNFrames(const std::shared_ptr<android::Codec2Client::Component>& comp ASSERT_EQ(eleStream.gcount(), size); work->input.buffers.clear(); auto alignedSize = ALIGN(size, PAGE_SIZE); auto alignedSize = ALIGN(size, kPageSize); if (size) { std::shared_ptr<C2LinearBlock> block; ASSERT_EQ(C2_OK, linearPool->fetchLinearBlock( Loading
media/codec2/vndk/C2AllocatorIon.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -179,6 +179,7 @@ public: static Impl *Alloc(int ionFd, size_t size, size_t align, unsigned heapMask, unsigned flags, C2Allocator::id_t id); c2_status_t map(size_t offset, size_t size, C2MemoryUsage usage, C2Fence *fence, void **addr) { static const size_t kPageSize = getpagesize(); (void)fence; // TODO: wait for fence *addr = nullptr; if (!mMappings.lock()->empty()) { Loading @@ -201,7 +202,7 @@ public: prot |= PROT_WRITE; } size_t alignmentBytes = offset % PAGE_SIZE; size_t alignmentBytes = offset % kPageSize; size_t mapOffset = offset - alignmentBytes; size_t mapSize = size + alignmentBytes; Mapping map = { nullptr, alignmentBytes, mapSize }; Loading
media/codec2/vndk/C2DmaBufAllocator.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -170,6 +170,7 @@ class C2DmaBufAllocation : public C2LinearAllocation { c2_status_t C2DmaBufAllocation::map(size_t offset, size_t size, C2MemoryUsage usage, C2Fence* fence, void** addr) { static const size_t kPageSize = getpagesize(); (void)fence; // TODO: wait for fence *addr = nullptr; if (!mMappings.lock()->empty()) { Loading @@ -192,7 +193,7 @@ c2_status_t C2DmaBufAllocation::map(size_t offset, size_t size, C2MemoryUsage us prot |= PROT_WRITE; } size_t alignmentBytes = offset % PAGE_SIZE; size_t alignmentBytes = offset % kPageSize; size_t mapOffset = offset - alignmentBytes; size_t mapSize = size + alignmentBytes; Mapping map = {nullptr, alignmentBytes, mapSize}; Loading