Skip to content

Commit d1e2174

Browse files
authored
Merge pull request #717 from Dash-Industry-Forum/limiting
Limiting
2 parents e8211c6 + 630d4f9 commit d1e2174

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,19 @@ EXPOSE 80
66

77
RUN apt-get update -y
88
RUN apt -y install \
9-
apache2 apache2-doc php php-dev php-xml php-curl php-xdebug libapache2-mod-php \
10-
python3 python-matplotlib-data \
11-
openjdk-8-jdk ant \
12-
sudo \
13-
g++ gpac
14-
#RUN curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py
15-
#RUN python3 get-pip.py
16-
#RUN pip3 install matplotlib
9+
g++ \
10+
make \
11+
python3 \
12+
python-matplotlib-data \
13+
openjdk-8-jdk \
14+
apache2 \
15+
php \
16+
php-xml \
17+
php-curl \
18+
libapache2-mod-php \
19+
php-xdebug \
20+
sudo \
21+
gpac
1722
RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
1823

1924
# let apache sudo this one specific script which filters the access logs
@@ -22,9 +27,7 @@ RUN echo >> /etc/sudoers "www-data ALL=NOPASSWD: /var/www/html/Conformance-Front
2227
RUN rm /var/www/html/index.html
2328
COPY --chown=www-data:www-data . /var/www/html/
2429

25-
COPY --chown=www-data:www-data ISOSegmentValidator /var/www/html/ISOSegmentValidator
2630
RUN cd /var/www/html/ISOSegmentValidator/public/linux && make clean && make -j
2731

28-
COPY --chown=www-data:www-data Conformance-Frontend /var/www/html/Conformance-Frontend
2932

3033
CMD apachectl -D FOREGROUND

Utils/Process_cli.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@
7070
$argumentParser->addOption("compact", "C", "compact", "Make JSON output compact");
7171
$argumentParser->addOption("silent", "S", "silent", "Do not output JSON to stdout");
7272
$argumentParser->addOption("autodetect", "A", "autodetect", "Try to automatically detect profiles");
73-
$argumentParser->addOption("unlimited", "U", "unlimited", "Unlimit the amount of segments downloaded (default is 5 per representation");
73+
$argumentParser->addOption(
74+
"unlimited",
75+
"U",
76+
"unlimited",
77+
"Unlimit the amount of segments downloaded (default is 5 per representation"
78+
);
79+
$argumentParser->addOption("keep", "K", "keep", "Do not clear session directory after parsing");
7480

7581
$argumentParser->parseAll();
7682

@@ -103,6 +109,7 @@
103109
$compactOutput = $argumentParser->getOption("compact");
104110
$autoDetect = $argumentParser->getOption("autodetect");
105111
$detailedSegmentOutput = !$argumentParser->getOption("disable_detailed_segment_output");
112+
$keepData = $argumentParser->getOption("keep");
106113

107114
global $limit;
108115
$limit = 5;
@@ -122,4 +129,6 @@
122129

123130

124131
global $session;
125-
//$session->clearDirectory();
132+
if (!$keepData) {
133+
$session->clearDirectory();
134+
}

Utils/impl/MPDHandler/downloadAll.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
global $session, $limit;
44

5+
$periodIdx = 0;
6+
57
foreach ($this->segmentUrls as $periodIdx => $periodUrls) {
8+
if ($limit != 0 && $periodIdx >= $limit) {
9+
break;
10+
}
11+
$adaptationIdx = 0;
612
foreach ($periodUrls as $adaptationIdx => $adaptationUrls) {
13+
if ($limit != 0 && $adaptationIdx >= $limit) {
14+
break;
15+
}
716
foreach ($adaptationUrls as $representationIdx => $representationUrls) {
817
$dir = $session->getRepresentationDir($periodIdx, $adaptationIdx, $representationIdx);
918
$assembly = ($assemble ? fopen("$dir/assembled.mp4", 'a+') : null);
@@ -23,8 +32,8 @@
2332
$this->assembleSingle("$dir/seg${segmentPadded}.mp4", $assembly, $sizeFile, $index);
2433
$index++;
2534

26-
if ($limit != 0 && $index >= $limit){
27-
break;
35+
if ($limit != 0 && $index >= $limit) {
36+
break;
2837
}
2938
}
3039

@@ -37,5 +46,7 @@
3746
fclose($sizeFile);
3847
}
3948
}
49+
$adaptationIdx++;
4050
}
51+
$periodIdx++;
4152
}

0 commit comments

Comments
 (0)