|
RDK Documentation (Open Sourced RDK Components)
|
4 #include <unordered_map>
12 #include "CppUTest/TestHarness.h"
13 #include "CppUTestExt/MockSupport.h"
17 #define TEST_LOG_LEVEL eLOGLEVEL_TRACE
19 std::shared_ptr<AampConfig> gGlobalConfig;
23 static std::unordered_map<std::string, std::vector<std::string>> fCustomHeaders;
25 void MockAampReset(
void)
27 gGlobalConfig = std::make_shared<AampConfig>();
37 customHeaders = fCustomHeaders;
50 mock(
"Aamp").actualCall(
"individualization").withStringParameter(
"payload", payload.c_str());
101 return std::string();
120 void PrivateInstanceAAMP::GetMoneyTraceString(std::string &customHeader)
const
132 if (buffer && buffer->ptr)
141 size_t required = buffer->len + len;
142 if (required > buffer->avail)
146 buffer->avail = ((buffer->avail * 2) > required) ? (buffer->avail * 2) : (required * 2);
147 char *ptr = (
char *)g_realloc(buffer->ptr, buffer->avail);
151 if (buffer->ptr == NULL)
159 memcpy(&buffer->ptr[buffer->len], ptr, len);
160 buffer->len = required;
166 return chkLevel >= TEST_LOG_LEVEL;
171 std::ostringstream hexSs;
173 hexSs << std::hex << std::uppercase << std::setfill(
'0');
174 std::for_each(data.cbegin(), data.cend(), [&](
int c) { hexSs << std::setw(2) << c; });
184 #ifdef ENABLE_LOGGING
187 va_start(args, format);
190 len = sprintf(gDebugPrintBuffer,
"[AAMP-PLAYER]");
194 std::cout << gDebugPrintBuffer << std::endl;
200 void logprintf_new(
int playerId,
const char* levelstr,
const char* file,
int line,
const char *format, ...)
202 #ifdef ENABLE_LOGGING
205 va_start(args, format);
208 len = sprintf(gDebugPrintBuffer,
"[AAMP-PLAYER][%d][%s][%s][%d]", playerId, levelstr, file, line);
212 std::cout << gDebugPrintBuffer << std::endl;
218 void DumpBlob(
const unsigned char *ptr,
size_t len)
AAMP_LogLevel
Log level's of AAMP.
std::string GetLicenseServerUrlForDrm(DRMSystems type)
Get license server url for a drm type.
void aamp_Free(void *ptr)
wrapper for g_free, used for segment allocation
@ eAAMPConfig_WVLicenseServerUrl
void logprintf(const char *format,...)
Print logs to console / log fil.
size_t HandleSSLWriteCallback(char *ptr, size_t size, size_t nmemb, void *userdata)
HandleSSLWriteCallback - Handle write callback from CURL.
AampConfig * gpGlobalConfig
Global configuration.
void DumpBlob(const unsigned char *ptr, size_t len)
Compactly log blobs of binary data.
void SetState(PrivAAMPState state)
Set player state.
@ eAAMPConfig_LicenseServerUrl
size_t HandleSSLHeaderCallback(const char *ptr, size_t size, size_t nmemb, void *userdata)
HandleSSLHeaderCallback - Hanlde header callback from SSL.
PrivateInstanceAAMP(AampConfig *config=NULL)
PrivateInstanceAAMP Constructor.
bool IsEventListenerAvailable(AAMPEventType eventType)
IsEventListenerAvailable Check if Event is registered.
void SendDrmErrorEvent(DrmMetaDataEventPtr event, bool isRetryEnabled)
Handles DRM errors and sends events to application if required.
void individualization(const std::string &payload)
DRM individualization callback.
static bool IsCodecSupported(const std::string &codecName)
AAMPEventMode
AAMP event modes.
void SendEvent(AAMPEventPtr eventData, AAMPEventMode eventMode=AAMP_EVENT_DEFAULT_MODE)
Send event to listeners.
@ eAAMPConfig_CKLicenseServerUrl
void logprintf_new(int playerId, const char *levelstr, const char *file, int line, const char *format,...)
Print logs to console / log file.
Gstreamer based player for AAMP.
bool isLogLevelAllowed(AAMP_LogLevel chkLevel)
To check the given log level is allowed to print mechanism.
std::string GetLicenseCustomData()
Get License Custom Data.
Context-free common utility functions.
std::string GetAppName()
Get the application name.
Private functions and types used internally by AAMP.
Structure of GrowableBuffer.
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
#define MAX_DEBUG_LOG_BUFF_SIZE
Max debug log buffer size.
AAMPEventType
Type of the events sending to the JSPP player.
void aamp_AppendBytes(struct GrowableBuffer *buffer, const void *ptr, size_t len)
append data to GrowableBuffer ADT
std::string GetLicenseReqProxy()
To get the proxy for license request.
int HandleSSLProgressCallback(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
HandleSSLProgressCallback - Process progress callback from CURL.
void GetCustomLicenseHeaders(std::unordered_map< std::string, std::vector< std::string >> &customHeaders)
To get any custom license HTTP headers that was set by application.
~PrivateInstanceAAMP()
PrivateInstanceAAMP Destructor.
DRMSystems
DRM system types.
static std::string getHexDebugStr(const std::vector< uint8_t > &data)
Get a hex string representation of a vector of bytes.
void SendDRMMetaData(DrmMetaDataEventPtr e)
Send DRM metadata event.
@ eAAMPConfig_PRLicenseServerUrl
void setLogLevel(AAMP_LogLevel newLevel)
Set the log level for print mechanism.