"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srcs/common/freespacebox.cpp" between
heif-3.6.1.tar.gz and heif-3.6.2.tar.gz

About: HEIF (High Efficiency Image File Format) is a visual media container format for images and image sequences (MPEG-standard). This HEIF engine demonstrates its powerful features and capabilities (under Nokia HEIF license).

freespacebox.cpp  (heif-3.6.1):freespacebox.cpp  (heif-3.6.2)
/* This file is part of Nokia HEIF library /* This file is part of Nokia HEIF library
* *
* Copyright (c) 2015-2018 Nokia Corporation and/or its subsidiary(-ies). All ri ghts reserved. * Copyright (c) 2015-2021 Nokia Corporation and/or its subsidiary(-ies). All ri ghts reserved.
* *
* Contact: heif@nokia.com * Contact: heif@nokia.com
* *
* This software, including documentation, is protected by copyright controlled by Nokia Corporation and/ or its * This software, including documentation, is protected by copyright controlled by Nokia Corporation and/ or its
* subsidiaries. All rights are reserved. * subsidiaries. All rights are reserved.
* *
* Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior * Copying, including reproducing, storing, adapting or translating, any or all of this material requires the prior
* written consent of Nokia. * written consent of Nokia.
*/ */
#include "freespacebox.hpp" #include "freespacebox.hpp"
FreeSpaceBox::FreeSpaceBox() FreeSpaceBox::FreeSpaceBox()
: Box("free") : Box("free")
{ {
} }
bool FreeSpaceBox::setSize(const std::uint32_t size)
{
const auto BOX_HEADER_SIZE = 8u;
if (size < BOX_HEADER_SIZE)
{
return false;
}
Box::setSize(size);
return true;
}
void FreeSpaceBox::writeBox(ISOBMFF::BitStream& bitstr) const void FreeSpaceBox::writeBox(ISOBMFF::BitStream& bitstr) const
{ {
const auto boxStart = bitstr.getPos(); const auto boxStart = bitstr.getSize();
writeBoxHeader(bitstr); writeBoxHeader(bitstr);
const auto fillSize = boxStart + Box::getSize() - bitstr.getPos(); const auto fillSize = boxStart + Box::getSize() - bitstr.getSize();
for (unsigned int i = 0; i < fillSize; ++i) for (unsigned int i = 0; i < fillSize; ++i)
{ {
bitstr.write8Bits(0); bitstr.write8Bits(0);
} }
updateSize(bitstr); updateSize(bitstr);
} }
void FreeSpaceBox::parseBox(ISOBMFF::BitStream& bitstr) void FreeSpaceBox::parseBox(ISOBMFF::BitStream& bitstr)
{ {
parseBoxHeader(bitstr); parseBoxHeader(bitstr);
 End of changes. 4 change blocks. 
3 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)