RDK Documentation (Open Sourced RDK Components)
AampDrmSession.cpp
Go to the documentation of this file.
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 2018 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 /**
21 * @file AampDrmSession.cpp
22 * @brief Source file for AampDrmSession.
23 */
24 
25 #include "AampDrmSession.h"
26 
27 /**
28  * @brief Constructor for AampDrmSession.
29  */
30 AampDrmSession::AampDrmSession(AampLogManager *logObj, const string &keySystem) : mLogObj(logObj), m_keySystem(keySystem),m_OutputProtectionEnabled(false)
31 #ifdef USE_SECMANAGER
32  , mSessionId(AAMP_SECMGR_INVALID_SESSION_ID)
33 #endif
34 {
35 }
36 
37 /**
38  * @brief Destructor for AampDrmSession..
39  */
41 {
42 }
43 
44 /**
45  * @brief Get the DRM System, ie, UUID for PlayReady WideVine etc..
46  */
48 {
49  return m_keySystem;
50 }
51 
52 /**
53  * @brief Function to decrypt GStreamer stream buffer.
54  */
55 int AampDrmSession::decrypt(GstBuffer* keyIDBuffer, GstBuffer* ivBuffer, GstBuffer* buffer, unsigned subSampleCount, GstBuffer* subSamplesBuffer, GstCaps* caps)
56 {
57  AAMPLOG_ERR("GST decrypt method not implemented");
58  return -1;
59 }
60 
61 /**
62  * @brief Function to decrypt stream buffer.
63  */
64 int AampDrmSession::decrypt(const uint8_t *f_pbIV, uint32_t f_cbIV, const uint8_t *payloadData, uint32_t payloadDataSize, uint8_t **ppOpaqueData)
65 {
66  AAMPLOG_ERR("Standard decrypt method not implemented");
67  return -1;
68 }
69 
70 #ifdef USE_SECMANAGER
71 void AampDrmSession::setSessionId(int64_t sessionId)
72 {
73  if (sessionId != AAMP_SECMGR_INVALID_SESSION_ID)
74  {
75  mSessionId = sessionId;
76  }
77 }
78 #endif
AampDrmSession::~AampDrmSession
virtual ~AampDrmSession()
Destructor for AampDrmSession..
Definition: AampDrmSession.cpp:40
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AampDrmSession::decrypt
virtual int decrypt(GstBuffer *keyIDBuffer, GstBuffer *ivBuffer, GstBuffer *buffer, unsigned subSampleCount, GstBuffer *subSamplesBuffer, GstCaps *caps=NULL)
Function to decrypt GStreamer stream buffer.
Definition: AampDrmSession.cpp:55
AampDrmSession::AampDrmSession
AampDrmSession(AampLogManager *logObj, const string &keySystem)
Constructor for AampDrmSession.
Definition: AampDrmSession.cpp:30
AampDrmSession::getKeySystem
string getKeySystem()
Get the DRM System, ie, UUID for PlayReady WideVine etc..
Definition: AampDrmSession.cpp:47
AampDrmSession.h
Header file for AampDrmSession.