RDK Documentation (Open Sourced RDK Components)
aamp_aes.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 aamp_aes.cpp
22  * @brief HLS AES drm decryptor
23  */
24 
25 
26 #include "aamp_aes.h"
27 
28 #include <sys/time.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <pthread.h>
32 #include <errno.h>
33 
34 
35 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
36 #define OPEN_SSL_CONTEXT mOpensslCtx
37 #else
38 #define OPEN_SSL_CONTEXT &mOpensslCtx
39 #endif
40 #define AES_128_KEY_LEN_BYTES 16
41 
42 static pthread_mutex_t instanceLock = PTHREAD_MUTEX_INITIALIZER;
43 
44 /**
45  * @brief key acquistion thread
46  * @param arg AesDec pointer
47  * @retval NULL
48  */
49 static void * acquire_key(void* arg)
50 {
51  AesDec *aesDec = (AesDec *)arg;
52  aesDec->AcquireKey();
53  return NULL;
54 }
55 
56 /**
57  * @brief Notify drm error
58  */
60 {
61  //If downloads are disabled, don't send error event upstream
62  if (mpAamp->DownloadsAreEnabled())
63  {
64  mpAamp->DisableDownloads();
65  if(AAMP_TUNE_UNTRACKED_DRM_ERROR == drmFailure)
66  {
67  mpAamp->SendErrorEvent(drmFailure, "AAMP: DRM Failure" );
68  }
69  else
70  {
71  mpAamp->SendErrorEvent(drmFailure);
72  }
73  }
75  AAMPLOG_ERR("AesDec::NotifyDRMError: drmState:%d", mDrmState );
76 }
77 
78 
79 /**
80  * @brief Signal drm error
81  */
83 {
84  pthread_mutex_lock(&mMutex);
85  mDrmState = eDRM_KEY_FAILED;
86  pthread_cond_broadcast(&mCond);
87  pthread_mutex_unlock(&mMutex);
88 }
89 
90 
91 /**
92  * @brief Signal key acquired event
93  */
95 {
96  AAMPLOG_WARN("aamp:AesDRMListener drmState:%d moving to KeyAcquired", mDrmState);
97  pthread_mutex_lock(&mMutex);
98  mDrmState = eDRM_KEY_ACQUIRED;
99  pthread_cond_broadcast(&mCond);
100  pthread_mutex_unlock(&mMutex);
101  mpAamp->LogDrmInitComplete();
102 }
103 
104 /**
105  * @brief Acquire drm key from URI
106  */
108 {
109  std::string tempEffectiveUrl;
110  std::string keyURI;
111  long http_error = 0; //CID:88814 - Initialization
112  double downloadTime = 0.0;
113  bool keyAcquisitionStatus = false;
115 
116  if (aamp_pthread_setname(pthread_self(), "aampAesDRM"))
117  {
118  AAMPLOG_ERR("pthread_setname_np failed");
119  }
120  aamp_ResolveURL(keyURI, mDrmInfo.manifestURL, mDrmInfo.keyURI.c_str(), mDrmInfo.bPropagateUriParams);
121  AAMPLOG_WARN("Key acquisition start uri = %s", keyURI.c_str());
122  bool fetched = mpAamp->GetFile(keyURI, &mAesKeyBuf, tempEffectiveUrl, &http_error, &downloadTime, NULL, mCurlInstance, true, eMEDIATYPE_LICENCE);
123  if (fetched)
124  {
125  if (AES_128_KEY_LEN_BYTES == mAesKeyBuf.len)
126  {
127  AAMPLOG_WARN("Key fetch success len = %d", (int)mAesKeyBuf.len);
128  keyAcquisitionStatus = true;
129  }
130  else
131  {
132  AAMPLOG_ERR("Error Key fetch - size %d", (int)mAesKeyBuf.len);
133  failureReason = AAMP_TUNE_INVALID_DRM_KEY;
134  }
135  }
136  else
137  {
138  AAMPLOG_ERR("Key fetch failed");
139  if (http_error == CURLE_OPERATION_TIMEDOUT)
140  {
141  failureReason = AAMP_TUNE_LICENCE_TIMEOUT;
142  }
143  else
144  {
145  failureReason = AAMP_TUNE_LICENCE_REQUEST_FAILED;
146  }
147  }
148 
149  if(keyAcquisitionStatus)
150  {
152  }
153  else
154  {
155  aamp_Free(&mAesKeyBuf); //To cleanup previous successful key if any
156  NotifyDRMError(failureReason);
157  }
158 }
159 
160 /**
161  * @brief Set DRM meta-data. Stub implementation
162  *
163  */
164 DrmReturn AesDec::SetMetaData( PrivateInstanceAAMP *aamp, void* metadata,int trackType, AampLogManager *mLogObj)
165 {
166  return eDRM_SUCCESS;
167 }
168 
169 /**
170  * @brief AcquireKey Function to acquire key . Stub implementation
171  */
172 void AesDec::AcquireKey( class PrivateInstanceAAMP *aamp, void *metadata,int trackType, AampLogManager *mLogObj)
173 {
174 
175 }
176 
177 /**
178  * @brief GetState Function to get current DRM State
179  *
180  */
182 {
183  return mDrmState;
184 }
185 
186 /**
187  * @brief Set information required for decryption
188  *
189  */
191 {
192  DrmReturn err = eDRM_ERROR;
193  pthread_mutex_lock(&mMutex);
194  mpAamp = aamp;
195 
196  if (NULL!= mpAamp)
197  {
198  mpAamp->mConfig->GetConfigValue(eAAMPConfig_LicenseKeyAcquireWaitTime, mAcquireKeyWaitTime);
199  }
200  if (mDrmState == eDRM_ACQUIRING_KEY)
201  {
202  AAMPLOG_WARN("AesDec:: acquiring key in progress");
203  WaitForKeyAcquireCompleteUnlocked(mAcquireKeyWaitTime, err);
204  }
205  mDrmInfo = *drmInfo;
206 
207  if (!mDrmUrl.empty())
208  {
209  if ((eDRM_KEY_ACQUIRED == mDrmState) && (drmInfo->keyURI == mDrmUrl))
210  {
211  AAMPLOG_TRACE("AesDec: same url:%s - not acquiring key", mDrmUrl.c_str());
212  pthread_mutex_unlock(&mMutex);
213  return eDRM_SUCCESS;
214  }
215  }
216  mDrmUrl = drmInfo->keyURI;
217  mDrmState = eDRM_ACQUIRING_KEY;
218  mPrevDrmState = eDRM_INITIALIZED;
219  if (-1 == mCurlInstance)
220  {
221  mCurlInstance = eCURLINSTANCE_AES;
222  aamp->CurlInit((AampCurlInstance)mCurlInstance,1,aamp->GetLicenseReqProxy());
223  }
224 
225  if (licenseAcquisitionThreadStarted)
226  {
227  int ret = pthread_join(licenseAcquisitionThreadId, NULL);
228  if (ret != 0)
229  {
230  AAMPLOG_ERR("AesDec:: pthread_join failed for license acquisition thread: %d", licenseAcquisitionThreadId);
231  }
232  licenseAcquisitionThreadStarted = false;
233  }
234 
235  int ret = pthread_create(&licenseAcquisitionThreadId, NULL, acquire_key, this);
236  if(ret != 0)
237  {
238  AAMPLOG_ERR("AesDec:: pthread_create failed for acquire_key with errno = %d, %s", errno, strerror(errno));
239  mDrmState = eDRM_KEY_FAILED;
240  licenseAcquisitionThreadStarted = false;
241  }
242  else
243  {
244  err = eDRM_SUCCESS;
245  licenseAcquisitionThreadStarted = true;
246  }
247  pthread_mutex_unlock(&mMutex);
248  AAMPLOG_INFO("AesDec: drmState:%d ", mDrmState);
249  return err;
250 }
251 
252 /**
253  * @brief Wait for key acquisition completion
254  */
256 {
257  struct timespec ts;
258  AAMPLOG_INFO( "aamp:waiting for key acquisition to complete,wait time:%d",timeInMs );
259  ts = aamp_GetTimespec(timeInMs);
260 
261  if(0 != pthread_cond_timedwait(&mCond, &mMutex, &ts)) // block until drm ready
262  {
263  AAMPLOG_WARN("AesDec:: wait for key acquisition timed out");
265  }
266 }
267 
268 /**
269  * @brief Decrypts an encrypted buffer
270  */
271 DrmReturn AesDec::Decrypt( ProfilerBucketType bucketType, void *encryptedDataPtr, size_t encryptedDataLen,int timeInMs)
272 {
273  DrmReturn err = eDRM_ERROR;
274 
275  pthread_mutex_lock(&mMutex);
276  if (mDrmState == eDRM_ACQUIRING_KEY)
277  {
278  WaitForKeyAcquireCompleteUnlocked(timeInMs, err);
279  }
280  if (mDrmState == eDRM_KEY_ACQUIRED)
281  {
282  AAMPLOG_INFO("AesDec: Starting decrypt");
283  unsigned char *decryptedDataBuf = (unsigned char *)malloc(encryptedDataLen);
284  int decryptedDataLen = 0;
285  if (decryptedDataBuf)
286  {
287  int decLen = encryptedDataLen;
288  memset(decryptedDataBuf, 0, encryptedDataLen);
289  mpAamp->LogDrmDecryptBegin(bucketType);
290  if(!EVP_DecryptInit_ex(OPEN_SSL_CONTEXT, EVP_aes_128_cbc(), NULL, (unsigned char*)mAesKeyBuf.ptr, mDrmInfo.iv))
291  {
292  AAMPLOG_ERR( "AesDec::EVP_DecryptInit_ex failed mDrmState = %d",(int)mDrmState);
293  }
294  else
295  {
296  if (!EVP_DecryptUpdate(OPEN_SSL_CONTEXT, decryptedDataBuf, &decLen, (const unsigned char*) encryptedDataPtr, encryptedDataLen))
297  {
298  AAMPLOG_ERR("AesDec::EVP_DecryptUpdate failed mDrmState = %d",(int) mDrmState);
299  }
300  else
301  {
302  decryptedDataLen = decLen;
303  decLen = 0;
304  AAMPLOG_INFO("AesDec: EVP_DecryptUpdate success decryptedDataLen = %d encryptedDataLen %d", (int) decryptedDataLen, (int)encryptedDataLen);
305  if (!EVP_DecryptFinal_ex(OPEN_SSL_CONTEXT, decryptedDataBuf + decryptedDataLen, &decLen))
306  {
307  AAMPLOG_ERR("AesDec::EVP_DecryptFinal_ex failed mDrmState = %d",
308  (int) mDrmState);
309  }
310  else
311  {
312  decryptedDataLen += decLen;
313  AAMPLOG_INFO("AesDec: decrypt success");
314  err = eDRM_SUCCESS;
315  }
316  }
317  }
318  mpAamp->LogDrmDecryptEnd(bucketType);
319 
320  memcpy(encryptedDataPtr, decryptedDataBuf, encryptedDataLen);
321  free(decryptedDataBuf);
322  }
323  }
324  else
325  {
326  AAMPLOG_ERR( "AesDec::key acquisition failure! mDrmState = %d",(int)mDrmState);
327  }
328  pthread_mutex_unlock(&mMutex);
329  return err;
330 }
331 
332 
333 /**
334  * @brief Release drm session
335  */
337 {
338  DrmReturn err = eDRM_ERROR;
339  pthread_mutex_lock(&mMutex);
340  //We wait for license acquisition to complete. Once license acquisition is complete
341  //the appropriate state will be set to mDrmState and hence RestoreKeyState will be a no-op.
342  if ( ( mDrmState == eDRM_ACQUIRING_KEY || mPrevDrmState == eDRM_ACQUIRING_KEY ) && mDrmState != eDRM_KEY_FAILED )
343  {
344  WaitForKeyAcquireCompleteUnlocked(mAcquireKeyWaitTime, err);
345  }
346  if (licenseAcquisitionThreadStarted)
347  {
348  int ret = pthread_join(licenseAcquisitionThreadId, NULL);
349  if (ret != 0)
350  {
351  AAMPLOG_ERR("AesDec:: pthread_join failed for license acquisition thread: %d",licenseAcquisitionThreadId);
352  }
353  licenseAcquisitionThreadStarted = false;
354  }
355  pthread_cond_broadcast(&mCond);
356  if (-1 != mCurlInstance)
357  {
358  if (mpAamp)
359  {
360  mpAamp->SyncBegin();
361  mpAamp->CurlTerm((AampCurlInstance)mCurlInstance);
362  mpAamp->SyncEnd();
363  }
364  mCurlInstance = -1;
365  }
366  pthread_mutex_unlock(&mMutex);
367 }
368 
369 /**
370  * @brief Cancel timed_wait operation drm_Decrypt
371  *
372  */
374 {
375  pthread_mutex_lock(&mMutex);
376  //save the current state in case required to restore later.
377  if (mDrmState != eDRM_KEY_FLUSH)
378  {
379  mPrevDrmState = mDrmState;
380  }
381  //required for demuxed assets where the other track might be waiting on mMutex lock.
382  mDrmState = eDRM_KEY_FLUSH;
383  pthread_cond_broadcast(&mCond);
384  pthread_mutex_unlock(&mMutex);
385 }
386 
387 /**
388  * @brief Restore key state post cleanup of
389  * audio/video TrackState in case DRM data is persisted
390  */
392 {
393  pthread_mutex_lock(&mMutex);
394  //In case somebody overwritten mDrmState before restore operation, keep that state
395  if (mDrmState == eDRM_KEY_FLUSH)
396  {
397  mDrmState = mPrevDrmState;
398  }
399  pthread_mutex_unlock(&mMutex);
400 }
401 
402 std::shared_ptr<AesDec> AesDec::mInstance = nullptr;
403 
404 /**
405  * @brief Get singleton instance
406  */
407 std::shared_ptr<AesDec> AesDec::GetInstance()
408 {
409  pthread_mutex_lock(&instanceLock);
410  if (nullptr == mInstance)
411  {
412  mInstance = std::make_shared<AesDec>();
413  }
414  pthread_mutex_unlock(&instanceLock);
415  return mInstance;
416 }
417 
418 /**
419  * @brief AesDec Constructor
420  *
421  */
422 AesDec::AesDec() : mpAamp(nullptr), mDrmState(eDRM_INITIALIZED),
423  mPrevDrmState(eDRM_INITIALIZED), mDrmUrl(""),
424  mCond(), mMutex(), mOpensslCtx(),
425  mDrmInfo(), mAesKeyBuf(), mCurlInstance(-1),
426  licenseAcquisitionThreadId(0),
427  licenseAcquisitionThreadStarted(false),
428  mAcquireKeyWaitTime(MAX_LICENSE_ACQ_WAIT_TIME)
429 {
430  pthread_cond_init(&mCond, NULL);
431  pthread_mutex_init(&mMutex, NULL);
432 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
433  OPEN_SSL_CONTEXT = EVP_CIPHER_CTX_new();
434 #else
435  EVP_CIPHER_CTX_init(OPEN_SSL_CONTEXT);
436 #endif
437 }
438 
439 
440 /**
441  * @brief AesDec Destructor
442  */
444 {
445  CancelKeyWait();
446  Release();
447  pthread_mutex_destroy(&mMutex);
448  pthread_cond_destroy(&mCond);
449 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
450  EVP_CIPHER_CTX_free(OPEN_SSL_CONTEXT);
451 #else
452  EVP_CIPHER_CTX_cleanup(OPEN_SSL_CONTEXT);
453 #endif
454 }
eDRM_KEY_FLUSH
@ eDRM_KEY_FLUSH
Definition: HlsDrmBase.h:52
AesDec::~AesDec
~AesDec()
AesDec Destructor.
Definition: aamp_aes.cpp:443
AesDec::CancelKeyWait
void CancelKeyWait()
Cancel timed_wait operation drm_Decrypt.
Definition: aamp_aes.cpp:373
DrmReturn
DrmReturn
Return values of various functions.
Definition: HlsDrmBase.h:35
PrivateInstanceAAMP::LogDrmInitComplete
void LogDrmInitComplete(void)
Notifies profiler that drm initialization is complete.
Definition: priv_aamp.cpp:3123
aamp_Free
void aamp_Free(void *ptr)
wrapper for g_free, used for segment allocation
Definition: AampMemoryUtils.cpp:56
AesDec::GetInstance
static std::shared_ptr< AesDec > GetInstance()
Get singleton instance.
Definition: aamp_aes.cpp:407
DrmInfo::keyURI
std::string keyURI
Definition: AampDrmInfo.h:87
AesDec::Release
void Release()
Release drm session.
Definition: aamp_aes.cpp:336
AesDec::AcquireKey
void AcquireKey(class PrivateInstanceAAMP *aamp, void *metadata, int trackType, AampLogManager *logObj=NULL)
AcquireKey Function to acquire key . Stub implementation.
Definition: aamp_aes.cpp:172
AesDec::NotifyDRMError
void NotifyDRMError(AAMPTuneFailure drmFailure)
Notify drm error.
Definition: aamp_aes.cpp:59
AesDec::WaitForKeyAcquireCompleteUnlocked
void WaitForKeyAcquireCompleteUnlocked(int timeInMs, DrmReturn &err)
Wait for key acquisition completion.
Definition: aamp_aes.cpp:255
AAMP_TUNE_LICENCE_TIMEOUT
@ AAMP_TUNE_LICENCE_TIMEOUT
Definition: AampEvent.h:126
aamp_aes.h
HLS AES drm decryptor.
eDRM_KEY_ACQUIRED
@ eDRM_KEY_ACQUIRED
Definition: HlsDrmBase.h:50
DrmInfo::manifestURL
std::string manifestURL
Definition: AampDrmInfo.h:86
DrmInfo::iv
unsigned char * iv
Definition: AampDrmInfo.h:84
PrivateInstanceAAMP::CurlInit
void CurlInit(AampCurlInstance startIdx, unsigned int instanceCount=1, std::string proxyName="")
Curl initialization function.
Definition: priv_aamp.cpp:3252
AesDec::RestoreKeyState
void RestoreKeyState()
Restore key state post cleanup of audio/video TrackState in case DRM data is persisted.
Definition: aamp_aes.cpp:391
GrowableBuffer::len
size_t len
Definition: AampMemoryUtils.h:42
AAMP_TUNE_UNTRACKED_DRM_ERROR
@ AAMP_TUNE_UNTRACKED_DRM_ERROR
Definition: AampEvent.h:121
eDRM_ACQUIRING_KEY
@ eDRM_ACQUIRING_KEY
Definition: HlsDrmBase.h:49
AesDec::GetState
DRMState GetState()
GetState Function to get current DRM State.
Definition: aamp_aes.cpp:181
MAX_LICENSE_ACQ_WAIT_TIME
#define MAX_LICENSE_ACQ_WAIT_TIME
Definition: AampDefine.h:76
eCURLINSTANCE_AES
@ eCURLINSTANCE_AES
Definition: priv_aamp.h:164
AAMP_TUNE_INVALID_DRM_KEY
@ AAMP_TUNE_INVALID_DRM_KEY
Definition: AampEvent.h:128
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
AampConfig::GetConfigValue
bool GetConfigValue(AAMPConfigSettings cfg, std::string &value)
GetConfigValue - Gets configuration for string data type.
Definition: AampConfig.cpp:748
eDRM_KEY_ACQUSITION_TIMEOUT
@ eDRM_KEY_ACQUSITION_TIMEOUT
Definition: HlsDrmBase.h:39
AesDec::SetDecryptInfo
DrmReturn SetDecryptInfo(PrivateInstanceAAMP *aamp, const struct DrmInfo *drmInfo, AampLogManager *logObj=NULL)
Set information required for decryption.
Definition: aamp_aes.cpp:190
AesDec::SignalKeyAcquired
void SignalKeyAcquired()
Signal key acquired event.
Definition: aamp_aes.cpp:94
PrivateInstanceAAMP::LogDrmDecryptEnd
void LogDrmDecryptEnd(ProfilerBucketType bucketType)
Notifies profiler that decryption has ended.
Definition: priv_aamp.cpp:3139
eDRM_SUCCESS
@ eDRM_SUCCESS
Definition: HlsDrmBase.h:37
DrmInfo
DRM information required to decrypt.
Definition: AampDrmInfo.h:47
AesDec::Decrypt
DrmReturn Decrypt(ProfilerBucketType bucketType, void *encryptedDataPtr, size_t encryptedDataLen, int timeInMs)
Decrypts an encrypted buffer.
Definition: aamp_aes.cpp:271
aamp_GetTimespec
struct timespec aamp_GetTimespec(int timeInMs)
To get the timespec.
Definition: AampUtils.cpp:741
PrivateInstanceAAMP::SyncBegin
void SyncBegin(void)
GStreamer operation start.
Definition: priv_aamp.cpp:1893
GrowableBuffer::ptr
char * ptr
Definition: AampMemoryUtils.h:41
AesDec::AesDec
AesDec()
AesDec Constructor.
Definition: aamp_aes.cpp:422
AesDec
Vanilla AES based DRM management.
Definition: aamp_aes.h:37
eAAMPConfig_LicenseKeyAcquireWaitTime
@ eAAMPConfig_LicenseKeyAcquireWaitTime
Definition: AampConfig.h:228
DRMState
DRMState
States of DRM object.
Definition: HlsDrmBase.h:46
AesDec::SignalDrmError
void SignalDrmError()
Signal drm error.
Definition: aamp_aes.cpp:82
AAMPTuneFailure
AAMPTuneFailure
AAMP playback error codes.
Definition: AampEvent.h:108
acquire_key
static void * acquire_key(void *arg)
key acquistion thread
Definition: aamp_aes.cpp:49
AAMP_TUNE_LICENCE_REQUEST_FAILED
@ AAMP_TUNE_LICENCE_REQUEST_FAILED
Definition: AampEvent.h:127
AAMPLOG_TRACE
#define AAMPLOG_TRACE(FORMAT,...)
AAMP logging defines, this can be enabled through setLogLevel() as per the need.
Definition: AampLogManager.h:83
eDRM_INITIALIZED
@ eDRM_INITIALIZED
Definition: HlsDrmBase.h:48
AampCurlInstance
AampCurlInstance
Enumeration for Curl Instances.
Definition: priv_aamp.h:156
PrivateInstanceAAMP
Class representing the AAMP player's private instance, which is not exposed to outside world.
Definition: priv_aamp.h:640
PrivateInstanceAAMP::SyncEnd
void SyncEnd(void)
GStreamer operation end.
Definition: priv_aamp.cpp:1902
PrivateInstanceAAMP::SendErrorEvent
void SendErrorEvent(AAMPTuneFailure tuneFailure, const char *description=NULL, bool isRetryEnabled=true, int32_t secManagerClassCode=-1, int32_t secManagerReasonCode=-1, int32_t secClientBusinessStatus=-1)
Handles errors and sends events to application if required. For download failures,...
Definition: priv_aamp.cpp:2454
PrivateInstanceAAMP::CurlTerm
void CurlTerm(AampCurlInstance startIdx, unsigned int instanceCount=1)
Terminate curl contexts.
Definition: priv_aamp.cpp:3333
ProfilerBucketType
ProfilerBucketType
Bucket types of AAMP profiler.
Definition: AampProfiler.h:43
DrmInfo::bPropagateUriParams
bool bPropagateUriParams
Definition: AampDrmInfo.h:82
PrivateInstanceAAMP::LogDrmDecryptBegin
void LogDrmDecryptBegin(ProfilerBucketType bucketType)
Notifies profiler that decryption has started.
Definition: priv_aamp.cpp:3131
eDRM_KEY_FAILED
@ eDRM_KEY_FAILED
Definition: HlsDrmBase.h:51
PrivateInstanceAAMP::GetLicenseReqProxy
std::string GetLicenseReqProxy()
To get the proxy for license request.
Definition: priv_aamp.cpp:9089
aamp_ResolveURL
void aamp_ResolveURL(std::string &dst, std::string base, const char *uri, bool bPropagateUriParams)
Resolve file URL from the base and file path.
Definition: AampUtils.cpp:157
PrivateInstanceAAMP::DownloadsAreEnabled
bool DownloadsAreEnabled(void)
Check if downloads are enabled.
Definition: priv_aamp.cpp:6752
AesDec::AcquireKey
void AcquireKey()
Acquire drm key from URI.
Definition: aamp_aes.cpp:107
PrivateInstanceAAMP::DisableDownloads
void DisableDownloads(void)
abort ongoing downloads and returns error on future downloads called while stopping fragment collecto...
Definition: priv_aamp.cpp:6741
eMEDIATYPE_LICENCE
@ eMEDIATYPE_LICENCE
Definition: AampMediaType.h:44
PrivateInstanceAAMP::GetFile
bool GetFile(std::string remoteUrl, struct GrowableBuffer *buffer, std::string &effectiveUrl, long *http_error=NULL, double *downloadTime=NULL, const char *range=NULL, unsigned int curlInstance=0, bool resetBuffer=true, MediaType fileType=eMEDIATYPE_DEFAULT, long *bitrate=NULL, int *fogError=NULL, double fragmentDurationSec=0, class CMCDHeaders *pCMCDMetrics=NULL)
Download a file from the CDN.
Definition: priv_aamp.cpp:3585
eDRM_ERROR
@ eDRM_ERROR
Definition: HlsDrmBase.h:38
AesDec::SetMetaData
DrmReturn SetMetaData(PrivateInstanceAAMP *aamp, void *metadata, int trackType, AampLogManager *logObj=NULL)
Set DRM meta-data. Stub implementation.
Definition: aamp_aes.cpp:164