1/* 2 * Copyright (c) 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_HDI_BUFFER_HANDLE_SEQUENCEABLE_H 17#define OHOS_HDI_BUFFER_HANDLE_SEQUENCEABLE_H 18 19#include <parcel.h> 20#include <string> 21#include <vector> 22#include "buffer_handle.h" 23 24namespace OHOS { 25namespace HDI { 26namespace Camera { 27namespace V1_0 { 28using OHOS::Parcelable; 29using OHOS::Parcel; 30using OHOS::sptr; 31class BufferHandleSequenceable : public Parcelable { 32public: 33 virtual ~BufferHandleSequenceable() = default; 34 35 explicit BufferHandleSequenceable(BufferHandle *bufferHandle = nullptr); 36 explicit BufferHandleSequenceable(const BufferHandle &bufferHandle); 37 38 bool Marshalling(Parcel &parcel) const override; 39 static sptr<BufferHandleSequenceable> Unmarshalling(Parcel &parcel); 40 static BufferHandle* NewBufferHandle(uint32_t reserveFds, uint32_t reserveInts); 41 void SetBufferHandle(BufferHandle *handle); 42 BufferHandle* GetBufferHandle(); 43private: 44 class BufferHandleWrap; 45 std::shared_ptr<BufferHandleWrap> bufferHandleWrap_; 46}; 47} // V1_0 48} // Camera 49} // HDI 50} // OHOS 51#endif // OHOS_HDI_BUFFER_HANDLE_SEQUENCEABLE_H 52