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
16/**
17 * @file ivideo_process_session.h
18 *
19 * @brief Declares APIs for video process session.
20 *
21 * @since 5.0
22 * @version 1.0
23 */
24
25package ohos.hdi.camera.v1_3;
26
27import ohos.hdi.camera.v1_3.Types;
28import ohos.hdi.camera.v1_1.Types;
29
30interface IVideoProcessSession {
31
32    /**
33     * @brief Get the IDs of the pending video which are unprocessed.
34     *
35     * @param videoIds Indicates the IDs of the pending videos.
36     *
37     * @since 5.0
38     * @version 1.0
39     */
40    GetPendingVideos([out] List<String> videoIds);
41
42    /**
43     * @brief pending the prepare video.
44     *
45     * @param the id of the pending video.
46     * @param fd Indicates pending video file.
47     * @param streamDescs Indicates straem information.
48     *
49     * @since 5.0
50     * @version 1.0
51     */
52    Prepare([in] String videoId, [in] FileDescriptor fd, [out] StreamDescription []streamDescs);
53
54    /**
55     * @brief Creates streams.
56     *
57     * @param streamInfos Indicates the list of stream information, which is defined by {@link StreamInfo}.
58     *
59     * @return Returns <b>NO_ERROR</b> if the operation is successful;
60     * returns an error code defined in {@link CamRetCode} otherwise.
61     *
62     * @since 5.0
63     * @version 1.0
64     */
65    CreateStreams([in] struct StreamInfo_V1_1[] streamInfos);
66
67    /**
68     * @brief Configures a stream.
69     *
70     * This function must be called after {@link CreateStreams}.
71     *
72     * @param mode Indicates the operation mode of the stream. For details, see {@link OperationMode_V1_1}.
73     * @param modeSetting Indicates the stream configuration parameters, including the frame rate and zoom information
74     * @return Returns <b>NO_ERROR</b> if the operation is successful;
75     * returns an error code defined in {@link CamRetCode} otherwise.
76     *
77     * @since 5.0
78     * @version 1.0
79     */
80    CommitStreams([in] unsigned char[] modeSetting);
81
82    /**
83     * @brief Releases streams.
84     *
85     * @param streamInfos Indicates the information of the streams to release.
86     *
87     * @return Returns <b>NO_ERROR</b> if the operation is successful;
88     * returns an error code defined in {@link CamRetCode} otherwise.
89     *
90     * @since 5.0
91     * @version 1.0
92     */
93    ReleaseStreams([in] struct StreamInfo_V1_1[] streamInfos);
94
95    /**
96     * @brief Process the specific video by video ID.
97     *
98     * @param videoId Indicates video id.
99     * @param timestamp Indicates need process video frame time.
100     *
101     * @since 5.0
102     * @version 1.0
103     */
104    ProcessVideo([in] String videoId, [in] unsigned long timestamp);
105
106    /**
107     * @brief Remove the specific video by video ID.
108     *
109     * @param videoId Indicates video ID.
110     *
111     * @since 5.0
112     * @version 1.0
113     */
114    RemoveVideo([in] String videoId);
115
116    /**
117     * @brief Interrupt the process session.
118     *
119     * @since 5.0
120     * @version 1.0
121     */
122    Interrupt();
123
124    /**
125     * @brief Reset the process session.
126     *
127     * @since 5.0
128     * @version 1.0
129     */
130    Reset();
131}