Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f0ed519
include subtecparser test cases all get passed
rekhap2kandhavelan Sep 15, 2025
63a5ec1
Added test cases for base64
rekhap2kandhavelan Sep 16, 2025
4c4f670
Include Drm MOdule test cases without resolving failed test cases 46f…
rekhap2kandhavelan Sep 18, 2025
cc708db
Include ClosedCaptions test cases
rkandh015 Sep 19, 2025
b67a94f
Added external and isobmff test cases
rkandh015 Sep 24, 2025
8eb98fb
resolved hang
rkandh015 Sep 24, 2025
8fed58d
include contentsecuritymanager test cases
rkandh015 Sep 24, 2025
b98e616
Integerate Middleware-player-interface common files and subittile
rkandh015 Sep 25, 2025
6b8fbee
Include vendor pluging common test cases
rkandh015 Sep 27, 2025
207c60d
Added GTEST_SKIP api functions in all test cases which are failed
rkandh015 Sep 29, 2025
3e8d3bc
Merge branch 'develop' into feature/RDK-58324
rkandh015 Sep 30, 2025
d3c8ec3
Refactor base64_Decode for parameter validation
rekhap2kandhavelan Oct 31, 2025
d9ffbca
Refactor waitForDone method for clarity
rekhap2kandhavelan Oct 31, 2025
2fe5afe
Improve base64_Encode error handling
rekhap2kandhavelan Oct 31, 2025
67aa20c
Refactor HLS DRM session callback handling
rekhap2kandhavelan Oct 31, 2025
af0ea42
resolve build error
rkandh015 Oct 31, 2025
e671a0a
Merge branch 'feature/RDK-58324' of https://github.com/rdkcentral/mid…
rkandh015 Oct 31, 2025
f13b39f
Add UpdateBufferData function to handle buffer updates
rekhap2kandhavelan Oct 31, 2025
48135ae
Fix return statement for base64 decoding
rekhap2kandhavelan Oct 31, 2025
af02d4f
Refactor init and processData methods for clarity
rekhap2kandhavelan Oct 31, 2025
6029e54
Update FakePlayerJsonObject.cpp
rekhap2kandhavelan Oct 31, 2025
aa4c51c
Merge branch 'develop' into feature/RDK-58324
rekhap2kandhavelan Oct 31, 2025
c90e958
handling empty string test case
rkandh015 Oct 31, 2025
d58781b
Merge branch 'feature/RDK-58324' of https://github.com/rdkcentral/mid…
rkandh015 Oct 31, 2025
aba2476
Added new L1 test cases
rkandh015 Nov 27, 2025
86bf733
RDK-58324 Added L1 test suites for updated headers documented with Do…
Nov 27, 2025
c1af6c1
rebase with main branch
rkandh015 Dec 16, 2025
d8a08c0
Integerate DrmOcdm DrmHelper Test cases
rkandh015 Dec 16, 2025
3eb0c7d
Include HlsOcdmBridgeInterface testcases
rkandh015 Dec 16, 2025
92d807f
Integerate subtec cc l1 test cases
rkandh015 Dec 16, 2025
e0ba8ce
Merge branch 'develop' into feature/RDK-58324
rekhap2kandhavelan Dec 17, 2025
56b048a
Include subtecTests L1 test cases
rkandh015 Dec 17, 2025
c080586
Merge branch 'feature/RDK-58324' of https://github.com/rdkcentral/mid…
rkandh015 Dec 17, 2025
c8764fb
Update InterfacePlayerRDK.cpp
rekhap2kandhavelan Dec 17, 2025
43bac77
Update PlayerUtils.cpp
rekhap2kandhavelan Dec 17, 2025
15cd9f3
Update InterfacePlayerRDK.cpp
rekhap2kandhavelan Dec 17, 2025
ffd6b19
Update InterfacePlayerRDK.cpp
rekhap2kandhavelan Dec 17, 2025
eefa998
L1 TestCases for PlayerIsoBmff Module
ALSAMEEMA Feb 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions GstHandlerControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ GstHandlerControl::ScopeHelper GstHandlerControl::getScopeHelper()

bool GstHandlerControl::waitForDone(int MaximumDelayMilliseconds, std::string name)
{
if (MaximumDelayMilliseconds < 0)
{
MW_LOG_ERR("Invalid MaximumDelayMilliseconds: %d", MaximumDelayMilliseconds);
return false;
}
const std::chrono::steady_clock::time_point end =
std::chrono::milliseconds{MaximumDelayMilliseconds} + std::chrono::steady_clock::now();

Expand Down
37 changes: 19 additions & 18 deletions InterfacePlayerRDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ mSourceSetupCV(), mScheduler(), callbackMap(), setupStreamCallbackMap(), mDrmSys
pthread_mutex_init(&interfacePlayerPriv->gstPrivateContext->stream[i].sourceLock, NULL);
// start Scheduler Worker for task handling
mScheduler.StartScheduler();

printf("InterfacePlayerRDK created in seperated repo\n");
fflush(stdout);
}

/* InterfacePlayerRDK destructor*/
Expand Down Expand Up @@ -1745,24 +1742,27 @@ static void gst_need_data(void *source, guint size, void *_this)
static void gst_enough_data(GstElement *source, void *_this)
{
InterfacePlayerRDK* pInterfacePlayerRDK = (InterfacePlayerRDK*)_this;
InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer();
HANDLER_CONTROL_HELPER_CALLBACK_VOID();
if(pInterfacePlayerRDK)
{
if (!pInterfacePlayerRDK->mPauseInjector) // avoid processing enough data if the downloads are already disabled.
{
GstMediaType mediaType = gstGetMediaTypeForSource(source, pInterfacePlayerRDK);
if (mediaType != eGST_MEDIATYPE_DEFAULT)
InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer();
if(privatePlayer)
{
HANDLER_CONTROL_HELPER_CALLBACK_VOID();
if (!pInterfacePlayerRDK->mPauseInjector) // avoid processing enough data if the downloads are already disabled.
{
struct gst_media_stream *stream = &privatePlayer->gstPrivateContext->stream[mediaType];
if(stream)
GstMediaType mediaType = gstGetMediaTypeForSource(source, pInterfacePlayerRDK);
if (mediaType != eGST_MEDIATYPE_DEFAULT)
{
int media = static_cast<int>(mediaType);
pInterfacePlayerRDK->EnoughDataCb(media);
}
else
{
MW_LOG_ERR( "%s Null check failed.", gstGetMediaTypeName(mediaType));
struct gst_media_stream *stream = &privatePlayer->gstPrivateContext->stream[mediaType];
if(stream)
{
int media = static_cast<int>(mediaType);
pInterfacePlayerRDK->EnoughDataCb(media);
}
else
{
MW_LOG_ERR( "%s Null check failed.", gstGetMediaTypeName(mediaType));
}
}
}
}
Expand Down Expand Up @@ -2906,7 +2906,7 @@ bool InterfacePlayerRDK::HandleVideoBufferSent()

void InterfacePlayerRDK::SetPlayerName(std::string name)
{
interfacePlayerPriv->mPlayerName = name;
interfacePlayerPriv->mPlayerName = std::move(name);
}

/**
Expand Down Expand Up @@ -4063,6 +4063,7 @@ static void GstPlayer_OnGstPtsErrorCb(GstElement *object, guint arg0, gpointer a
{
InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer();
HANDLER_CONTROL_HELPER_CALLBACK_VOID();
MW_LOG_ERR("Got PTS error message from %s", GST_ELEMENT_NAME(object));
bool isVideo = false;
bool isAudioSink = false;
if (privatePlayer->socInterface->IsVideoSinkHandleErrors())
Expand Down
7 changes: 6 additions & 1 deletion PlayerUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ long long GetCurrentTimeMS(void)
return (long long)(t.tv_sec*1e3 + t.tv_usec*1e-3);
}

// Expose for testing
const char* Test_ParseUriProtocol(const char* uri) {
return ParseUriProtocol(uri);
}
/**
* @brief parse leading protocol from uri if present
* @param[in] uri manifest/ fragment uri
Expand Down Expand Up @@ -184,6 +188,7 @@ static const char * ParseUriProtocol(const char *uri)
}
return NULL;
}

/**
* @brief Resolve file URL from the base and file path
*/
Expand Down Expand Up @@ -262,7 +267,7 @@ void trim(std::string& src)
{
size_t last = src.find_last_not_of(" \n\r\t\f\v");
std::string dst = src.substr(first, (last - first + 1));
src = dst;
src = std::move(dst);
}
}

Expand Down
8 changes: 8 additions & 0 deletions PlayerUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ void ResolveURL(std::string& dst, std::string base, const char *uri , bool bProp
*/
long long GetCurrentTimeMS(void);

const char* Test_ParseUriProtocol(const char* uri);
/**
* @brief parse leading protocol from uri if present
* @param[in] uri manifest/ fragment uri
* @retval return pointer just past protocol (i.e. http://) if present (or) return NULL uri doesn't start with protcol
*/
static const char * ParseUriProtocol(const char *uri);

/**
* @fn trim
* @param[in][out] src Buffer containing string
Expand Down
125 changes: 83 additions & 42 deletions baseConversion/_base64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,37 @@
*/
char *base64_Encode(const unsigned char *src, size_t len)
{
if( src == NULL) {
//invalid parameters
return NULL;
}
/* handle empty input */
if (len == 0)
{
char *rc = (char*)malloc(1);
if (rc) rc[0] = '\0';
return rc;
}
const unsigned char *fin = &src[len];
const static char *encode = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // base64
char *rc = (char *)malloc(((len+2)/3)*4+1);
if( rc )
if(rc == NULL) {
return NULL;
}
char *dst = rc;
unsigned int temp;
int pad = 0;
for( int i=0; i<len; i+=3 )
{
char *dst = rc;
unsigned int temp;
int pad = 0;
for( int i=0; i<len; i+=3 )
{
temp = (*src++) << 16;
if( src<fin ) temp |= (*src++) << 8; else pad++;
if( src<fin ) temp |= (*src++); else pad++;
*dst++ = encode[(temp & 0x00FC0000) >> 18];
*dst++ = encode[(temp & 0x0003F000) >> 12];
*dst++ = (pad>=2)?'=':encode[(temp & 0x00000FC0) >> 6 ];
*dst++ = (pad>=1)?'=':encode[(temp & 0x0000003F)];
}
*dst++ = 0x00;
temp = (*src++) << 16;
if( src<fin ) temp |= (*src++) << 8; else pad++;
if( src<fin ) temp |= (*src++); else pad++;
*dst++ = encode[(temp & 0x00FC0000) >> 18];
*dst++ = encode[(temp & 0x0003F000) >> 12];
*dst++ = (pad>=2)?'=':encode[(temp & 0x00000FC0) >> 6 ];
*dst++ = (pad>=1)?'=':encode[(temp & 0x0000003F)];
}
*dst++ = 0x00;
return rc;
}

Expand All @@ -64,6 +75,32 @@ char *base64_Encode(const unsigned char *src, size_t len)
*/
unsigned char *base64_Decode(const char *src, size_t *outLen, size_t srcLen)
{
if (outLen == NULL)
{
// invalid parameter
return NULL;
}
*outLen = 0; // default

if (src == NULL)
{
// invalid parameter or nothing to decode
return NULL;
}

if (srcLen == 0)
{
// Empty input: return valid empty buffer
unsigned char *emptyBuf = (unsigned char *)malloc(1);
if (!emptyBuf)
{
return NULL; // malloc failure
}
*outLen = 0;
emptyBuf[0] = '\0'; // optional, for safety
return emptyBuf;
}

static const signed char decode[256] =
{
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Expand All @@ -84,45 +121,49 @@ unsigned char *base64_Decode(const char *src, size_t *outLen, size_t srcLen)
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
unsigned char *rc = (unsigned char *)malloc(srcLen*3/4);
if (rc == NULL) {
// malloc failed
return NULL;
}
*outLen = 0; // default
if( rc )
unsigned char *dst = rc;
while( srcLen>0 && src[srcLen-1] == '=' )
{ // strip padding
srcLen--;
}
const char *fin = &src[srcLen];
while( src<fin )
{
unsigned char *dst = rc;
while( srcLen>0 && src[srcLen-1] == '=' )
{ // strip padding
srcLen--;
}
const char *fin = &src[srcLen];
while( src<fin )
unsigned int buf = 0;
int count = 0;
for( int i=0; i<4; i++ )
{
unsigned int buf = 0;
int count = 0;
for( int i=0; i<4; i++ )
buf<<=6;
if( src<fin )
{
buf<<=6;
if( src<fin )
{
unsigned char c = (unsigned char)*src++;
int digit64 = decode[c];
if( digit64<0 )
{ // invalid character
free( rc );
return NULL;
}
buf |= digit64;
count++;
unsigned char c = (unsigned char)*src++;
int digit64 = decode[c];
if( digit64<0 )
{ // invalid character
free( rc );
return NULL;
}
buf |= digit64;
count++;
}
if( count>=2 ) *dst++ = (buf>>(8*2))&0xff;
if( count>=3 ) *dst++ = (buf>>(8*1))&0xff;
if( count>=4 ) *dst++ = (buf>>(8*0))&0xff;
}
*outLen = dst-rc;
if( count>=2 ) *dst++ = (buf>>(8*2))&0xff;
if( count>=3 ) *dst++ = (buf>>(8*1))&0xff;
if( count>=4 ) *dst++ = (buf>>(8*0))&0xff;
}
*outLen = dst-rc;
return rc;
}

unsigned char *base64_Decode(const char *src, size_t *len)
{
if (src == NULL || len == NULL) {
return NULL;
}
return base64_Decode(src, len, strlen(src));
}
5 changes: 5 additions & 0 deletions drm/DrmUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ void DrmUtils::convertEndianness(unsigned char *original, unsigned char *guidByt
*/
std::string DrmUtils::extractWVContentMetadataFromPssh(const char* psshData, int dataLength)
{
if(!psshData)
{
MW_LOG_WARN("psshData pointer is NULL");
return std::string();
}
//WV PSSH format 4+4+4+16(system id)+4(data size)
uint32_t header = 28;
std::string metadata;
Expand Down
9 changes: 7 additions & 2 deletions drm/HlsDrmSessionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ bool HlsDrmSessionManager::isDrmSupported(const struct DrmInfo& drmInfo) const
*/
std::shared_ptr<HlsDrmBase> HlsDrmSessionManager::createSession(const struct DrmInfo& drmInfo, int streamTypeIn)
{

DrmMediaType streamType = (DrmMediaType)streamTypeIn;
std::shared_ptr<HlsDrmBase> bridge = nullptr;
DrmHelperPtr drmHelper = DrmHelperEngine::getInstance().createHelper(drmInfo);

this->GetHlsDrmSessionCb(bridge, drmHelper ,mDrmSession, streamType);

// copy callback and session to local variables to avoid race conditions
auto cb = this->GetHlsDrmSessionCb;
auto session = mDrmSession;
if (cb) {
cb(bridge, drmHelper, session, streamType);
}
return bridge;
}
3 changes: 3 additions & 0 deletions drm/helper/VerimatrixHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "VerimatrixHelper.h"
#include "DrmUtils.h"
#include "DrmConstants.h"
#include "PlayerLogManager.h"

#define KEYURL_TAG_START "<KeyUrl><![CDATA["
#define KEYURL_TAG_END "]]></KeyUrl>"
Expand Down Expand Up @@ -121,12 +122,14 @@ void VerimatrixHelper::generateLicenseRequest(const ChallengeInfo& challengeInfo

void VerimatrixHelper::transformLicenseResponse(std::shared_ptr<DrmData> licenseResponse) const
{
#ifndef UBUNTU
if(mDrmInfo.mediaFormat == eMEDIAFORMAT_HLS)
licenseResponse->setData((unsigned char*)mDrmInfo.keyURI.c_str(), mDrmInfo.keyURI.length());
else if(mDrmInfo.mediaFormat == eMEDIAFORMAT_DASH)
licenseResponse->setData((unsigned char*)mKeyID.data(), mKeyID.size());
else
MW_LOG_WARN("unknown mediaFormat %d", mDrmInfo.mediaFormat);
#endif
}

bool VerimatrixHelperFactory::isDRM(const struct DrmInfo& drmInfo) const
Expand Down
3 changes: 2 additions & 1 deletion drm/ocdm/opencdmsessionadapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,12 @@ void OCDMSessionAdapter:: clearDecryptContext()

m_eKeyState = KEY_INIT;
}

#if defined(USE_OPENCDM_ADAPTER)
void OCDMSessionAdapter::setKeyId(const std::vector<uint8_t>& keyId)
{
m_keyId = keyId;
}
#endif

bool OCDMSessionAdapter::verifyOutputProtection()
{
Expand Down
Loading
Loading