1 /*
2  * Copyright (c) 2024 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 #ifndef IMAGE_RECEIVER_IMPL_H
16 #define IMAGE_RECEIVER_IMPL_H
17 
18 #include "ffi_remote_data.h"
19 #include "image_utils.h"
20 #include "image_receiver.h"
21 #include "image_receiver_manager.h"
22 #include "image_impl.h"
23 
24 namespace OHOS {
25 namespace Media {
26 class ImageReceiverImpl : public OHOS::FFI::FFIData {
27     DECL_TYPE(ImageReceiverImpl, OHOS::FFI::FFIData)
28 public:
29     explicit ImageReceiverImpl(std::shared_ptr<ImageReceiver> imageReceiver);
30     static int64_t CreateImageReceiver(int32_t width, int32_t height, int32_t format, int32_t capacity);
31     uint32_t GetSize(CSize *ret);
32     uint32_t GetCapacity(int32_t *ret);
33     uint32_t GetFormat(int32_t *ret);
34     char *GetReceivingSurfaceId();
35     sptr<ImageImpl> ReadNextImage();
36     sptr<ImageImpl> ReadLatestImage();
37     void Release();
38 
39 private:
40     std::shared_ptr<ImageReceiver> imageReceiver_;
41 };
42 
43 }
44 }
45 
46 #endif