RDK Documentation (Open Sourced RDK Components)
AampDRMutils.cpp File Reference

DataStructures and methods for DRM license acquisition. More...

#include "AampDRMutils.h"
#include "AampConfig.h"
#include "_base64.h"
#include <uuid/uuid.h>
#include <regex>
Include dependency graph for AampDRMutils.cpp:

Go to the source code of this file.

Macros

#define KEYID_TAG_START   "<KID>"
 
#define KEYID_TAG_END   "</KID>"
 
#define KEY_ID_SZE_INDICATOR   0x12
 

Functions

static void aamp_SwapBytes (unsigned char *bytes, int pos1, int pos2)
 Swap the bytes at given positions. More...
 
void aamp_ConvertEndianness (unsigned char *original, unsigned char *guidBytes)
 Convert endianness of 16 byte block. More...
 
std::string aamp_ExtractWVContentMetadataFromPssh (const char *psshData, int dataLength)
 Extract WideVine content meta data from DRM Agnostic PSSH header. Might not work with WideVine PSSH header. More...
 
static std::string aamp_getBaseUri (std::string uri, bool originOnly)
 Get the base URI of a resource. More...
 

Variables

static const std::string PROTOCOL_REGEX = "^[a-zA-Z0-9\\+\\.-]+://"
 

yes

DataStructures and methods for DRM license acquisition.

Definition in file AampDRMutils.cpp.

Function Documentation

◆ aamp_SwapBytes()

static void aamp_SwapBytes ( unsigned char *  bytes,
int  pos1,
int  pos2 
)
static

Swap the bytes at given positions.

Parameters
[out]bytes- Pointer to byte block where swapping is done.
[in]pos1,pos2- Swap positions.
Returns
void.

Definition at line 124 of file AampDRMutils.cpp.

◆ aamp_ConvertEndianness()

void aamp_ConvertEndianness ( unsigned char *  original,
unsigned char *  guidBytes 
)

Convert endianness of 16 byte block.

Parameters
[in]original- Pointer to source byte block.
[out]guidBytes- Pointer to destination byte block.
Returns
void.

Definition at line 134 of file AampDRMutils.cpp.

◆ aamp_ExtractWVContentMetadataFromPssh()

std::string aamp_ExtractWVContentMetadataFromPssh ( const char *  psshData,
int  dataLength 
)

Extract WideVine content meta data from DRM Agnostic PSSH header. Might not work with WideVine PSSH header.

Definition at line 148 of file AampDRMutils.cpp.

◆ aamp_getBaseUri()

static std::string aamp_getBaseUri ( std::string  uri,
bool  originOnly 
)
static

Get the base URI of a resource.

Parameters
uriURI of a resource
originOnlyif true, only the domain (and port, if present) is returned. if false, the full parent path of the resource is returned
Returns
base URI

Definition at line 182 of file AampDRMutils.cpp.