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_HDI_DRM_V1_0_MEDIADECRYPTMODULESTUB_H
17 #define OHOS_HDI_DRM_V1_0_MEDIADECRYPTMODULESTUB_H
18 
19 #include <ipc_object_stub.h>
20 #include <message_option.h>
21 #include <message_parcel.h>
22 #include <object_collector.h>
23 #include <refbase.h>
24 #include "v1_0/imedia_decrypt_module.h"
25 
26 namespace OHOS {
27 namespace HDI {
28 namespace Drm {
29 namespace V1_0 {
30 
31 using namespace OHOS;
32 class MediaDecryptModuleStub : public IPCObjectStub {
33 public:
34     explicit MediaDecryptModuleStub(const sptr<IMediaDecryptModule> &impl);
35     virtual ~MediaDecryptModuleStub();
36 
37     int32_t OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
38 
39     static int32_t MediaDecryptModuleStubDecryptMediaData_(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption, sptr<OHOS::HDI::Drm::V1_0::IMediaDecryptModule> impl);
40 
41     static int32_t MediaDecryptModuleStubRelease_(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption, sptr<OHOS::HDI::Drm::V1_0::IMediaDecryptModule> impl);
42 
43     static int32_t MediaDecryptModuleStubGetVersion_(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption, sptr<OHOS::HDI::Drm::V1_0::IMediaDecryptModule> impl);
44 
45 private:
46     int32_t MediaDecryptModuleStubDecryptMediaData(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption);
47 
48     int32_t MediaDecryptModuleStubRelease(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption);
49 
50     int32_t MediaDecryptModuleStubGetVersion(MessageParcel& mediaDecryptModuleData, MessageParcel& mediaDecryptModuleReply, MessageOption& mediaDecryptModuleOption);
51 
52 
53     static inline ObjectDelegator<OHOS::HDI::Drm::V1_0::MediaDecryptModuleStub, OHOS::HDI::Drm::V1_0::IMediaDecryptModule> objDelegator_;
54     sptr<OHOS::HDI::Drm::V1_0::IMediaDecryptModule> impl_;
55 };
56 } // V1_0
57 } // Drm
58 } // HDI
59 } // OHOS
60 
61 #endif // OHOS_HDI_DRM_V1_0_MEDIADECRYPTMODULESTUB_H