1 /*
2  * Copyright (c) 2023-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_CAMERASTANDARD_DEFERREDPROCESSING_DEFERREDVIDEOPROCESSINGSESSIONPROXY_H
17 #define OHOS_CAMERASTANDARD_DEFERREDPROCESSING_DEFERREDVIDEOPROCESSINGSESSIONPROXY_H
18 
19 #include "ideferred_video_processing_session.h"
20 #include <iremote_proxy.h>
21 
22 namespace OHOS {
23 namespace CameraStandard {
24 namespace DeferredProcessing {
25 class DeferredVideoProcessingSessionProxy : public IRemoteProxy<IDeferredVideoProcessingSession> {
26 public:
DeferredVideoProcessingSessionProxy(const sptr<IRemoteObject> & remote)27     explicit DeferredVideoProcessingSessionProxy(
28         const sptr<IRemoteObject>& remote)
29         : IRemoteProxy<IDeferredVideoProcessingSession>(remote)
30     {
31     }
32 
~DeferredVideoProcessingSessionProxy()33     virtual ~DeferredVideoProcessingSessionProxy()
34     {
35     }
36 
37     ErrCode BeginSynchronize() override;
38 
39     ErrCode EndSynchronize() override;
40 
41     ErrCode AddVideo(
42         const std::string& videoId,
43         const sptr<IPCFileDescriptor>& srcFd,
44         const sptr<IPCFileDescriptor>& dstFd) override;
45 
46     ErrCode RemoveVideo(
47         const std::string& videoId,
48         bool restorable) override;
49 
50     ErrCode RestoreVideo(
51         const std::string& videoId) override;
52 
53 private:
54     static constexpr int32_t COMMAND_BEGIN_SYNCHRONIZE = MIN_TRANSACTION_ID + 0;
55     static constexpr int32_t COMMAND_END_SYNCHRONIZE = MIN_TRANSACTION_ID + 1;
56     static constexpr int32_t COMMAND_ADD_VIDEO = MIN_TRANSACTION_ID + 2;
57     static constexpr int32_t COMMAND_REMOVE_VIDEO = MIN_TRANSACTION_ID + 3;
58     static constexpr int32_t COMMAND_RESTORE_VIDEO = MIN_TRANSACTION_ID + 4;
59 
60     static inline BrokerDelegator<DeferredVideoProcessingSessionProxy> delegator_;
61 };
62 } // namespace DeferredProcessing
63 } // namespace CameraStandard
64 } // namespace OHOS
65 #endif // OHOS_CAMERASTANDARD_DEFERREDPROCESSING_DEFERREDVIDEOPROCESSINGSESSIONPROXY_H
66 
67