1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "imx8mm_image_buffer.h" 17 18 namespace OHOS::Camera { Imx8mmImageAdditionalInfo()19Imx8mmImageAdditionalInfo::Imx8mmImageAdditionalInfo() 20 { 21 offset_ = 0; 22 length_ = 0; 23 } 24 ~Imx8mmImageAdditionalInfo()25Imx8mmImageAdditionalInfo::~Imx8mmImageAdditionalInfo() 26 { 27 Free(); 28 } 29 GetInstance()30Imx8mmImageAdditionalInfo *Imx8mmImageAdditionalInfo::GetInstance() 31 { 32 static Imx8mmImageAdditionalInfo addiInfo; 33 return &addiInfo; 34 } 35 GetOffset() const36uint32_t Imx8mmImageAdditionalInfo::GetOffset() const 37 { 38 return offset_; 39 } 40 GetLength() const41uint32_t Imx8mmImageAdditionalInfo::GetLength() const 42 { 43 return length_; 44 } 45 SetOffset(const uint32_t offset)46void Imx8mmImageAdditionalInfo::SetOffset(const uint32_t offset) 47 { 48 offset_ = offset; 49 return; 50 } 51 SetLength(const uint32_t length)52void Imx8mmImageAdditionalInfo::SetLength(const uint32_t length) 53 { 54 length_ = length; 55 return; 56 } 57 Free()58void Imx8mmImageAdditionalInfo::Free() 59 { 60 offset_ = 0; 61 length_ = 0; 62 63 return; 64 } 65 } // namespace OHOS::Camera 66 67