1 /* 2 * Copyright (c) 2023-2023 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 #ifndef OHOS_DEFERRED_PROCESSING_SERVICE_BUFFER_INFO_H 17 #define OHOS_DEFERRED_PROCESSING_SERVICE_BUFFER_INFO_H 18 19 #include "ipc_file_descriptor.h" 20 #include "shared_buffer.h" 21 22 namespace OHOS { 23 namespace CameraStandard { 24 class PictureIntf; 25 namespace DeferredProcessing { 26 class BufferInfo { 27 public: 28 BufferInfo(const std::shared_ptr<SharedBuffer>& sharedBuffer, int32_t dataSize, bool isHighQuality, 29 uint32_t cloudImageEnhanceFlag); 30 ~BufferInfo(); 31 32 sptr<IPCFileDescriptor> GetIPCFileDescriptor(); 33 GetDataSize()34 inline int32_t GetDataSize() 35 { 36 return dataSize_; 37 } 38 IsHighQuality()39 inline bool IsHighQuality() 40 { 41 return isHighQuality_; 42 } 43 GetCloudImageEnhanceFlag()44 inline uint32_t GetCloudImageEnhanceFlag() 45 { 46 return cloudImageEnhanceFlag_; 47 } 48 49 private: 50 std::shared_ptr<SharedBuffer> sharedBuffer_; 51 const int32_t dataSize_; 52 const bool isHighQuality_; 53 uint32_t cloudImageEnhanceFlag_; 54 }; 55 class BufferInfoExt { 56 public: 57 explicit BufferInfoExt(std::shared_ptr<PictureIntf> picture, long dataSize, bool isHighQuality, 58 uint32_t cloudImageEnhanceFlag); 59 ~BufferInfoExt(); 60 std::shared_ptr<PictureIntf> GetPicture(); 61 long GetDataSize(); 62 bool IsHighQuality(); 63 uint32_t GetCloudImageEnhanceFlag(); 64 65 private: 66 std::shared_ptr<PictureIntf> picture_; 67 long dataSize_; 68 bool isHighQuality_; 69 uint32_t cloudImageEnhanceFlag_; 70 }; 71 } // namespace DeferredProcessing 72 } // namespace CameraStandard 73 } // namespace OHOS 74 #endif // OHOS_DEFERRED_PROCESSING_SERVICE_BUFFER_INFO_H