Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a62b7fd authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "C2: Update graphic buffer allocation calls to allow odd dimensions" into main

parents dbb41d6e f6b3e5e9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include <media/openmax/OMX_Core.h>
#include <media/openmax/OMX_IndexExt.h>
#include <media/stagefright/foundation/avc_utils.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/omx/1.0/WGraphicBufferSource.h>
#include <media/stagefright/omx/OmxGraphicBufferSource.h>
#include <media/stagefright/CCodec.h>
@@ -1458,7 +1459,8 @@ void CCodec::configure(const sp<AMessage> &msg) {
                int64_t blockUsage =
                    usage.value | C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE;
                std::shared_ptr<C2GraphicBlock> block = FetchGraphicBlock(
                        width, height, componentColorFormat, blockUsage, {comp->getName()});
                        align(width, 2), align(height, 2), componentColorFormat, blockUsage,
                        {comp->getName()});
                sp<GraphicBlockBuffer> buffer;
                if (block) {
                    buffer = GraphicBlockBuffer::Allocate(
+2 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <C2PlatformSupport.h>

#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/foundation/MediaDefs.h>
#include <media/stagefright/CodecBase.h>
#include <media/stagefright/MediaCodecConstants.h>
@@ -57,7 +58,7 @@ sp<GraphicBlockBuffer> AllocateInputGraphicBuffer(

    std::shared_ptr<C2GraphicBlock> block;
    c2_status_t err = pool->fetchGraphicBlock(
            width, height, pixelFormat, fullUsage, &block);
            align(width, 2), align(height, 2), pixelFormat, fullUsage, &block);
    if (err != C2_OK) {
        ALOGD("fetch graphic block failed: %d", err);
        return nullptr;
+0 −2
Original line number Diff line number Diff line
@@ -593,8 +593,6 @@ status_t ConvertRGBToPlanarYUV(
        uint8_t *dstY, size_t dstStride, size_t dstVStride, size_t bufferSize,
        const C2GraphicView &src, C2Color::matrix_t colorMatrix, C2Color::range_t colorRange) {
    CHECK(dstY != nullptr);
    CHECK((src.width() & 1) == 0);
    CHECK((src.height() & 1) == 0);

    if (dstStride * dstVStride * 3 / 2 > bufferSize) {
        ALOGD("conversion buffer is too small for converting from RGB to YUV");