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 #ifndef OHOS_CAMERA_ISTREAM_REPEAT_CALLBACK_H
17 #define OHOS_CAMERA_ISTREAM_REPEAT_CALLBACK_H
18 
19 #include <cstdint>
20 #include "iremote_broker.h"
21 
22 namespace OHOS {
23 namespace CameraStandard {
24 enum class SketchStatus : int32_t {
25     STOPED = 0,
26     STARTED = 1,
27     STOPPING = 2,
28     STARTING = 3
29 };
30 
31 typedef struct {
32     SketchStatus status;
33     float sketchRatio;
34 } SketchStatusData;
35 
36 struct CaptureEndedInfoExt {
37     int streamId;
38     int frameCount;
39     bool isDeferredVideoEnhancementAvailable;
40     std::string videoId;
41 };
42 
43 class IStreamRepeatCallback : public IRemoteBroker {
44 public:
45     virtual int32_t OnFrameStarted() = 0;
46 
47     virtual int32_t OnFrameEnded(int32_t frameCount) = 0;
48 
49     virtual int32_t OnFrameError(int32_t errorCode) = 0;
50 
51     virtual int32_t OnSketchStatusChanged(SketchStatus status) = 0;
52 
53     virtual int32_t OnDeferredVideoEnhancementInfo(CaptureEndedInfoExt captureEndedInfo) = 0;
54 
55     DECLARE_INTERFACE_DESCRIPTOR(u"IStreamRepeatCallback");
56 };
57 } // namespace CameraStandard
58 } // namespace OHOS
59 #endif // OHOS_CAMERA_ISTREAM_REPEAT_CALLBACK_H
60