• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 #include "audio_cenc_info_adapter_impl.h"
17 
18 namespace OHOS::NWeb {
19 
~AudioCencInfoAdapterImpl()20 AudioCencInfoAdapterImpl::~AudioCencInfoAdapterImpl() {}
21 
GetKeyId()22 uint8_t* AudioCencInfoAdapterImpl::GetKeyId()
23 {
24     return keyId_;
25 }
26 
GetKeyIdLen()27 uint32_t AudioCencInfoAdapterImpl::GetKeyIdLen()
28 {
29     return keyIdLen_;
30 }
31 
GetIv()32 uint8_t* AudioCencInfoAdapterImpl::GetIv()
33 {
34     return iv_;
35 }
36 
GetIvLen()37 uint32_t AudioCencInfoAdapterImpl::GetIvLen()
38 {
39     return ivLen_;
40 }
41 
GetAlgo()42 uint32_t AudioCencInfoAdapterImpl::GetAlgo()
43 {
44     return algo_;
45 }
46 
GetEncryptedBlockCount()47 uint32_t AudioCencInfoAdapterImpl::GetEncryptedBlockCount()
48 {
49     return encryptedBlockCount_;
50 }
51 
GetSkippedBlockCount()52 uint32_t AudioCencInfoAdapterImpl::GetSkippedBlockCount()
53 {
54     return skippedBlockCount_;
55 }
56 
GetFirstEncryptedOffset()57 uint32_t AudioCencInfoAdapterImpl::GetFirstEncryptedOffset()
58 {
59     return firstEncryptedOffset_;
60 }
61 
GetClearHeaderLens()62 std::vector<uint32_t> AudioCencInfoAdapterImpl::GetClearHeaderLens()
63 {
64     return clearHeaderLens_;
65 }
66 
GetPayLoadLens()67 std::vector<uint32_t> AudioCencInfoAdapterImpl::GetPayLoadLens()
68 {
69     return payLoadLens_;
70 }
71 
GetMode()72 uint32_t AudioCencInfoAdapterImpl::GetMode()
73 {
74     return mode_;
75 }
76 
SetKeyId(uint8_t * keyId)77 void AudioCencInfoAdapterImpl::SetKeyId(uint8_t* keyId)
78 {
79     keyId_ = keyId;
80 }
81 
SetKeyIdLen(uint32_t keyIdLen)82 void AudioCencInfoAdapterImpl::SetKeyIdLen(uint32_t keyIdLen)
83 {
84     keyIdLen_ = keyIdLen;
85 }
86 
SetIv(uint8_t * iv)87 void AudioCencInfoAdapterImpl::SetIv(uint8_t* iv)
88 {
89     iv_ = iv;
90 }
91 
SetIvLen(uint32_t ivLen)92 void AudioCencInfoAdapterImpl::SetIvLen(uint32_t ivLen)
93 {
94     ivLen_ = ivLen;
95 }
96 
SetAlgo(uint32_t algo)97 void AudioCencInfoAdapterImpl::SetAlgo(uint32_t algo)
98 {
99     algo_ = algo;
100 }
101 
SetEncryptedBlockCount(uint32_t count)102 void AudioCencInfoAdapterImpl::SetEncryptedBlockCount(uint32_t count)
103 {
104     encryptedBlockCount_ = count;
105 }
106 
SetSkippedBlockCount(uint32_t count)107 void AudioCencInfoAdapterImpl::SetSkippedBlockCount(uint32_t count)
108 {
109     skippedBlockCount_ = count;
110 }
111 
SetFirstEncryptedOffset(uint32_t offset)112 void AudioCencInfoAdapterImpl::SetFirstEncryptedOffset(uint32_t offset)
113 {
114     firstEncryptedOffset_ = offset;
115 }
116 
SetClearHeaderLens(const std::vector<uint32_t> & clearHeaderLens)117 void AudioCencInfoAdapterImpl::SetClearHeaderLens(const std::vector<uint32_t>& clearHeaderLens)
118 {
119     clearHeaderLens_ = clearHeaderLens;
120 }
121 
SetPayLoadLens(const std::vector<uint32_t> & payLoadLens)122 void AudioCencInfoAdapterImpl::SetPayLoadLens(const std::vector<uint32_t>& payLoadLens)
123 {
124     payLoadLens_ = payLoadLens;
125 }
126 
SetMode(uint32_t mode)127 void AudioCencInfoAdapterImpl::SetMode(uint32_t mode)
128 {
129     mode_ = mode;
130 }
131 
132 } // namespace OHOS::NWeb
133