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

Commit 53f3f0c9 authored by Chong Zhang's avatar Chong Zhang Committed by android-build-merger
Browse files

Merge "heif: use width and height for decoder -- DO NOT MERGE" into pi-dev

am: 3cf131f8

Change-Id: Icf3810ae5aa35984d6ebff8a787f101c4b12c311
parents 04d9c3ee 3cf131f8
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -337,8 +337,8 @@ bool HeifDecoderImpl::init(HeifStream* stream, HeifFrameInfo* frameInfo) {

    if (frameInfo != nullptr) {
        frameInfo->set(
                videoFrame->mDisplayWidth,
                videoFrame->mDisplayHeight,
                videoFrame->mWidth,
                videoFrame->mHeight,
                videoFrame->mRotationAngle,
                videoFrame->mBytesPerPixel,
                videoFrame->mIccSize,
@@ -415,8 +415,8 @@ bool HeifDecoderImpl::decode(HeifFrameInfo* frameInfo) {

    if (frameInfo != nullptr) {
        frameInfo->set(
                videoFrame->mDisplayWidth,
                videoFrame->mDisplayHeight,
                videoFrame->mWidth,
                videoFrame->mHeight,
                videoFrame->mRotationAngle,
                videoFrame->mBytesPerPixel,
                videoFrame->mIccSize,
@@ -435,12 +435,12 @@ bool HeifDecoderImpl::getScanline(uint8_t* dst) {
        return false;
    }
    VideoFrame* videoFrame = static_cast<VideoFrame*>(mFrameMemory->pointer());
    if (mCurScanline >= videoFrame->mDisplayHeight) {
    if (mCurScanline >= videoFrame->mHeight) {
        ALOGE("no more scanline available");
        return false;
    }
    uint8_t* src = videoFrame->getFlattenedData() + videoFrame->mRowBytes * mCurScanline++;
    memcpy(dst, src, videoFrame->mBytesPerPixel * videoFrame->mDisplayWidth);
    memcpy(dst, src, videoFrame->mBytesPerPixel * videoFrame->mWidth);
    return true;
}

@@ -452,8 +452,8 @@ size_t HeifDecoderImpl::skipScanlines(size_t count) {

    uint32_t oldScanline = mCurScanline;
    mCurScanline += count;
    if (mCurScanline > videoFrame->mDisplayHeight) {
        mCurScanline = videoFrame->mDisplayHeight;
    if (mCurScanline > videoFrame->mHeight) {
        mCurScanline = videoFrame->mHeight;
    }
    return (mCurScanline > oldScanline) ? (mCurScanline - oldScanline) : 0;
}