Skip to content

Commit 594db69

Browse files
authored
Merge branch 'develop' into feature/RDK-59937_federated_2511
2 parents 6c2e6a3 + 079a61b commit 594db69

File tree

13 files changed

+37
-833
lines changed

13 files changed

+37
-833
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ Linux/googletest/
2424
test/l2test/result/
2525
test/l2test/data/aamp/*
2626
**/*.swp
27-
qtdemuxAnalyzer

AampTsbReader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void AampTsbReader::CheckPeriodBoundary(TsbFragmentDataPtr currFragment)
350350
TsbFragmentDataPtr adjFragment = currFragment->prev;
351351
if (adjFragment)
352352
{
353-
// Calculate the expected PTS of the current fragment by adding the
353+
// Calculate the expected PTS of the current fragment by adding the
354354
// duration of the previous fragment to its PTS.
355355
AampTime nextPTSCal = adjFragment->GetPTS() + adjFragment->GetDuration();
356356

@@ -485,4 +485,4 @@ AampTime AampTsbReader::GetFirstPTSOffset()
485485
AampTime AampTsbReader::GetStartPosition()
486486
{
487487
return mStartPosition;
488-
}
488+
}

drm/AampDRMLicManager.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ AampDRMLicenseManager::AampDRMLicenseManager(int maxDrmSessions, PrivateInstance
130130
*/
131131
AampDRMLicenseManager::~AampDRMLicenseManager()
132132
{
133-
SAFE_DELETE(mLicensePrefetcher);
133+
SAFE_DELETE(mLicensePrefetcher);
134134
SAFE_DELETE(mDrmSessionManager);
135135
releaseLicenseRenewalThreads();
136136
for(int i = 0 ; i < mMaxDRMSessions;i++)
137-
{
138-
139-
mLicenseDownloader[i].Release();
137+
{
138+
mLicenseDownloader[i].Release();
140139
}
141140
SAFE_DELETE_ARRAY( mLicenseDownloader );
142141
}
@@ -1442,8 +1441,8 @@ void AampDRMLicenseManager::UpdateMaxDRMSessions(int maxSessions)
14421441
{
14431442
mDrmSessionManager->UpdateMaxDRMSessions(maxSessions);
14441443
SAFE_DELETE_ARRAY( mLicenseDownloader );
1445-
mLicenseDownloader = new AampCurlDownloader[maxSessions];
1446-
mLicenseRenewalThreads.resize(maxSessions);
1444+
mLicenseDownloader = new AampCurlDownloader[maxSessions];
1445+
mLicenseRenewalThreads.resize(maxSessions);
14471446
}
14481447

14491448
void AampDRMLicenseManager::clearDrmSession(bool forceClearSession)

middleware/InterfacePlayerRDK.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,6 @@ bool InterfacePlayerRDK::SendHelper(int type, const void *ptr, size_t len, doubl
31483148
double pts = mp4Demux->getPts(i);
31493149
double dts = mp4Demux->getDts(i);
31503150
double dur = mp4Demux->getDuration(i);
3151-
GstStructure *drm = mp4Demux->getDrmMetadata(i);
31523151
gpointer data = g_malloc(sampleLen);
31533152
if( data )
31543153
{
@@ -3157,10 +3156,6 @@ bool InterfacePlayerRDK::SendHelper(int type, const void *ptr, size_t len, doubl
31573156
GST_BUFFER_PTS(gstBuffer) = (GstClockTime)(pts * GST_SECOND);
31583157
GST_BUFFER_DTS(gstBuffer) = (GstClockTime)(dts * GST_SECOND);
31593158
GST_BUFFER_DURATION(gstBuffer) = (GstClockTime)(dur * 1000000000LL);
3160-
if (drm)
3161-
{
3162-
gst_buffer_add_protection_meta(gstBuffer, drm);
3163-
}
31643159
GstFlowReturn ret = gst_app_src_push_buffer(GST_APP_SRC(stream->source),gstBuffer);
31653160
if( ret == GST_FLOW_OK )
31663161
{

middleware/externals/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ if(DISABLE_SECURITY_TOKEN)
5656
add_definitions(-DDISABLE_SECURITY_TOKEN)
5757
endif()
5858

59+
option(DISABLE_SECURITY_TOKEN "Disable security token" OFF)
60+
61+
if(DISABLE_SECURITY_TOKEN)
62+
add_definitions(-DDISABLE_SECURITY_TOKEN)
63+
endif()
64+
5965
# uncomment below to build additional drm support in simulator
6066
# set(CMAKE_USE_OPENCDM_ADAPTER TRUE)
6167
# set(CMAKE_USE_OPENCDM_ADAPTER_MOCKS TRUE)

priv_aamp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7712,7 +7712,6 @@ void PrivateInstanceAAMP::Stop( bool isDestructing )
77127712
{
77137713
mMPDDownloaderInstance->Release();
77147714
}
7715-
77167715
if(mTSBSessionManager)
77177716
{
77187717
// Clear all the local TSB data

test/aampcli/AampcliPlaybackCommand.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,6 @@ void PlaybackCommand::addCommand(std::string command,std::string description)
10721072
}
10731073

10741074
#include "mp4demux.hpp"
1075-
Mp4Demux mp4Demux = Mp4Demux(true);
10761075
void PlaybackCommand::parse( const char *path )
10771076
{
10781077
while( *path == ' ' )
@@ -1096,21 +1095,10 @@ void PlaybackCommand::parse( const char *path )
10961095
size_t rc = fread(ptr,1,len,f);
10971096
if( rc == len )
10981097
{
1098+
auto mp4Demux = new Mp4Demux(true);
10991099
// coverity[TAINTED_SCALAR]:SUPPRESS
1100-
mp4Demux.Parse(ptr,len);
1101-
int count = mp4Demux.count();
1102-
for (int i=0; i<count; i++)
1103-
{
1104-
AAMPCLI_PRINTF("Sample No:%d, PTR:%p, SIZE:%zu, PTS:%lf, DTS:%lf, DUR:%lf DRM:%d\n",
1105-
i + 1,
1106-
mp4Demux.getPtr(i),
1107-
mp4Demux.getLen(i),
1108-
mp4Demux.getPts(i),
1109-
mp4Demux.getDts(i),
1110-
mp4Demux.getDuration(i),
1111-
mp4Demux.getDrmMetadata(i) ? 1 : 0
1112-
);
1113-
}
1100+
mp4Demux->Parse(ptr,len);
1101+
delete mp4Demux;
11141102
}
11151103
free( ptr );
11161104
}

test/gstTestHarness/mp4demux.hpp

Lines changed: 13 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ class Mp4Demux
250250
gst_buffer_unref(pssh);
251251
}
252252

253-
void dump_auxiliary_information( void )
254-
{
253+
void process_auxiliary_information( void )
254+
{ // redundant with parseSampleEncryptionBox?
255255
size_t sample_count = cenc_aux_info_sizes.size();
256256
if( sample_count && got_auxiliary_information_offset )
257257
{
@@ -367,7 +367,7 @@ class Mp4Demux
367367
PRINTF( "\n" );
368368
}
369369
}
370-
dump_auxiliary_information();
370+
process_auxiliary_information();
371371
}
372372

373373
void parseAuxInfo( void )
@@ -404,7 +404,7 @@ class Mp4Demux
404404
}
405405
PRINTF( "%sauxiliary_information_offset = 0x%" PRIu64 "\n", INDENT(), auxiliary_information_offset );
406406
got_auxiliary_information_offset = true;
407-
dump_auxiliary_information();
407+
process_auxiliary_information();
408408
}
409409

410410
void parseSampleEncryptionBox( void )
@@ -448,7 +448,6 @@ class Mp4Demux
448448
ptr += subsamples_size;
449449
}
450450
}
451-
sencPresent = true;
452451
}
453452

454453
void parseMovieFragmentHeaderBox( void )
@@ -537,6 +536,8 @@ class Mp4Demux
537536
if (flags & 0x0100)
538537
{
539538
sample_duration = ReadU32();
539+
PRINTF( " duration=%" PRIu32, sample_duration );
540+
sample.duration = sample_duration / (double)timescale;
540541
}
541542
if (flags & 0x0200)
542543
{
@@ -558,8 +559,7 @@ class Mp4Demux
558559
}
559560
sample.dts = dts/(double)timescale;
560561
sample.pts = (dts+sample_composition_time_offset)/(double)timescale;
561-
sample.duration = sample_duration / (double)timescale;
562-
PRINTF( " duration:%f dts=%f pts=%f", sample.duration, sample.dts, sample.pts );
562+
PRINTF( " dts=%f pts=%f", sample.dts, sample.pts );
563563
dts += sample_duration;
564564
samples.push_back( std::move(sample) );
565565
PRINTF( "\n" );
@@ -888,21 +888,7 @@ class Mp4Demux
888888

889889
case MultiChar_Constant("moof"): // Movie Fragment
890890
moof_ptr = ptr-8;
891-
// For LLD streams, we may have multiple moof boxes
892-
// so we need to track sampleOffset to map samples to mdat
893-
sampleOffset = samples.size();
894-
// Reset encryption state for each moof
895-
got_auxiliary_information_offset = false;
896-
cenc_aux_info_sizes.clear();
897-
sencPresent = false;
898-
899891
DemuxHelper(next );
900-
901-
if (!sencPresent && got_auxiliary_information_offset)
902-
{
903-
// If no 'senc' box, we need to get IVs and subsample data from auxiliary info
904-
process_auxiliary_information();
905-
}
906892
break;
907893

908894
case MultiChar_Constant("schi"): // Scheme Information
@@ -943,24 +929,7 @@ class Mp4Demux
943929
}
944930
}
945931

946-
Mp4Demux( bool verbose=false ):
947-
audio{}, video{}, stream_format(),
948-
data_reference_index(), codec_type(),
949-
codec_data(), is_encrypted(), iv_size(),
950-
crypt_byte_block(), skip_byte_block(),
951-
constant_iv_size(), constant_iv(), timescale(),
952-
samples(), default_kid(), got_auxiliary_information_offset(),
953-
auxiliary_information_offset(), scheme_type(), scheme_version(),
954-
original_media_type(), cenc_aux_info_sizes(), protectionEvents(),
955-
moof_ptr(), ptr(), indent(),
956-
version(), flags(), baseMediaDecodeTime(),
957-
fragment_duration(), track_id(), base_data_offset(),
958-
default_sample_description_index(), default_sample_duration(), default_sample_size(),
959-
default_sample_flags(), creation_time(), modification_time(),
960-
duration(), rate(), volume(),
961-
matrix{}, layer(), alternate_group(),
962-
width_fixed(), height_fixed(), language(),
963-
verbose(verbose), sampleOffset(), sencPresent(false)
932+
Mp4Demux( bool verbose=false ) : audio{}, video{}, stream_format(), data_reference_index(), codec_type(), codec_data(), is_encrypted(), iv_size(), crypt_byte_block(), skip_byte_block(), constant_iv_size(), constant_iv(), timescale(), samples(), default_kid(), got_auxiliary_information_offset(), auxiliary_information_offset(), scheme_type(), scheme_version(), original_media_type(), cenc_aux_info_sizes(), protectionEvents(), moof_ptr(), ptr(), indent(), version(), flags(), baseMediaDecodeTime(), fragment_duration(), track_id(), base_data_offset(), default_sample_description_index(), default_sample_duration(), default_sample_size(), default_sample_flags(), creation_time(), modification_time(), duration(), rate(), volume(), matrix{}, layer(), alternate_group(), width_fixed(), height_fixed(), language(), verbose(verbose)
964933
{
965934
}
966935

@@ -1072,15 +1041,6 @@ class Mp4Demux
10721041
g_print( "unk codec_type: %" PRIu32 "\n", codec_type );
10731042
return;
10741043
}
1075-
if (caps && is_encrypted)
1076-
{
1077-
GstStructure *s = gst_caps_get_structure (caps, 0);
1078-
gst_structure_set (s,
1079-
"original-media-type", G_TYPE_STRING, gst_structure_get_name (s),
1080-
GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING, "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",
1081-
NULL);
1082-
gst_structure_set_name (s, "application/x-cenc");
1083-
}
10841044
gst_app_src_set_caps(appsrc, caps);
10851045
gst_caps_unref(caps);
10861046
gst_buffer_unref (buf);
@@ -1150,19 +1110,13 @@ class Mp4Demux
11501110
NULL);
11511111
gst_buffer_unref(subsamples_buf);
11521112
}
1153-
else
1154-
{
1155-
gst_structure_set(metadata,
1156-
"subsample_count", G_TYPE_UINT, 0,
1157-
NULL);
1158-
}
11591113

11601114
if( scheme_type == MultiChar_Constant("cbcs") )
11611115
{
11621116
GstBuffer *constant_iv_buf = _gst_buffer_new_memdup( (gpointer)constant_iv.c_str(), (gsize)constant_iv_size);
11631117
gst_structure_set(metadata,
11641118
"iv", GST_TYPE_BUFFER, constant_iv_buf,
1165-
"iv_size", G_TYPE_UINT, constant_iv_size,
1119+
"constant_iv_size", G_TYPE_UINT, constant_iv_size,
11661120
"crypt_byte_block", G_TYPE_UINT, crypt_byte_block,
11671121
"skip_byte_block", G_TYPE_UINT, skip_byte_block,
11681122
NULL );
@@ -1173,8 +1127,11 @@ class Mp4Demux
11731127
if( metadata )
11741128
{ // serialize and print the metadata
11751129
gchar *structure_string = gst_structure_to_string( metadata );
1176-
PRINTF("metadata: %s\n", structure_string);
1130+
g_print("metadata: %s\n", structure_string);
11771131
g_free(structure_string);
1132+
1133+
// gst_structure_free( metadata );
1134+
// metadata = NULL;
11781135
}
11791136

11801137
return metadata;

test/qtdemuxAnalyzer/Makefile

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)