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_VDI_CAMERA_V1_0_ISTREAMOPERATORVDI_H
17 #define OHOS_VDI_CAMERA_V1_0_ISTREAMOPERATORVDI_H
18 
19 #include <stdint.h>
20 #include <vector>
21 #include <hdf_base.h>
22 #include <hdi_base.h>
23 #include "buffer_producer_sequenceable.h"
24 #include "v1_0/ioffline_stream_operator_vdi.h"
25 #include "v1_0/istream_operator_vdi_callback.h"
26 #include "v1_0/vdi_types.h"
27 
28 namespace OHOS {
29 namespace VDI {
30 namespace Camera {
31 namespace V1_0 {
32 using namespace OHOS;
33 using namespace OHOS::HDI;
34 using namespace OHOS::HDI::Camera::V1_0;
35 
36 class IStreamOperatorVdi : public HdiBase {
37 public:
38     virtual ~IStreamOperatorVdi() = default;
39 
40     virtual int32_t IsStreamsSupported(VdiOperationMode mode, const std::vector<uint8_t> &modeSetting,
41          const std::vector<VdiStreamInfo> &infos, VdiStreamSupportType &type) = 0;
42 
43     virtual int32_t CreateStreams(const std::vector<VdiStreamInfo> &streamInfos) = 0;
44 
45     virtual int32_t ReleaseStreams(const std::vector<int32_t> &streamIds) = 0;
46 
47     virtual int32_t CommitStreams(VdiOperationMode mode, const std::vector<uint8_t> &modeSetting) = 0;
48 
49     virtual int32_t GetStreamAttributes(std::vector<VdiStreamAttribute> &attributes) = 0;
50 
51     virtual int32_t AttachBufferQueue(int32_t streamId, const sptr<BufferProducerSequenceable> &bufferProducer) = 0;
52 
53     virtual int32_t DetachBufferQueue(int32_t streamId) = 0;
54 
55     virtual int32_t Capture(int32_t captureId, const VdiCaptureInfo &info, bool isStreaming) = 0;
56 
57     virtual int32_t CancelCapture(int32_t captureId) = 0;
58 
59     virtual int32_t ChangeToOfflineStream(const std::vector<int32_t> &streamIds,
60          const sptr<IStreamOperatorVdiCallback> &callbackObj, sptr<IOfflineStreamOperatorVdi> &offlineOperator) = 0;
61 };
62 } // V1_0
63 } // Camera
64 } // VDI
65 } // OHOS
66 
67 #endif // OHOS_VDI_CAMERA_V1_0_ISTREAMOPERATORVDI_H
68