RDK Documentation (Open Sourced RDK Components)
opencdmMocks.h
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2022 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef AAMP_OPENCDM_MOCKS
21 #define AAMP_OPENCDM_MOCKS
22 
23 #include "open_cdm.h"
24 #include "open_cdm_adapter.h"
25 #include <gst/gst.h>
26 #include <gmock/gmock.h>
27 
29 {
30  public:
31  MOCK_METHOD(struct OpenCDMSystem *, opencdm_create_system, (const char keySystem[]));
32  MOCK_METHOD(OpenCDMError, opencdm_construct_session, (struct OpenCDMSystem* system,
33  const LicenseType licenseType,
34  const char initDataType[],
35  const uint8_t initData[],
36  const uint16_t initDataLength,
37  const uint8_t CDMData[],
38  const uint16_t CDMDataLength,
39  OpenCDMSessionCallbacks* callbacks,
40  void* userData,
41  struct OpenCDMSession** session));
42  MOCK_METHOD(OpenCDMError, opencdm_destruct_system, (struct OpenCDMSystem* system));
43  MOCK_METHOD(KeyStatus, opencdm_session_status, (const struct OpenCDMSession* session,
44  const uint8_t keyId[],
45  const uint8_t length));
46  MOCK_METHOD(OpenCDMError, opencdm_session_update, (struct OpenCDMSession* session,
47  const uint8_t keyMessage[],
48  const uint16_t keyLength));
49  MOCK_METHOD(OpenCDMError, opencdm_gstreamer_session_decrypt, (struct OpenCDMSession* session,
50  GstBuffer* buffer,
51  GstBuffer* subSample,
52  const uint32_t subSampleCount,
53  GstBuffer* IV,
54  GstBuffer* keyID,
55  uint32_t initWithLast15));
56  MOCK_METHOD(OpenCDMError, opencdm_session_decrypt, (struct OpenCDMSession* session,
57  uint8_t encrypted[],
58  const uint32_t encryptedLength,
59  const uint8_t* IV,
60  uint16_t IVLength,
61  const uint8_t* keyId,
62  const uint16_t keyIdLength,
63  uint32_t initWithLast15,
64  uint8_t* streamInfo,
65  uint16_t streamInfoLength));
66  MOCK_METHOD(OpenCDMError, opencdm_session_close, (struct OpenCDMSession* session));
67  MOCK_METHOD(OpenCDMError, opencdm_destruct_session, (struct OpenCDMSession* session));
68 };
69 
70 #endif /* AAMP_OPENCDM_MOCKS */
AampMockOpenCdm
Definition: opencdmMocks.h:28