Skip to content

Commit

Permalink
Merge pull request #709 from Dash-Industry-Forum/development
Browse files Browse the repository at this point in the history
Release v2.3.0
  • Loading branch information
Phencys authored Sep 16, 2024
2 parents 5faeee7 + b18b71b commit 8c6428b
Show file tree
Hide file tree
Showing 159 changed files with 10,311 additions and 3,106 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-cli-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: curl, xdebug, xml
- name: Setup Java
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-cta-wave-test-vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: curl, xdebug, xml
- name: Setup Java
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-dash.js-test-vectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
extensions: curl, xdebug, xml
- name: Setup Java
uses: actions/setup-java@v3
Expand Down
7 changes: 3 additions & 4 deletions CMAF/impl/cfhdMediaProfileConformance.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

global $mpdHandler;

$videoSampleDescription = $xml->getElementsByTagName('vide_sampledescription');
if (!$videoSampleDescription->length) {
return false;
Expand Down Expand Up @@ -53,10 +55,7 @@
}
}

$unitsInTick = $nalComments->item(0)->getAttribute('num_units_in_tick');
$timescale = $nalComments->item(0)->getAttribute('timescale');
$maxFPS = ceil((int)timescale / (2 * (int)unitsInTick));
if ($maxFPS > 60) {
if ($mpdHandler->getFrameRate() > 60) {
return false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion CMAF/impl/checkAlignedSwitchingSets.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
//Todo:More generalized approach with many Aligned Sw Sets.
//Here assumption is only two Sw Sets are aligned.
$adaptationSets = $mpdHandler->getFeatures()['Period'][$mpdHandler->getSelectedPeriod()]['AdaptationSet'];
for ($z = 0; $z < count($adaptationSets); $z++) {
$adaptationCount = ($adaptationSets == null ? 0 : count($adaptationSets));
for ($z = 0; $z < $adaptationCount; $z++) {
$supplementalProperty = $adaptationSets[$z]['SupplementalProperty'];
if ($supplementalProperty) {
if ($supplementalProperty[0]['schemeIdUri'] == 'urn:mpeg:dash:adaptation-set-switching:2016') {
Expand Down
3 changes: 2 additions & 1 deletion CMAF/impl/checkCMAFPresentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

$presentationDuration = $period_timing_info["duration"];
$adaptationSets = $mpdHandler->getFeatures()['Period'][$mpdHandler->getSelectedPeriod()]['AdaptationSet'];
for ($adaptationSetIndex = 0; $adaptationSetIndex < sizeof($adaptationSets); $adaptationSetIndex++) {
$adaptationCount = ($adaptationSets == null ? 0 : count($adaptationSets));
for ($adaptationSetIndex = 0; $adaptationSetIndex < $adaptationCount; $adaptationSetIndex++) {
$adaptationSet = $adaptationSets[$adaptationSetIndex];

$location = $session->getAdaptationDir($mpdHandler->getSelectedPeriod(), $adaptationSetIndex);
Expand Down
14 changes: 6 additions & 8 deletions CMAF/impl/checkCMAFTracks.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
);
}

if ($mdatFile == null) {
if ($mdatFile === false) {
continue;
}

Expand Down Expand Up @@ -169,7 +169,7 @@
"Representation $id, chunk $j not valid"
);
}
if ($mdatFile !== null) {
if ($mdatFile !== false) {
fclose($mdatFile);
}

Expand All @@ -185,7 +185,7 @@
);

$hdlrBox = $xml->getElementsByTagName('hdlr')->item(0);
$hdlrType = $hdlrBox->getAttribute('handler_type');
$hdlrType = ($hdlrBox == null ? '' : $hdlrBox->getAttribute('handler_type'));

$elstBoxes = $xml->getElementsByTagName('elstEntry');
if ($elstBoxes->length > 0 && $hdlrType == 'vide') {
Expand Down Expand Up @@ -317,8 +317,6 @@
$nalUnits = $xml->getElementsByTagName('NALUnit');
if ($nalUnits->length > 0) {
$nalComment = $nalUnits->item(0)->getElementsByTagName('comment');
$numberOfUnitsInTick = $nalComment->item(0)->getAttribute('num_units_in_tick');
$timeScale = $nalComment->item(0)->getAttribute('time_scale');
$profileIdc = $nalUnits->item(0)->getAttribute('profile_idc');
$levelIdc = $nalComment->item(0)->getAttribute('level_idc');
}
Expand Down Expand Up @@ -368,10 +366,10 @@
"Section 7.3.2.4",
"Each CMAF Fragment in combination with its associated Header SHALL contain sufficient metadata to be " .
"decoded and displayed when independently accessed",
$numberOfUnitsInTick != null && $timeScale != null,
$mpdHandler->getFrameRate() != null,
"FAIL",
"FPS info (num_ticks & timescale) found for representation / track $id",
"FPS info (num_ticks & timescale) not found for representation / track $id",
"FPS info found in MPD for representation / track $id",
"FPS info not found in MPD for representation / track $id",
);
}
}
Expand Down
62 changes: 35 additions & 27 deletions CMAF/impl/determineCMAFMediaProfiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if ($nalUnits->length != 0) {
$spsUnitIndex = -1;
for ($nalIndex = 0; $nalIndex < $nalUnits->length; $nalIndex++) {
if ($nalUnits->item($nalIndex)->getAttribute("nal_type") == "0x07") {
if (hexdec($nalUnits->item($nalIndex)->getAttribute("nal_type")) == 7) {
$spsUnitIndex = $nalIndex;
break;
}
Expand All @@ -26,27 +26,31 @@
///\Resiliency Add checks for existing spsUnit
$avcC = $videoSampleDescription->getElementsByTagName('avcC')->item(0);
$comment = $nalUnits->item($spsUnitIndex)->getElementsByTagName("comment")->item(0);
$mediaProfileParameters['profile'] = $avcC->getAttribute("profile");
$mediaProfileParameters['profile'] = hexdec($avcC->getAttribute("profile"));
$mediaProfileParameters['level'] = (float)($comment->getAttribute("level_idc")) / 10;
$mediaProfileParameters['width'] = $videoSampleDescription->getAttribute("width");
$mediaProfileParameters['height'] = $videoSampleDescription->getAttribute("height");

if ($comment->getAttribute("vui_parameters_present_flag") == "0x1") {
if ($comment->getAttribute("video_signal_type_present_flag") == "0x1") {
if ($comment->getAttribute("colour_description_present_flag") == "0x1") {
$mediaProfileParameters['color_primaries'] = $comment->getAttribute("colour_primaries");
$mediaProfileParameters['transfer_char'] = $comment->getAttribute("transfer_characteristics");
$mediaProfileParameters['matrix_coeff'] = $comment->getAttribute("matrix_coefficients");
} elseif ($comment->getAttribute("colour_description_present_flag") == "0x0") {
$mediaProfileParameters['color_primaries'] = "0x1";
$mediaProfileParameters['transfer_char'] = "0x1";
$mediaProfileParameters['matrix_coeff'] = "0x1";
if (hexdec($comment->getAttribute("vui_parameters_present_flag")) == 1) {
if (hexdec($comment->getAttribute("video_signal_type_present_flag")) == 1) {
if (hexdec($comment->getAttribute("colour_description_present_flag")) == 1) {
$mediaProfileParameters['color_primaries'] = hexdec(
$comment->getAttribute("colour_primaries")
);
$mediaProfileParameters['transfer_char'] = hexdec(
$comment->getAttribute("transfer_characteristics")
);
$mediaProfileParameters['matrix_coeff'] = hexdec(
$comment->getAttribute("matrix_coefficients")
);
} elseif (hexdec($comment->getAttribute("colour_description_present_flag")) == 0) {
$mediaProfileParameters['color_primaries'] = 1;
$mediaProfileParameters['transfer_char'] = 1;
$mediaProfileParameters['matrix_coeff'] = 1;
}
}
if ($comment->getAttribute("timing_info_present_flag") == "0x1") {
$numUnitsInTick = $comment->getAttribute("num_units_in_tick");
$timeScale = $comment->getAttribute("time_scale");
$mediaProfileParameters['framerate'] = $timeScale / (2 * $numUnitsInTick);
if (hexdec($comment->getAttribute("timing_info_present_flag")) == 1) {
$mediaProfileParameters['framerate'] = $mpdHandler->getFrameRate();
}
}

Expand Down Expand Up @@ -100,19 +104,23 @@
if ($sps->getAttribute("vui_parameters_present_flag") == "1") {
if ($sps->getAttribute("video_signal_type_present_flag") == "1") {
if ($sps->getAttribute("colour_description_present_flag") == "1") {
$mediaProfileParameters['color_primaries'] = $sps->getAttribute("colour_primaries");
$mediaProfileParameters['transfer_char'] = $sps->getAttribute("transfer_characteristics");
$mediaProfileParameters['matrix_coeff'] = $sps->getAttribute("matrix_coeffs");
$mediaProfileParameters['color_primaries'] = hexdec(
$sps->getAttribute("colour_primaries")
);
$mediaProfileParameters['transfer_char'] = hexdec(
$sps->getAttribute("transfer_characteristics")
);
$mediaProfileParameters['matrix_coeff'] = hexdec(
$sps->getAttribute("matrix_coeffs")
);
} elseif ($sps->getAttribute("colour_description_present_flag") == "0") {
$mediaProfileParameters['color_primaries'] = "1";
$mediaProfileParameters['transfer_char'] = "1";
$mediaProfileParameters['matrix_coeff'] = "1";
$mediaProfileParameters['color_primaries'] = 1;
$mediaProfileParameters['transfer_char'] = 1;
$mediaProfileParameters['matrix_coeff'] = 1;
}
}
if ($sps->getAttribute("vui_timing_info_present_flag") == "1") {
$numUnitsInTick = $sps->getAttribute("vui_num_units_in_tick");
$timeScale = $sps->getAttribute("vui_time_scale");
$mediaProfileParameters['framerate'] = $timeScale / ($numUnitsInTick);
$mediaProfileParameters['framerate'] = $mpdHandler->getFrameRate();
}
}

Expand Down Expand Up @@ -142,8 +150,8 @@
$mediaProfileParameters['codec'] = "AAC";
$decoderSpecificInfo = $audioSampleDescription->getElementsByTagName("DecoderSpecificInfo")->item(0);
$mediaProfileParameters['sampleRate'] = $audioSampleDescription->getAttribute('sampleRate');
$mediaProfileParameters['profile'] = $decoderSpecificInfo->getAttribute("audioObjectType");
$mediaProfileParameters['channels'] = $decoderSpecificInfo->getAttribute("channelConfig");
$mediaProfileParameters['profile'] = hexdec($decoderSpecificInfo->getAttribute("audioObjectType"));
$mediaProfileParameters['channels'] = hexdec($decoderSpecificInfo->getAttribute("channelConfig"));

if (strpos($compatibleBrands, "caaa") !== false) {
$mediaProfileParameters['brand'] = "caaa";
Expand Down
4 changes: 2 additions & 2 deletions CMAF/impl/getAudioTrackMediaProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"CMAF",
"Section 10.4",
"Each AAC elementary stream SHALL be encoded using MPEG-4 AAC LC, HE-AAC Level 2, or HE-AACv2 Level 2",
in_array($mpParameters['profile'], array("0x02", "0x05", "0x1d")),
in_array($mpParameters['profile'], array(2, 5, 29)),
"FAIL",
"Valid profile found",
"Nonvalid profile found"
Expand Down Expand Up @@ -38,7 +38,7 @@
"CMAF",
"Section 10.4",
"AAC Core CMAF tracks SHALL not exceed two audio channels",
$mpParameters['channels'] == "0x1" || $mpParameters['channels'] == "0x2",
$mpParameters['channels'] == 1 || $mpParameters['channels'] == 2,
"FAIL",
"Valid channel count found",
"Nonvalid channel count found"
Expand Down
55 changes: 27 additions & 28 deletions CMAF/impl/getVideoTrackMediaProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

$level = $mpParameters['level'];
$profile = $mpParameters['profile'];
$colorPrimaries = $mpParameters['color_primaries'];
$transferCharacteristics = $mpParameters['transfer_char'];
$matrixCoefficients = $mpParameters['matrix_coeff'];
$height = $mpParameters['height'];
Expand Down Expand Up @@ -38,9 +37,9 @@
$mpParameters,
"A.2",
"A.1",
array("0x1","0x5","0x6"),
array("0x1","0x6"),
array("0x1","0x5","0x6"),
array(1,5,6),
array(1,6),
array(1,5,6),
576,
864,
60
Expand All @@ -56,9 +55,9 @@
$mpParameters,
"A.2",
"A.1",
array("0x1"),
array("0x1"),
array("0x1"),
array(1),
array(1),
array(1),
1080,
1920,
60
Expand All @@ -74,9 +73,9 @@
$mpParameters,
"A.2",
"A.1",
array("0x1"),
array("0x1"),
array("0x1"),
array(1),
array(1),
array(1),
1080,
1920,
60
Expand Down Expand Up @@ -138,9 +137,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x1"),
array("0x1"),
array("0x1"),
array(1),
array(1),
array(1),
1080,
1920,
60
Expand All @@ -156,9 +155,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x1"),
array("0x1"),
array("0x1"),
array(1),
array(1),
array(1),
2160,
3840,
60
Expand Down Expand Up @@ -193,9 +192,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x1"),
array("0x1"),
array("0x1"),
array(1),
array(1),
array(1),
1080,
1920,
60
Expand All @@ -211,9 +210,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x1", "0x9"),
array("0x1", "0x14", "0x15"),
array("0x1", "0x9", "0x10"),
array(1, 9),
array(1, 20, 21),
array(1, 9, 16),
2160,
3840,
60
Expand All @@ -233,9 +232,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x9"),
array("0x16"),
array("0x9", "0x10"),
array(9),
array(22),
array(9, 16),
2160,
3840,
60
Expand All @@ -249,9 +248,9 @@
$mpParameters,
"B.5",
"B.1",
array("0x9"),
array("0x14","0x18"),
array("0x9"),
array(9),
array(20,24),
array(9),
2160,
3840,
60
Expand Down
Loading

0 comments on commit 8c6428b

Please sign in to comment.