• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023-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 #ifndef OHOS_HDI_DRM_V1_0_MEDIADECRYPTMODULEPROXY_H
17 #define OHOS_HDI_DRM_V1_0_MEDIADECRYPTMODULEPROXY_H
18 
19 #include "v1_0/imedia_decrypt_module.h"
20 #include <iproxy_broker.h>
21 
22 namespace OHOS {
23 namespace HDI {
24 namespace Drm {
25 namespace V1_0 {
26 class MediaDecryptModuleProxy : public IProxyBroker<OHOS::HDI::Drm::V1_0::IMediaDecryptModule> {
27 public:
MediaDecryptModuleProxy(const sptr<IRemoteObject> & remote)28     explicit MediaDecryptModuleProxy(const sptr<IRemoteObject> &remote)
29         : IProxyBroker<OHOS::HDI::Drm::V1_0::IMediaDecryptModule>(remote)
30     {}
31 
32     virtual ~MediaDecryptModuleProxy() = default;
33 
IsProxy()34     inline bool IsProxy() override
35     {
36         return true;
37     }
38 
39     int32_t DecryptMediaData(bool secure, const OHOS::HDI::Drm::V1_0::CryptoInfo &cryptoInfo,
40         const OHOS::HDI::Drm::V1_0::DrmBuffer &srcBuffer, const OHOS::HDI::Drm::V1_0::DrmBuffer &destBuffer) override;
41 
42     int32_t Release() override;
43 
44     int32_t GetVersion(uint32_t &majorVer, uint32_t &minorVer) override;
45 
46     static int32_t DecryptMediaData_(bool secure, const OHOS::HDI::Drm::V1_0::CryptoInfo &cryptoInfo,
47         const OHOS::HDI::Drm::V1_0::DrmBuffer &srcBuffer, const OHOS::HDI::Drm::V1_0::DrmBuffer &destBuffer,
48         const sptr<IRemoteObject> remote);
49 
50     static int32_t Release_(const sptr<IRemoteObject> remote);
51 
52     static int32_t GetVersion_(uint32_t &majorVer, uint32_t &minorVer, const sptr<IRemoteObject> remote);
53 
54 private:
55     static inline BrokerDelegator<OHOS::HDI::Drm::V1_0::MediaDecryptModuleProxy> delegator_;
56 };
57 } // V1_0
58 } // Drm
59 } // HDI
60 } // OHOS
61 
62 #endif // OHOS_HDI_DRM_V1_0_MEDIADECRYPTMODULEPROXY_H