├── .gitignore
├── CMAFHandle.php
├── CMAFInitialization.php
├── CMAFPresentationValidation.php
├── CMAFSwitchingSetsValidation.php
├── CMAFTracksValidation.php
├── CTAWAVE
├── CTAWAVE_BaselineSpliceChecks.php
├── CTAWAVE_Handle.php
├── CTAWAVE_Initialization.php
├── CTAWAVE_PresentationProfile.php
├── CTAWAVE_Programs.php
├── CTAWAVE_SelectionSet.php
├── LICENSE
├── README.md
└── UnitTests
│ ├── Doc
│ ├── UnitTesting_Doc.docx
│ └── UnitTesting_Doc.pdf
│ ├── MediaProfilesTest.php
│ ├── PresentationProfileTest.php
│ ├── Presention_examples
│ ├── CMFHD_video
│ │ └── Period0
│ │ │ └── Adapt0
│ │ │ ├── Adapt0rep0.xml
│ │ │ └── Adapt0rep1.xml
│ └── noCMFHD_video
│ │ └── Period0
│ │ └── Adapt0
│ │ ├── Adapt0rep0.xml
│ │ └── Adapt0rep1.xml
│ ├── ProgramsTest.php
│ ├── SelectionSetTest.php
│ ├── Selection_set_examples
│ ├── SelSetVideoNoWaveSwSet
│ │ └── Period0
│ │ │ └── Adapt0
│ │ │ ├── Adapt0rep0.xml
│ │ │ └── Adapt0rep1.xml
│ ├── SelSetVideoNoWaveTracks
│ │ └── Period0
│ │ │ └── Adapt0
│ │ │ ├── Adapt0rep0.xml
│ │ │ └── Adapt0rep1.xml
│ ├── SelSetVideoWaveSwSet
│ │ └── Period0
│ │ │ └── Adapt0
│ │ │ ├── Adapt0rep0.xml
│ │ │ └── Adapt0rep1.xml
│ └── SwSetSingleInit
│ │ └── Adapt0
│ │ └── Adapt0rep0.xml
│ ├── SpliceConstraintsTest.php
│ └── Splice_examples
│ ├── Audio
│ ├── Fail_case
│ │ ├── Period0
│ │ │ └── Adapt0
│ │ │ │ └── Adapt0rep0.xml
│ │ └── Period1
│ │ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ └── Pass_case
│ │ ├── Period0
│ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ │ └── Period1
│ │ └── Adapt0
│ │ └── Adapt0rep0.xml
│ ├── CMFHDBaseline
│ ├── Period0
│ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ ├── Period1
│ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ ├── SampleErrorLog.txt
│ └── SampleNoErrorLog.txt
│ ├── Fail_case
│ ├── Period0
│ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ ├── Period1
│ │ └── Adapt0
│ │ │ └── Adapt0rep0.xml
│ └── SampleErrorLog.txt
│ └── Pass_case
│ ├── Period0
│ └── Adapt0
│ │ └── Adapt0rep0.xml
│ └── Period1
│ └── Adapt0
│ └── Adapt0rep0.xml
├── Documentation
├── CMAF_conformance_checklist.pdf
├── CMAF_conformance_checklist.xlsx
├── CTAWAVE_confomance_checklist.docx
├── CTAWAVE_confomance_checklist.pdf
├── Instructions_newMediaProfile_addition.docx
└── Instructions_newMediaProfile_addition.pdf
├── LICENSE
├── README.md
└── cmaf_OnOff.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | CTAWAVE/UnitTests/vendor
2 | CTAWAVE/UnitTests/composer.json
3 | CTAWAVE/UnitTests/composer.lock
4 | CTAWAVE/UnitTests/out.txt
5 | CTAWAVE/UnitTests/temp.txt
6 |
--------------------------------------------------------------------------------
/CMAFHandle.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | function CMAF_Handle($request){
17 | $return_val = NULL;
18 | switch($request){
19 | case 'BeforeRepresentation':
20 | $return_val = CMAFFlags();
21 | break;
22 | case 'Representation':
23 | $return_val = checkCMAFTracks();
24 | break;
25 | case 'AdaptationSet':
26 | $return_val = checkSwitchingSets();
27 | break;
28 | case 'All':
29 | $return_val = checkPresentation();
30 | break;
31 | default:
32 | break;
33 | }
34 |
35 | return $return_val;
36 | }
--------------------------------------------------------------------------------
/CMAFInitialization.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | include 'CMAFHandle.php';
17 | include 'CMAFTracksValidation.php';
18 | include 'CMAFSwitchingSetsValidation.php';
19 | include 'CMAFPresentationValidation.php';
20 |
21 | $cmaf_function_name = 'CMAF_handle';
22 | $cmaf_when_to_call = array('BeforeRepresentation', 'Representation', 'AdaptationSet', 'All');
23 |
24 | $cmaf_mediaTypes = array();
25 | $cmaf_mediaProfiles = array();
26 | $infofile_template = 'infofile$Number$.txt';
27 | $compinfo_file = 'Adapt$AS$_compInfo';
28 | $comparison_folder = 'comparisonResults/';
29 | $presentation_infofile = 'Presentation_infofile';
30 | $selectionset_infofile = 'SelectionSet_infofile';
31 | $alignedswitching_infofile= 'AlignedSwitchingSet_infofile';
--------------------------------------------------------------------------------
/CTAWAVE/CTAWAVE_Handle.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | function CTAWAVE_Handle($request){
17 | $return_val = NULL;
18 | switch($request){
19 | case 'Tracks':
20 | CTAFlags();
21 | break;
22 | case 'AdaptationSet':
23 | $return_val = CTASelectionSet();
24 | $return_val = CTAPresentation();
25 | break;
26 | case 'Period' :
27 | $return_val= CTABaselineSpliceChecks();
28 | default:
29 | break;
30 | }
31 |
32 | return $return_val;
33 | }
--------------------------------------------------------------------------------
/CTAWAVE/CTAWAVE_Initialization.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | include 'CTAWAVE_Handle.php';
17 | include 'CTAWAVE_SelectionSet.php';
18 | include 'CTAWAVE_PresentationProfile.php';
19 | include 'CTAWAVE_BaselineSpliceChecks.php';
20 | include 'CTAWAVE_Programs.php';
21 |
22 | $ctawave_function_name = 'CTAWAVE_Handle';
23 | $ctawave_when_to_call = array( 'Tracks','AdaptationSet','Period');
24 | $CTAselectionset_infofile = 'SelectionSet_infofile_ctawave';
25 | $CTApresentation_infofile = 'Presentation_infofile_ctawave';
26 | $CTAspliceConstraitsLog='SpliceConstraints_infofile_ctawave';
27 | $MediaProfDatabase=array();
28 |
29 | function CTAFlags(){
30 | global $additional_flags;
31 | $additional_flags .= ' -ctawave';
32 | }
--------------------------------------------------------------------------------
/CTAWAVE/CTAWAVE_PresentationProfile.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | function CTAPresentation()
17 | {
18 | global $mpd_features,$session_dir,$CTApresentation_infofile,$current_period,$adaptation_set_template, $opfile, $string_info, $progress_xml, $progress_report;
19 | $opfile="";
20 |
21 | if(!($opfile = open_file($session_dir. '/Period' . $current_period . '/' . $CTApresentation_infofile . '.txt', 'w'))){
22 | echo "Error opening/creating Presentation profile conformance check file: "."./Presentation_infofile_ctawave.txt";
23 | return;
24 | }
25 | $adapts = $mpd_features['Period'][$current_period]['AdaptationSet'];
26 | $result= CTACheckPresentation(sizeof($adapts), $session_dir, $adaptation_set_template, $opfile,$current_period);
27 | fclose($opfile);
28 |
29 | $searchfiles = file_get_contents($session_dir.'/Period'.$current_period.'/'.$CTApresentation_infofile.'.txt');
30 | if(strpos($searchfiles, "CTAWAVE check violated") !== FALSE){
31 | $progress_xml->Results[0]->Period[$current_period]->addChild('CTAWAVEPresentation', 'error');
32 | $file_error[] = $session_dir.'/Period' .$current_period.'/'.$CTApresentation_infofile.'.html';
33 | }
34 | elseif(strpos($searchfiles, "Warning") !== FALSE || strpos($searchfiles, "WARNING") !== FALSE){
35 | $progress_xml->Results[0]->Period[$current_period]->addChild('CTAWAVEPresentation', 'warning');
36 | $file_error[] = $session_dir.'/Period'.$current_period.'/'.$CTApresentation_infofile.'.html';
37 | }
38 | else{
39 | $progress_xml->Results[0]->Period[$current_period]->addChild('CTAWAVEPresentation', 'noerror');
40 | $file_error[] = "noerror";
41 | }
42 | $progress_xml->asXml(trim($session_dir . '/' . $progress_report));
43 | tabulateResults($session_dir.'/Period'.$current_period.'/'.$CTApresentation_infofile.'.txt', 'Cross');
44 | print_console($session_dir.'/Period'.$current_period.'/'.$CTApresentation_infofile.'.txt', "Period " . ($current_period+1) . " CTA WAVE Presentation Results");
45 | }
46 |
47 | function CTACheckPresentation($adapts_count,$session_dir,$adaptation_set_template,$opfile,$current_period)
48 | {
49 |
50 | $cfhdVideoSwSetFound=0;$videoSelectionSetFound=0;
51 | $caacAudioSwSetFound=0;$audioSelectionSetFound=0;
52 | $im1tSubtitleSwSetFound=0;$subtitleSelectionSetFound=0;
53 | $handler_type=""; $errorMsg="";$encryptedTrackFound=0;$cencSwSetFound=0;$cbcsSwSetFound=0;
54 | $presentationProfile="";
55 |
56 | for($adapt_count=0; $adapt_count<$adapts_count; $adapt_count++){
57 |
58 | $SwSet_MP=array();
59 | $EncTracks=array();
60 | $adapt_dir = str_replace('$AS$', $adapt_count, $adaptation_set_template);
61 | $loc = $session_dir . '/Period' . $current_period . '/' . $adapt_dir.'/';
62 | $filecount = 0;
63 | $files = glob($loc . "*.xml");
64 | if($files)
65 | $filecount = count($files);
66 | if(!file_exists($loc))
67 | fprintf ($opfile, "Switching Set ".$adapt_count."-Tried to retrieve data from a location that does not exist. \n (Possible cause: Representations are not valid and no file/directory for box info is created.)");
68 | else{
69 | for($fcount=0;$fcount<$filecount;$fcount++)
70 | {
71 | $xml = get_DOM($files[$fcount], 'atomlist');
72 | if($xml){
73 | $hdlr=$xml->getElementsByTagName("hdlr")->item(0);
74 | $handler_type=$hdlr->getAttribute("handler_type");
75 | $MPTrackResult=getMediaProfile($xml,$handler_type,$fcount, $adapt_count,$opfile);
76 | $MPTrack=$MPTrackResult[0];
77 | if($handler_type=="vide")
78 | {
79 | $videoSelectionSetFound=1;
80 |
81 | }
82 | if($handler_type=="soun")
83 | {
84 | $audioSelectionSetFound=1;
85 |
86 | }
87 | if($handler_type=="subt")
88 | {
89 | $subtitleSelectionSetFound=1;
90 |
91 | }
92 | array_push($SwSet_MP, $MPTrack);
93 |
94 | //Check for encrypted tracks
95 | if($xml->getElementsByTagName('tenc')->length >0)
96 | {
97 | $encryptedTrackFound=1;
98 | $schm=$xml->getElementsByTagName('schm');
99 | if($schm->length>0)
100 | array_push($EncTracks,$schm->item(0)->getAttribute('scheme'));
101 | }
102 | }
103 | }
104 |
105 | if(count(array_unique($SwSet_MP)) === 1)
106 | {
107 | if($handler_type==="vide" && array_unique($SwSet_MP)[0]==="HD"){
108 | $cfhdVideoSwSetFound=1;
109 | }elseif($handler_type=="soun" && array_unique($SwSet_MP)[0]==="AAC_Core"){
110 | $caacAudioSwSetFound=1;
111 | }
112 | elseif($handler_type=="subt" && array_unique($SwSet_MP)[0]==="TTML_IMSC1_Text"){
113 | $im1tSubtitleSwSetFound=1;
114 | }
115 |
116 | }
117 | if($encryptedTrackFound===1)
118 | {
119 | if(count($EncTracks)==$filecount && count(array_unique($EncTracks)) === 1 && array_unique($EncTracks)[0]==="cenc")
120 | $cencSwSetFound=1;
121 | elseif(count($EncTracks)==$filecount && count(array_unique($EncTracks)) === 1 && array_unique($EncTracks)[0]==="cbcs")
122 | $cbcsSwSetFound=1;
123 |
124 | }
125 | }
126 | }
127 |
128 |
129 | $PresProfArray=array();
130 | if($videoSelectionSetFound )
131 | {
132 | if(!$cfhdVideoSwSetFound)
133 | {
134 | array_push($PresProfArray,"");
135 | fprintf ($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: 'If a video track is included, then conforming Presentation will at least include that video in a CMAF SwSet conforming to required AVC (HD) Media Profile', but AVC-HD SwSet not found in the presentation. \n");
136 |
137 | }
138 | else
139 | array_push($PresProfArray,getPresentationProfile($encryptedTrackFound,$cencSwSetFound,$cbcsSwSetFound,$opfile));
140 |
141 | }
142 | if($audioSelectionSetFound )//&& $caacAudioSwSetFound) ||( && $im1tSubtitleSwSetFound
143 | {
144 | if(!$caacAudioSwSetFound)
145 | {
146 | array_push($PresProfArray,"");
147 | fprintf ($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: 'If an audio track is included, then conforming Presentation will at least include that audio in a CMAF SwSet conforming to required AAC (Core) Media Profile', but AAC-Core SwSet not found in the presentation. \n");
148 |
149 | }
150 | else
151 | array_push($PresProfArray,getPresentationProfile($encryptedTrackFound,$cencSwSetFound,$cbcsSwSetFound,$opfile));
152 | }
153 | if($subtitleSelectionSetFound)
154 | {
155 | if(!$im1tSubtitleSwSetFound)
156 | {
157 | array_push($PresProfArray,"");
158 | fprintf ($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: 'If a subtitle track is included, then conforming Presentation will at least include that subtitle in a CMAF SwSet conforming to TTML Text Media Profile', but TTML Text SwSet not found in the presentation. \n");
159 |
160 | }
161 | else
162 | array_push($PresProfArray,getPresentationProfile($encryptedTrackFound,$cencSwSetFound,$cbcsSwSetFound,$opfile));
163 | }
164 |
165 | if(in_array("", $PresProfArray))
166 | $presentationProfile="";
167 | elseif(count(array_unique($PresProfArray))===1)
168 | $presentationProfile=$PresProfArray[0];
169 | else
170 | $presentationProfile="";
171 | /*
172 | fprintf($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: For CMAF Presentation profile ".$presnt_profile." ',if video track is included, then Presentation will at least include that video in a CMAF SwSet conforming to AVC-HD Media Profile', video track found but SWSet conforming to AVC-HD not found \n");
173 | if(inarray($profile,$profilesArray) && $audioSelectionSetFound && $caacAudioSwSetFound!=1)
174 | fprintf($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: For CMAF Presentation profile ".$presnt_profile." ',if audio track is included, then Presentation will at least include that audio in a CMAF SwSet conforming to AAC-Core Media Profile', audio track found but SWSet conforming to AAC-Core not found \n");
175 |
176 | if(inarray($profile,$profilesArray) && $subtitleSelectionSetFound && $im1tSubtitleSwSetFound!=1)
177 | fprintf($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: For CMAF Presentation profile ".$presnt_profile." ',if subtitile track is included, then Presentation will at least include that subtitle in a CMAF SwSet conforming to IMSC1-Text Media Profile', subtitle track found but SWSet conforming to IMSC1-Text not found \n");
178 | if($profile_cmfhdc && $encryptedSwSetFound!=1)
179 | fprintf($opfile, "**'CMAF check violated: Section A.1.3 - 'At least one CMAF Switching Set SHALL be encrypted', but found none. \n");
180 | if($profile_cmfhds && $encryptedSwSetFound!=1)
181 | fprintf($opfile, "**'CMAF check violated: Section A.1.4 - 'At least one CMAF Switching Set SHALL be encrypted', but found none. \n");
182 | */
183 |
184 | if($presentationProfile!=="")
185 | fprintf ($opfile, "Information: The WAVE content conforms to CMAF Presentation Profile- ".$presentationProfile." \n");
186 | else
187 | fprintf ($opfile, "Information: The WAVE content doesn't conform to any of the CMAF Presentation Profiles \n");
188 |
189 | return $presentationProfile;
190 |
191 | }
192 | function getPresentationProfile($encryptedTrackFound,$cencSwSetFound,$cbcsSwSetFound,$opfile)
193 | {
194 | $presentationProfile="";
195 | if($encryptedTrackFound===0)
196 | $presentationProfile="CMFHD";
197 | elseif($encryptedTrackFound && $cencSwSetFound && $cbcsSwSetFound)
198 | fprintf($opfile, "###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 5: 'Each CMAF Presentation Profile contains either all unencrypted samples or some samples encrypted with CENC using 'cenc' or 'cbcs' scheme, but not both', here SwSet with 'cenc' and 'cbcs' are found.");
199 | elseif($encryptedTrackFound && $cencSwSetFound)
200 | $presentationProfile="CMFHDc";
201 | elseif($encryptedTrackFound && $cencSwSetFound)
202 | $presentationProfile="CMFHDs";
203 |
204 | return $presentationProfile;
205 | }
206 | ?>
207 |
--------------------------------------------------------------------------------
/CTAWAVE/CTAWAVE_Programs.php:
--------------------------------------------------------------------------------
1 | getElementsByTagName('hdlr')->item(0);
87 | $handler_type_1=$hdlr->getAttribute("handler_type");
88 | $trun=$xml_rep_P1->getElementsByTagName('trun');
89 | $mdhd=$xml_rep_P1->getElementsByTagName("mdhd")->item(0);
90 | $timescale_1=$mdhd->getAttribute("timescale");
91 | $earlyCompTime_p1=$trun->item(0)->getAttribute('earliestCompositionTime');
92 | $xml_elst=$xml_rep_P1->getElementsByTagName('elstEntry');
93 | $mediaTime_p1=0;
94 | if($xml_elst->length>0 ){
95 | $mediaTime_p1=$xml_elst->item(0)->getAttribute('mediaTime');
96 | }
97 | $sumSampleDur=0;
98 | for($j=0;$j<$trun->length;$j++)
99 | {
100 | $sumSampleDur+=$trun->item($j)->getAttribute("cummulatedSampleDuration");
101 | }
102 | }
103 | $xml_rep_P2 = get_DOM($session_dir.'/Period'.($i+1).'/'.$adapt_dir.'/'.$rep_dir.'.xml', 'atomlist');
104 | if($xml_rep_P2){
105 | $hdlr=$xml_rep_P2->getElementsByTagName('hdlr')->item(0);
106 | $handler_type_2=$hdlr->getAttribute("handler_type");
107 | $mdhd=$xml_rep_P2->getElementsByTagName("mdhd")->item(0);
108 | $timescale_2=$mdhd->getAttribute("timescale");
109 | $sidx=$xml_rep_P2->getElementsByTagName('sidx');
110 | if($sidx->length>0)
111 | {
112 | $presTime_p2=$sidx->item(0)->getAttribute("earliestPresentationTime");
113 | }
114 | else
115 | {
116 | $trun=$xml_rep_P2->getElementsByTagName('trun')->item(0);
117 | $earlyCompTime_p2=$trun->getAttribute('earliestCompositionTime');
118 | $xml_elst=$xml_rep_P2->getElementsByTagName('elstEntry');
119 | $mediaTime_p2=0;
120 | if($xml_elst->length>0 ){
121 | $mediaTime_p2=$xml_elst->item(0)->getAttribute('mediaTime');
122 | }
123 | $presTime_p2=$earlyCompTime_p2+$mediaTime_p2;
124 | }
125 |
126 | }
127 | if($handler_type_1==$handler_type_2 && ($handler_type_1 == "vide" || $handler_type_1=="soun"))
128 | {
129 | if((($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur)/$timescale_1) != ($presTime_p2/$timescale_2))
130 | $errorMsg="###CTA WAVE check violated: WAVE Content Spec 2018Ed-Section 6.1: 'For a WAVE Program with more than one CMAF Presentation, all audio and video Shall be contained in Sequential Sw Sets', overlap/gap in presenation time (non-sequential) is observed for Sw set ".$adapt." between CMAF Presentations ".$i." (".($earlyCompTime_p1+$mediaTime_p1+$sumSampleDur)/$timescale_1.") and ".($i+1)." (".($presTime_p2/$timescale_2).") for media type- ".$handler_type_1." .\n";
131 | }
132 | }
133 | }
134 | return $errorMsg;
135 | }
--------------------------------------------------------------------------------
/CTAWAVE/LICENSE:
--------------------------------------------------------------------------------
1 | CTAWAVE
2 |
3 | The GNU General Public License
4 | Version 3
5 | http://www.gnu.org/licenses/
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see
19 |
--------------------------------------------------------------------------------
/CTAWAVE/README.md:
--------------------------------------------------------------------------------
1 | # CTAWAVE
2 |
3 | This is a submodule of the CMAF under [DASH-IF Conformance Software Tool](https://github.com/Dash-Industry-Forum/DASH-IF-Conformance) and contains related functionalities for CTAWAVE conformance checking. It has been created to maintain and manage the CTAWAVE-related conformance features in accordance with the CTAWAVE specification.
4 |
5 | The CTA WAVE Github project for this repository is located at https://github.com/orgs/Dash-Industry-Forum/projects/6 but it is not visible to the public. To see this page and contribute, please get in contact with repository admin to be added as a collaborator.
6 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Doc/UnitTesting_Doc.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/CTAWAVE/UnitTests/Doc/UnitTesting_Doc.docx
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Doc/UnitTesting_Doc.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/CTAWAVE/UnitTests/Doc/UnitTesting_Doc.pdf
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/MediaProfilesTest.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | declare(strict_types=1);
17 | require_once '../CTAWAVE_SelectionSet.php';
18 |
19 | use PHPUnit\Framework\TestCase;
20 |
21 | final class MediaProfileTest extends TestCase
22 | {
23 |
24 | public function testAVCMediaProfile()
25 | {
26 |
27 |
28 | $rep_count=0;
29 | $adapt_count=0;
30 | //Check for HD profile of AVC.
31 | $xmlParamsTobeTested=array("codec" => "AVC", "profile" => "high", "level" => "4.0",
32 | "height" => "1080" , "width"=> "1920" , "framerate" => "60","color_primaries" => "0x1",
33 | "transfer_char" => "0x1", "matrix_coeff" => "0x1", "tier" => "", "brand"=>"" );
34 |
35 | $this->assertSame("HD", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
36 |
37 | //check that SD profile also conforms to HD profile of AVC.
38 | $xmlParamsTobeTested=array("codec" => "AVC", "profile" => "main", "level" => "3.1",
39 | "height" => "576" , "width"=> "864" , "framerate" => "30","color_primaries" => "0x1",
40 | "transfer_char" => "0x1", "matrix_coeff" => "0x1", "tier" => "", "brand"=>"" );
41 |
42 | $this->assertSame("HD", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
43 |
44 | }
45 |
46 | public function testNonAVCMediaProfile()
47 | {
48 |
49 | $rep_count=0;
50 | $adapt_count=0;
51 | //Check for HD profile of AVC.
52 | $xmlParamsTobeTested=array("codec" => "AVC", "profile" => "high", "level" => "4.2",
53 | "height" => "1080" , "width"=> "1920" , "framerate" => "60","color_primaries" => "0x1",
54 | "transfer_char" => "0x1", "matrix_coeff" => "0x1", "tier" => "", "brand"=>"" );
55 |
56 | $this->assertSame("AVC_HDHF", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
57 |
58 | //check unknown profile
59 | $xmlParamsTobeTested=array("codec" => "AVC", "profile" => "high", "level" => "5.0",
60 | "height" => "2160" , "width"=> "3840" , "framerate" => "80","color_primaries" => "",
61 | "transfer_char" => "", "matrix_coeff" => "", "tier" => "", "brand"=>"" );
62 |
63 | $this->assertNotSame("HD", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
64 |
65 | }
66 |
67 | public function testHEVCMediaProfile()
68 | {
69 |
70 |
71 | $rep_count=0;
72 | $adapt_count=0;
73 | //Check for HD profile of AVC.
74 | $xmlParamsTobeTested=array("codec" => "HEVC", "profile" => "Main10", "level" => "4.1",
75 | "height" => "1080" , "width"=> "1920" , "framerate" => "60","color_primaries" => "1",
76 | "transfer_char" => "1", "matrix_coeff" => "1", "tier" =>"0", "brand"=>"" );
77 |
78 | $this->assertSame("HHD10", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
79 |
80 |
81 | //Check for HD profile of AVC.
82 | $xmlParamsTobeTested=array("codec" => "HEVC", "profile" => "Main10", "level" => "5.1",
83 | "height" => "2160" , "width"=> "3840" , "framerate" => "60","color_primaries" => "9",
84 | "transfer_char" => "18", "matrix_coeff" => "9", "tier" => "0", "brand"=>"" );
85 |
86 | $this->assertSame("HLG10", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
87 |
88 | //Check for HD profile of AVC.
89 | $xmlParamsTobeTested=array("codec" => "HEVC", "profile" => "Main", "level" => "4.1",
90 | "height" => "1080" , "width"=> "1920" , "framerate" => "60","color_primaries" => "1",
91 | "transfer_char" => "1", "matrix_coeff" => "1", "tier" => "0", "brand"=>"" );
92 |
93 | $this->assertSame("HHD10", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
94 |
95 | }
96 |
97 | public function testNonHEVCMediaProfile()
98 | {
99 |
100 | $rep_count=0;
101 | $adapt_count=0;
102 |
103 | //check unknown profile
104 | $xmlParamsTobeTested=array("codec" => "HEVC", "profile" => "Main", "level" => "5.1",
105 | "height" => "2160" , "width"=> "3840" , "framerate" => "80","color_primaries" => "1",
106 | "transfer_char" => "5", "matrix_coeff" => "6", "tier" => "0", "brand"=>"" );
107 |
108 | $this->assertNotSame("HHD10", checkAndGetConformingVideoProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
109 |
110 | }
111 | public function testAACMediaProfile()
112 | {
113 |
114 | $rep_count=0;
115 | $adapt_count=0;
116 | //Check for HD profile of AVC.
117 | $xmlParamsTobeTested=array("codec" => "AAC", "profile" => "0x02", "level"=>"",
118 | "channels" => "0x1" , "sampleRate" => "48000", "brand"=>"" );
119 |
120 | $this->assertSame("AAC_Core", checkAndGetConformingAudioProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
121 |
122 |
123 | }
124 | public function testNonAACMediaProfile()
125 | {
126 |
127 | $rep_count=0;
128 | $adapt_count=0;
129 | //Check for HD profile of AVC.
130 | $xmlParamsTobeTested=array("codec" => "AAC", "profile" => "0x02", "level"=>"",
131 | "channels" => "0x1" , "sampleRate" => "50000", "brand"=>"" );
132 |
133 | $this->assertNotSame("AAC_Core", checkAndGetConformingAudioProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
134 |
135 |
136 | }
137 | public function testAACMediaProfile2()
138 | {
139 |
140 | $rep_count=0;
141 | $adapt_count=0;
142 | //Check for HD profile of AVC.
143 | $xmlParamsTobeTested=array("codec" => "AAC", "profile" => "0x02", "level"=>"AAC@L2",
144 | "channels" => "0x1" , "sampleRate" => "48000", "brand"=>"" );
145 |
146 | $this->assertSame("AAC_Core", checkAndGetConformingAudioProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
147 |
148 |
149 | }
150 |
151 | public function testAACMultiChannelMediaProfile()
152 | {
153 |
154 | $rep_count=0;
155 | $adapt_count=0;
156 | //Check for AAC Multichannel.
157 | $xmlParamsTobeTested=array("codec" => "AAC", "profile" => "0x02", "level"=>"High Quality Audio@L6",
158 | "channels" => "0x5" , "sampleRate" => "48000", "brand"=>"camc" );
159 |
160 | $this->assertSame("AAC_Multichannel", checkAndGetConformingAudioProfile($xmlParamsTobeTested,$rep_count,$adapt_count)[0]);
161 |
162 |
163 | }
164 | }
165 |
166 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/PresentationProfileTest.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | declare(strict_types=1);
17 | require_once '../CTAWAVE_SelectionSet.php';
18 | require_once '../CTAWAVE_PresentationProfile.php';
19 | include(dirname(__FILE__)."/../../../Utils/Load.php");
20 |
21 | use PHPUnit\Framework\TestCase;
22 |
23 | final class PresentationProfileTest extends TestCase
24 | {
25 |
26 | public function testCMAFPresentationProfile()
27 | {
28 | $adapts_count=1;
29 | //The given directory contains a SwSet of video with two tracks conforming to AVC-HD Media profile
30 | // and hence expected to conform to CMFHD presentation profile.
31 | $session_dir="Presention_examples/CMFHD_video/";
32 | $adaptation_set_template='Adapt$AS$';
33 | $outfile=fopen("out.txt","w");
34 | $current_period=0;
35 | $this->assertSame("CMFHD", CTACheckPresentation($adapts_count,$session_dir,$adaptation_set_template,$outfile,$current_period));
36 | }
37 |
38 | public function testNoCMAFPresentationProfile()
39 | {
40 | $adapts_count=1;
41 | //The given directory contains a SwSet of video with two tracks not conforming to any Media profile
42 | // and hence expected not to conform to CMFHD or any other presentation profiles.
43 | $session_dir="Presention_examples/noCMFHD_video/";
44 | $adaptation_set_template='Adapt$AS$';
45 | $outfile=fopen("out.txt","w");
46 | $current_period=0;
47 | //CMFHD presentation profile is not expected, hence check notSame assertion.
48 | $this->assertNotSame("CMFHD", CTACheckPresentation($adapts_count,$session_dir,$adaptation_set_template,$outfile,$current_period));
49 | }
50 |
51 |
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Presention_examples/CMFHD_video/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
49 |
50 |
51 |
53 |
54 |
55 |
58 |
60 |
61 |
62 |
63 |
66 |
83 |
86 |
97 |
104 |
155 |
156 |
178 |
179 |
180 |
181 |
182 |
183 |
186 |
187 |
190 |
191 |
195 |
196 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
208 |
209 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Presention_examples/CMFHD_video/Period0/Adapt0/Adapt0rep1.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
49 |
50 |
51 |
53 |
54 |
55 |
58 |
60 |
61 |
62 |
63 |
66 |
83 |
86 |
97 |
104 |
155 |
156 |
178 |
179 |
180 |
181 |
182 |
183 |
186 |
187 |
190 |
191 |
195 |
196 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
208 |
209 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Presention_examples/noCMFHD_video/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
49 |
50 |
51 |
53 |
54 |
55 |
58 |
60 |
61 |
62 |
63 |
66 |
83 |
86 |
97 |
104 |
149 |
150 |
172 |
173 |
174 |
175 |
176 |
177 |
180 |
181 |
184 |
185 |
189 |
190 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
202 |
203 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Presention_examples/noCMFHD_video/Period0/Adapt0/Adapt0rep1.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
49 |
50 |
51 |
53 |
54 |
55 |
58 |
60 |
61 |
62 |
63 |
66 |
83 |
86 |
97 |
104 |
149 |
150 |
172 |
173 |
174 |
175 |
176 |
177 |
180 |
181 |
184 |
185 |
189 |
190 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
202 |
203 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/ProgramsTest.php:
--------------------------------------------------------------------------------
1 | assertContains("contained in Sequential Sw Sets', overlap/gap in presenation time (non-sequential) is observed for Sw set",
26 | checkSequentialSwSetAV($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template));
27 | }
28 |
29 | public function testSequentialVideoSwSet()
30 | {
31 | $MediaProfDatabase[0][0][0]="HD";
32 | $MediaProfDatabase[1][0][0]="HD";
33 | $session_dir="Splice_examples/Pass_case";
34 | $adaptation_set_template='Adapt$AS$';
35 | $reprsentation_template = 'Adapt$AS$rep$R$';
36 | $this->assertNotContains("contained in Sequential Sw Sets', overlap/gap in presenation time (non-sequential) is observed for Sw set",
37 | checkSequentialSwSetAV($session_dir,$MediaProfDatabase, $adaptation_set_template,$reprsentation_template));
38 | }
39 |
40 | public function testCMFHDBaselineFailWAVEBaseline()
41 | {
42 | $MediaProfDatabase[0][0][0]="HD";
43 | $MediaProfDatabase[1][0][0]="HD";
44 | $session_dir="Splice_examples/Fail_case";
45 | $adaptation_set_template='Adapt$AS$';
46 | $reprsentation_template = 'Adapt$AS$rep$R$';
47 | $spliceConstraitsLog="SampleErrorLog";
48 | $this->assertContains("contain splices conforming to WAVE Baseline Splice profile (section 7.2)', but violation observed in WAVE Baseline",
49 | checkCMFHDBaselineConstraints($MediaProfDatabase, $session_dir,$adaptation_set_template,$spliceConstraitsLog));
50 | }
51 |
52 | public function testCMFHDBaselineFailCMFHDPresentation()
53 | {
54 | $MediaProfDatabase[0][0][0]="HD";
55 | $MediaProfDatabase[1][0][0]="HD";
56 | $session_dir="Splice_examples/Fail_case";
57 | $adaptation_set_template='Adapt$AS$';
58 | $reprsentation_template = 'Adapt$AS$rep$R$';
59 | $spliceConstraitsLog="SampleErrorLog";
60 | $this->assertContains("more CMAF Presentations conforming to CMAF CMFHD profile', violated as not all CMAF presentations conforms to CMFHD",
61 | checkCMFHDBaselineConstraints($MediaProfDatabase, $session_dir,$adaptation_set_template,$spliceConstraitsLog));
62 | }
63 | public function testCMFHDBaselinePass()
64 | {
65 | $MediaProfDatabase[0][0][0]="HD";
66 | $MediaProfDatabase[1][0][0]="HD";
67 | $session_dir="Splice_examples/CMFHDBaseline";
68 | $adaptation_set_template='Adapt$AS$';
69 | $reprsentation_template = 'Adapt$AS$rep$R$';
70 | $spliceConstraitsLog="SampleNoErrorLog";
71 | $this->assertNotContains("more CMAF Presentations conforming to CMAF CMFHD profile', violated as not all CMAF presentations conforms to CMFHD",
72 | checkCMFHDBaselineConstraints($MediaProfDatabase, $session_dir,$adaptation_set_template,$spliceConstraitsLog));
73 | $this->assertNotContains("contain splices conforming to WAVE Baseline Splice profile (section 7.2)', but violation observed in WAVE Baseline",
74 | checkCMFHDBaselineConstraints($MediaProfDatabase, $session_dir,$adaptation_set_template,$spliceConstraitsLog));
75 | }
76 |
77 | }
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/SelectionSetTest.php:
--------------------------------------------------------------------------------
1 | .
14 | */
15 |
16 | declare(strict_types=1);
17 | require_once '../CTAWAVE_SelectionSet.php';
18 | include(dirname(__FILE__)."/../../../Utils/Load.php");
19 |
20 | use PHPUnit\Framework\TestCase;
21 |
22 | final class SelectionSetTest extends TestCase
23 | {
24 | //Test that no WAVE Tracks are found in the SwSet of the SelSet.
25 | //Two non WAVE tracks are present in the SwSet of this SelSet.
26 | public function testNoWAVETracksInSelSet()
27 | {
28 | $adapts_count=1;
29 | $session_dir="Selection_set_examples/SelSetVideoNoWaveTracks";
30 | $adaptation_set_template='Adapt$AS$';
31 | $outfile=fopen("out.txt","w");
32 | $current_period=0;
33 | $this->assertContains("no Tracks found conforming to WAVE", CTACheckSelectionSet($adapts_count,$session_dir,$adaptation_set_template,$outfile,$current_period));
34 | }
35 | //Test that no WAVE SwSet found in the SelSet. SwSet contains one WAVE track and one non-WAVE track.
36 | public function testNoWAVESwSetInSelSet()
37 | {
38 | $adapts_count=1;
39 | $session_dir="Selection_set_examples/SelSetVideoNoWaveSwSet";
40 | $adaptation_set_template='Adapt$AS$';
41 | $outfile=fopen("out.txt","w");
42 | $current_period=0;
43 | $this->assertContains("no Switching Set found conforming to WAVE", CTACheckSelectionSet($adapts_count,$session_dir,$adaptation_set_template,$outfile,$current_period));
44 | }
45 | //
46 |
47 | //Test that a WAVE SwSet is found in the SelSet. The SwSet contains two Wave tracks.
48 | public function testWAVESwSetInSelSet()
49 | {
50 | $adapts_count=1;
51 | $session_dir="Selection_set_examples/SelSetVideoWaveSwSet";
52 | $adaptation_set_template='Adapt$AS$';
53 | $outfile=fopen("out.txt","w");
54 | $current_period=0;
55 | $this->assertNotContains("no Switching Set found conforming to WAVE", CTACheckSelectionSet($adapts_count,$session_dir,$adaptation_set_template,$outfile,$current_period));
56 | }
57 |
58 | public function testSingleInitSwSet()
59 | {
60 | $adapts_count=1;
61 | $session_dir="Selection_set_examples/SwSetSingleInit";
62 | $adaptation_set_template='Adapt$AS$';
63 | $this->assertContains("reinitialization not req on Track switches', and found CMAF common header", CTACheckSingleInitSwSet($adapts_count,$session_dir,$adaptation_set_template));
64 | }
65 | public function testNoSingleInitSwSet()
66 | {
67 | $adapts_count=1;
68 | $session_dir="Selection_set_examples/SelSetVideoWaveSwSet";
69 | $adaptation_set_template='Adapt$AS$';
70 | $this->assertNotContains("reinitialization not req on Track switches', and found CMAF common header", CTACheckSingleInitSwSet($adapts_count,$session_dir,$adaptation_set_template));
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoNoWaveSwSet/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
219 |
220 |
221 |
226 |
262 |
263 |
264 |
265 |
266 |
267 |
270 |
271 |
274 |
275 |
279 |
280 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
292 |
293 |
300 |
301 |
302 |
303 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoNoWaveSwSet/Period0/Adapt0/Adapt0rep1.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
213 |
214 |
215 |
220 |
256 |
257 |
258 |
259 |
260 |
261 |
264 |
265 |
268 |
269 |
273 |
274 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
286 |
287 |
294 |
295 |
296 |
297 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoNoWaveTracks/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
213 |
214 |
215 |
220 |
256 |
257 |
258 |
259 |
260 |
261 |
264 |
265 |
268 |
269 |
273 |
274 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
286 |
287 |
294 |
295 |
296 |
297 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoNoWaveTracks/Period0/Adapt0/Adapt0rep1.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
213 |
214 |
215 |
220 |
256 |
257 |
258 |
259 |
260 |
261 |
264 |
265 |
268 |
269 |
273 |
274 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
286 |
287 |
294 |
295 |
296 |
297 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoWaveSwSet/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
219 |
220 |
221 |
226 |
262 |
263 |
264 |
265 |
266 |
267 |
270 |
271 |
274 |
275 |
279 |
280 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
292 |
293 |
300 |
301 |
302 |
303 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SelSetVideoWaveSwSet/Period0/Adapt0/Adapt0rep1.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
15 |
16 |
17 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
42 |
43 |
46 |
47 |
48 |
50 |
51 |
52 |
55 |
57 |
58 |
59 |
60 |
63 |
80 |
130 |
135 |
142 |
143 |
144 |
149 |
219 |
220 |
221 |
226 |
262 |
263 |
264 |
265 |
266 |
267 |
270 |
271 |
274 |
275 |
279 |
280 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
292 |
293 |
300 |
301 |
302 |
303 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Selection_set_examples/SwSetSingleInit/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
49 |
50 |
51 |
53 |
54 |
55 |
58 |
60 |
61 |
62 |
63 |
66 |
83 |
86 |
97 |
104 |
155 |
156 |
178 |
179 |
180 |
181 |
182 |
199 |
202 |
213 |
220 |
271 |
272 |
294 |
295 |
296 |
297 |
298 |
299 |
302 |
303 |
306 |
307 |
311 |
312 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
324 |
325 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/SpliceConstraintsTest.php:
--------------------------------------------------------------------------------
1 | assertContains("Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set", checkSequentialSwSetMProfile($MediaProfDatabase));
22 | }
23 | public function testSameMediaProfile()
24 | {
25 | $MediaProfDatabase[0][0][0]="HD";
26 | $MediaProfDatabase[1][0][0]="HD";
27 | $this->assertNotContains("Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set", checkSequentialSwSetMProfile($MediaProfDatabase));
28 | }
29 |
30 | public function testNoDiscontinuitySplice()
31 | {
32 | $MediaProfDatabase[0][0][0]="HD";
33 | $MediaProfDatabase[1][0][0]="HD";
34 | $session_dir="Splice_examples/Pass_case";
35 | $adaptation_set_template='Adapt$AS$';
36 | $reprsentation_template = 'Adapt$AS$rep$R$';
37 | $this->assertNotContains("Sequential Switching Sets can be discontinuous, and it is observed", checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
38 | }
39 | public function testDiscontinuitySplice()
40 | {
41 | $MediaProfDatabase[0][0][0]="HD";
42 | $MediaProfDatabase[1][0][0]="HD";
43 | $session_dir="Splice_examples/Fail_case";
44 | $adaptation_set_template='Adapt$AS$';
45 | $reprsentation_template = 'Adapt$AS$rep$R$';
46 | $this->assertContains("Sequential Switching Sets can be discontinuous, and it is observed", checkDiscontinuousSplicePoints($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
47 | }
48 |
49 | public function testNoEncryptionChangeSplice()
50 | {
51 | $MediaProfDatabase[0][0][0]="HD";
52 | $MediaProfDatabase[1][0][0]="HD";
53 | $session_dir="Splice_examples/Pass_case";
54 | $adaptation_set_template='Adapt$AS$';
55 | $reprsentation_template = 'Adapt$AS$rep$R$';
56 | $this->assertNotContains("WAVE content SHALL contain one CENC Scheme per program', violated between", checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
57 | }
58 | public function testEncryptionChangeSplice()
59 | {
60 | $MediaProfDatabase[0][0][0]="HD";
61 | $MediaProfDatabase[1][0][0]="HD";
62 | $session_dir="Splice_examples/Fail_case";
63 | $adaptation_set_template='Adapt$AS$';
64 | $reprsentation_template = 'Adapt$AS$rep$R$';
65 | $this->assertContains("WAVE content SHALL contain one CENC Scheme per program', violated between", checkEncryptionChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
66 | }
67 |
68 | public function testNoSampleEntryChangeSplice()
69 | {
70 | $MediaProfDatabase[0][0][0]="HD";
71 | $MediaProfDatabase[1][0][0]="HD";
72 | $session_dir="Splice_examples/Pass_case";
73 | $adaptation_set_template='Adapt$AS$';
74 | $reprsentation_template = 'Adapt$AS$rep$R$';
75 | $this->assertNotContains("Sequential Switching Sets Shall not change sample type at Splice points', but different sample types", checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
76 | }
77 | public function testSampleEntryChangeSplice()
78 | {
79 | $MediaProfDatabase[0][0][0]="HD";
80 | $MediaProfDatabase[1][0][0]="HD";
81 | $session_dir="Splice_examples/Fail_case";
82 | $adaptation_set_template='Adapt$AS$';
83 | $reprsentation_template = 'Adapt$AS$rep$R$';
84 | $this->assertContains("Sequential Switching Sets Shall not change sample type at Splice points', but different sample types", checkSampleEntryChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
85 | }
86 |
87 | public function testNoDefaultKIDChangeSplice()
88 | {
89 | $MediaProfDatabase[0][0][0]="HD";
90 | $MediaProfDatabase[1][0][0]="HD";
91 | $session_dir="Splice_examples/Pass_case";
92 | $adaptation_set_template='Adapt$AS$';
93 | $reprsentation_template = 'Adapt$AS$rep$R$';
94 | $this->assertNotContains("Default KID can change at Splice points', change is observed for ", checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
95 | }
96 | public function testDefaultKIDChangeSplice()
97 | {
98 | $MediaProfDatabase[0][0][0]="HD";
99 | $MediaProfDatabase[1][0][0]="HD";
100 | $session_dir="Splice_examples/Fail_case";
101 | $adaptation_set_template='Adapt$AS$';
102 | $reprsentation_template = 'Adapt$AS$rep$R$';
103 | $this->assertContains("Default KID can change at Splice points', change is observed for ", checkDefaultKIDChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
104 | }
105 |
106 | public function testNoTrackIDChangeSplice()
107 | {
108 | $MediaProfDatabase[0][0][0]="HD";
109 | $MediaProfDatabase[1][0][0]="HD";
110 | $session_dir="Splice_examples/Pass_case";
111 | $adaptation_set_template='Adapt$AS$';
112 | $reprsentation_template = 'Adapt$AS$rep$R$';
113 | $this->assertNotContains("Track_ID can change at Splice points', change is observed ", checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
114 | }
115 | public function testTrackIDChangeSplice()
116 | {
117 | $MediaProfDatabase[0][0][0]="HD";
118 | $MediaProfDatabase[1][0][0]="HD";
119 | $session_dir="Splice_examples/Fail_case";
120 | $adaptation_set_template='Adapt$AS$';
121 | $reprsentation_template = 'Adapt$AS$rep$R$';
122 | $this->assertContains("Track_ID can change at Splice points', change is observed ", checkTrackIDChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
123 | }
124 |
125 | public function testNoTimescaleChangeSplice()
126 | {
127 | $MediaProfDatabase[0][0][0]="HD";
128 | $MediaProfDatabase[1][0][0]="HD";
129 | $session_dir="Splice_examples/Pass_case";
130 | $adaptation_set_template='Adapt$AS$';
131 | $reprsentation_template = 'Adapt$AS$rep$R$';
132 | $this->assertNotContains("Timescale can change at Splice points', change is observed", checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
133 | }
134 | public function testTimescaleChangeSplice()
135 | {
136 | $MediaProfDatabase[0][0][0]="HD";
137 | $MediaProfDatabase[1][0][0]="HD";
138 | $session_dir="Splice_examples/Fail_case";
139 | $adaptation_set_template='Adapt$AS$';
140 | $reprsentation_template = 'Adapt$AS$rep$R$';
141 | $this->assertContains("Timescale can change at Splice points', change is observed", checkTimeScaleChangeSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
142 | }
143 |
144 | public function testNoPictureAspectRatioChangeSplice()
145 | {
146 | $MediaProfDatabase[0][0][0]="HD";
147 | $MediaProfDatabase[1][0][0]="HD";
148 | $session_dir="Splice_examples/Pass_case";
149 | $adaptation_set_template='Adapt$AS$';
150 | $reprsentation_template = 'Adapt$AS$rep$R$';
151 | $this->assertNotContains("Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for ", checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
152 | }
153 | public function testPictureAspectRatioChangeSplice()
154 | {
155 | $MediaProfDatabase[0][0][0]="HD";
156 | $MediaProfDatabase[1][0][0]="HD";
157 | $session_dir="Splice_examples/Fail_case";
158 | $adaptation_set_template='Adapt$AS$';
159 | $reprsentation_template = 'Adapt$AS$rep$R$';
160 | $this->assertContains("Picture Aspect Ratio (PAR) Should be the same between Sequential Sw Sets at the Splice point', violated for ", checkPicAspectRatioSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
161 | }
162 | public function testNoFrameRateChangeSplice()
163 | {
164 | $MediaProfDatabase[0][0][0]="HD";
165 | $MediaProfDatabase[1][0][0]="HD";
166 | $session_dir="Splice_examples/Pass_case";
167 | $adaptation_set_template='Adapt$AS$';
168 | $reprsentation_template = 'Adapt$AS$rep$R$';
169 | $this->assertNotContains("Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for", checkFrameRateSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
170 | }
171 | public function testFrameRateChangeSplice()
172 | {
173 | $MediaProfDatabase[0][0][0]="HD";
174 | $MediaProfDatabase[1][0][0]="HD";
175 | $session_dir="Splice_examples/Fail_case";
176 | $adaptation_set_template='Adapt$AS$';
177 | $reprsentation_template = 'Adapt$AS$rep$R$';
178 | $this->assertContains("Frame rate Should be the same family of multiples between Sequential Sw Sets at the Splice point', violated for", checkFrameRateSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
179 | }
180 |
181 | public function testNoAudioChannelChangeSplice()
182 | {
183 | $MediaProfDatabase[0][0][0]="HD";
184 | $MediaProfDatabase[1][0][0]="HD";
185 | $session_dir="Splice_examples/Audio/Pass_case";
186 | $adaptation_set_template='Adapt$AS$';
187 | $reprsentation_template = 'Adapt$AS$rep$R$';
188 | $this->assertNotContains("Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for", checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
189 | }
190 | public function testAudioChannelChangeSplice()
191 | {
192 | $MediaProfDatabase[0][0][0]="HD";
193 | $MediaProfDatabase[1][0][0]="HD";
194 | $session_dir="Splice_examples/Audio/Fail_case";
195 | $adaptation_set_template='Adapt$AS$';
196 | $reprsentation_template = 'Adapt$AS$rep$R$';
197 | $this->assertContains("Audio channel configuration Should allow the same stereo or multichannel config between Sequential Sw Sets at the Splice point', violated for", checkAudioChannelSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
198 | }
199 | public function testNoFragOverlapSplice()
200 | {
201 | $MediaProfDatabase[0][0][0]="HD";
202 | $MediaProfDatabase[1][0][0]="HD";
203 | $session_dir="Splice_examples/Pass_case";
204 | $adaptation_set_template='Adapt$AS$';
205 | $reprsentation_template = 'Adapt$AS$rep$R$';
206 | $this->assertNotContains("not overlap the same WAVE Program presentation time at the Splice point', overlap is observed", checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
207 | }
208 | public function testFragOverlapSplice()
209 | {
210 | $MediaProfDatabase[0][0][0]="HD";
211 | $MediaProfDatabase[1][0][0]="HD";
212 | $session_dir="Splice_examples/Fail_case";
213 | $adaptation_set_template='Adapt$AS$';
214 | $reprsentation_template = 'Adapt$AS$rep$R$';
215 | $this->assertContains("not overlap the same WAVE Program presentation time at the Splice point', overlap is observed", checkFragrmentOverlapSplicePoint($session_dir,$MediaProfDatabase,$adaptation_set_template,$reprsentation_template));
216 | }
217 | }
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Splice_examples/Audio/Fail_case/Period0/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
16 |
17 |
18 |
27 |
28 |
29 |
36 |
37 |
40 |
41 |
42 |
44 |
45 |
46 |
49 |
51 |
52 |
53 |
54 |
57 |
62 |
64 |
65 |
72 |
81 |
94 |
95 |
98 |
99 |
100 |
101 |
102 |
105 |
106 |
109 |
110 |
114 |
115 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
127 |
128 |
135 |
136 |
137 |
138 |
160 |
161 |
164 |
167 |
168 |
169 |
177 |
178 |
184 |
185 |
188 |
189 |
190 |
191 |
194 |
197 |
198 |
199 |
207 |
208 |
214 |
215 |
218 |
219 |
220 |
221 |
224 |
227 |
228 |
229 |
237 |
238 |
244 |
245 |
248 |
249 |
250 |
251 |
254 |
257 |
258 |
259 |
267 |
268 |
274 |
275 |
278 |
279 |
280 |
281 |
284 |
287 |
288 |
289 |
297 |
298 |
304 |
305 |
308 |
309 |
310 |
311 |
314 |
317 |
318 |
319 |
327 |
328 |
334 |
335 |
338 |
339 |
340 |
341 |
344 |
347 |
348 |
349 |
357 |
358 |
364 |
365 |
368 |
369 |
370 |
371 |
374 |
377 |
378 |
379 |
387 |
388 |
394 |
395 |
398 |
399 |
400 |
401 |
404 |
407 |
408 |
409 |
417 |
418 |
424 |
425 |
428 |
429 |
430 |
431 |
434 |
437 |
438 |
439 |
447 |
448 |
454 |
455 |
458 |
459 |
460 |
461 |
464 |
467 |
468 |
469 |
477 |
478 |
484 |
485 |
488 |
489 |
490 |
491 |
494 |
497 |
498 |
499 |
507 |
508 |
514 |
515 |
518 |
519 |
520 |
521 |
524 |
527 |
528 |
529 |
537 |
538 |
544 |
545 |
548 |
549 |
550 |
551 |
554 |
557 |
558 |
559 |
567 |
568 |
574 |
575 |
578 |
579 |
580 |
581 |
582 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Splice_examples/Audio/Fail_case/Period1/Adapt0/Adapt0rep0.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
16 |
17 |
18 |
27 |
28 |
29 |
36 |
37 |
40 |
41 |
42 |
44 |
45 |
46 |
49 |
51 |
52 |
53 |
54 |
57 |
62 |
64 |
65 |
72 |
81 |
94 |
95 |
98 |
99 |
100 |
101 |
102 |
105 |
106 |
109 |
110 |
114 |
115 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
127 |
128 |
135 |
136 |
137 |
138 |
160 |
161 |
164 |
167 |
168 |
169 |
177 |
178 |
184 |
185 |
188 |
189 |
190 |
191 |
194 |
197 |
198 |
199 |
207 |
208 |
214 |
215 |
218 |
219 |
220 |
221 |
224 |
227 |
228 |
229 |
237 |
238 |
244 |
245 |
248 |
249 |
250 |
251 |
254 |
257 |
258 |
259 |
267 |
268 |
274 |
275 |
278 |
279 |
280 |
281 |
284 |
287 |
288 |
289 |
297 |
298 |
304 |
305 |
308 |
309 |
310 |
311 |
314 |
317 |
318 |
319 |
327 |
328 |
334 |
335 |
338 |
339 |
340 |
341 |
344 |
347 |
348 |
349 |
357 |
358 |
364 |
365 |
368 |
369 |
370 |
371 |
374 |
377 |
378 |
379 |
387 |
388 |
394 |
395 |
398 |
399 |
400 |
401 |
404 |
407 |
408 |
409 |
417 |
418 |
424 |
425 |
428 |
429 |
430 |
431 |
434 |
437 |
438 |
439 |
447 |
448 |
454 |
455 |
458 |
459 |
460 |
461 |
464 |
467 |
468 |
469 |
477 |
478 |
484 |
485 |
488 |
489 |
490 |
491 |
494 |
497 |
498 |
499 |
507 |
508 |
514 |
515 |
518 |
519 |
520 |
521 |
524 |
527 |
528 |
529 |
537 |
538 |
544 |
545 |
548 |
549 |
550 |
551 |
554 |
557 |
558 |
559 |
567 |
568 |
574 |
575 |
578 |
579 |
580 |
581 |
582 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Splice_examples/CMFHDBaseline/SampleErrorLog.txt:
--------------------------------------------------------------------------------
1 | Sample error file for WAVE Splice Constraints.
2 |
3 | ###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set 0 between CMAF Presentations 0 and 1 with media profiles- HD and HHD10 respectively.
4 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Splice_examples/CMFHDBaseline/SampleNoErrorLog.txt:
--------------------------------------------------------------------------------
1 | Sample log file with no WAVE Splice Constraints errors.
2 |
3 | No errors.
4 |
--------------------------------------------------------------------------------
/CTAWAVE/UnitTests/Splice_examples/Fail_case/SampleErrorLog.txt:
--------------------------------------------------------------------------------
1 | Sample error file for WAVE Splice Constraints.
2 |
3 | ###CTAWAVE check violated: WAVE Content Spec 2018Ed-Section 7.2.2: Sequential Switching Sets SHALL conform to the same CMAF Media Profile, voilated for Sw set 0 between CMAF Presentations 0 and 1 with media profiles- HD and HHD10 respectively.
4 |
--------------------------------------------------------------------------------
/Documentation/CMAF_conformance_checklist.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/CMAF_conformance_checklist.pdf
--------------------------------------------------------------------------------
/Documentation/CMAF_conformance_checklist.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/CMAF_conformance_checklist.xlsx
--------------------------------------------------------------------------------
/Documentation/CTAWAVE_confomance_checklist.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/CTAWAVE_confomance_checklist.docx
--------------------------------------------------------------------------------
/Documentation/CTAWAVE_confomance_checklist.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/CTAWAVE_confomance_checklist.pdf
--------------------------------------------------------------------------------
/Documentation/Instructions_newMediaProfile_addition.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/Instructions_newMediaProfile_addition.docx
--------------------------------------------------------------------------------
/Documentation/Instructions_newMediaProfile_addition.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dash-Industry-Forum/CMAF-Conformance/ed9b18e5e636e2d5b2b13c3339c3d981df4843b1/Documentation/Instructions_newMediaProfile_addition.pdf
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | CMAF
2 |
3 | The GNU General Public License
4 | Version 3
5 | http://www.gnu.org/licenses/
6 |
7 | This program is free software: you can redistribute it and/or modify
8 | it under the terms of the GNU General Public License as published by
9 | the Free Software Foundation, either version 3 of the License, or
10 | (at your option) any later version.
11 |
12 | This program is distributed in the hope that it will be useful,
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | GNU General Public License for more details.
16 |
17 | You should have received a copy of the GNU General Public License
18 | along with this program. If not, see
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CMAF
2 |
3 | This repository is CMAF submodule of the [DASH-IF-Conformance Software Tool](https://github.com/Dash-Industry-Forum/DASH-IF-Conformance) and contains related functionalities for CMAF and CTAWAVE conformance checking. This is one of the extension conformance that the DASH-IF-Conformance Software Tool provides. It has been created to maintain and manage the CMAF and CTAWAVE-related conformance features in accordance with the respective specifications.
4 |
--------------------------------------------------------------------------------
/cmaf_OnOff.txt:
--------------------------------------------------------------------------------
1 | 1
2 |
--------------------------------------------------------------------------------