• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
17  * @file ioffline_stream_operator.h
18  *
19  * @brief Declares APIs for offline stream operations.
20  *
21  * @since 1.0
22  * @version 1.0
23  */
24 
25 #ifndef HDI_OFFLINE_STREAM_OPERATOR_CLIENT_INF_H
26 #define HDI_OFFLINE_STREAM_OPERATOR_CLIENT_INF_H
27 
28 #include <list>
29 #include <map>
30 #include <vector>
31 #include <iservmgr_hdi.h>
32 #include <hdf_log.h>
33 #include "types.h"
34 
35 namespace OHOS::Camera {
36 enum {
37     CMD_OFFLINE_STREAM_OPERATOR_CANCEL_CAPTURE = 0,
38     CMD_OFFLINE_STREAM_OPERATOR_RELEASE_STREAMS,
39     CMD_OFFLINE_STREAM_OPERATOR_RELEASE,
40 };
41 
42 class IOfflineStreamOperator : public IRemoteBroker {
43 public:
44     DECLARE_INTERFACE_DESCRIPTOR(u"HDI.Camera.V1_0.OfflineStreamOperator");
45 
~IOfflineStreamOperator()46     virtual ~IOfflineStreamOperator() {}
47 
48     /**
49      * @brief Cancels a capture request.
50      *
51      * @param captureId Indicates the ID of the capture request to cancel.
52      *
53      * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined in {@link CamRetCode} otherwise.
54      *
55      * @since 1.0
56      * @version 1.0
57      */
58     virtual CamRetCode CancelCapture(int captureId) = 0;
59 
60     /**
61      * @brief Releases offline streams.
62      *
63      * @param streamIds Indicates the IDs of the offline streams to release.
64      *
65      * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined in {@link CamRetCode} otherwise.
66      *
67      * @since 1.0
68      * @version 1.0
69      */
70     virtual CamRetCode ReleaseStreams(const std::vector<int> &streamIds) = 0;
71 
72     /**
73      * @brief Releases all offline streams.
74      *
75      *
76      * @return Returns <b>NO_ERROR</b> if the operation is successful; returns an error code defined in {@link CamRetCode} otherwise.
77      *
78      * @since 1.0
79      * @version 1.0
80      */
81     virtual CamRetCode Release() = 0;
82 };
83 }
84 #endif // HDI_OFFLINE_STREAM_OPERATOR_CLIENT_INF_H
85