Skip to content

Commit 403a2c4

Browse files
committed
Merge commit 'f9b214042e9a867ba3d234014a3616b78ed775c8'
* commit 'f9b214042e9a867ba3d234014a3616b78ed775c8': ignore xcode file fix gcc warnings add docker file bump version works with python3
2 parents 11b265d + f9b2140 commit 403a2c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1531
-1313
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Build/Targets/universal-apple-macosx/build
3030
Build/Targets/universal-apple-macosx/Bento4.xcodeproj/xcuserdata
3131
Build/Targets/universal-apple-Build/Targets/arm-android-linux
3232
Build/Targets/universal-apple-macosx/cov-int
33-
macosx/Bento4.xcodeproj/project.xcworkspace/xcuserdata
33+
Build/Targets/universal-apple-macosx/Bento4.xcodeproj/xcshareddata
34+
Build/Targets/universal-apple-macosx/Bento4.xcodeproj/project.xcworkspace/xcuserdata
3435
.svn
3536
.sconsign.dblite
3637
Bento4.xccheckout
@@ -49,3 +50,6 @@ third_party
4950
IDEWorkspaceChecks.plist
5051
.scannerwork
5152
Test/Output
53+
.coverage
54+
coverage_html
55+
Test/Output

Build/Docker/Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM alpine:latest
2+
3+
# Setup environment variables
4+
ENV BENTO4_VERSION 1.5.1-629
5+
6+
# Install Dependencies
7+
RUN apk update && apk add --no-cache ca-certificates bash python3 make cmake gcc g++ git
8+
9+
# Copy Sources
10+
COPY ./ /tmp/bento4
11+
12+
# Build
13+
RUN rm -rf /tmp/bento4/cmakebuild && mkdir -p /tmp/bento4/cmakebuild && cd /tmp/bento4/cmakebuild && cmake -DCMAKE_BUILD_TYPE=Release .. && make
14+
15+
# Install
16+
RUN cd /tmp/bento4 && python3 Scripts/SdkPackager.py x86_64-unknown-linux . cmake && mkdir /opt/bento4 && mv /tmp/bento4/SDK/Bento4-SDK-*.x86_64-unknown-linux/* /opt/bento4
17+
18+
# === Second Stage ===
19+
FROM alpine:latest
20+
ARG BENTO4_VERSION
21+
LABEL "com.example.vendor"="Axiomatic Systems, LLC."
22+
LABEL version=$BENTO4_VERSION
23+
LABEL maintainer="[email protected]"
24+
25+
# Setup environment variables
26+
ENV PATH=/opt/bento4/bin:${PATH}
27+
28+
# Install Dependencies
29+
RUN apk --no-cache add ca-certificates bash python3 libstdc++
30+
31+
# Copy Binaries
32+
COPY --from=0 /opt/bento4 /opt/bento4
33+
34+
WORKDIR /opt/bento4
35+
36+
CMD ["bash"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PreviewsEnabled</key>
6+
<false/>
7+
</dict>
8+
</plist>

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set(SOURCE_METADATA ${SOURCE_ROOT}/MetaData)
1212
set(SOURCE_SYSTEM ${SOURCE_ROOT}/System)
1313

1414
# Compiler warning and optimization flags
15-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
15+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-class-memaccess")
1616

1717
if (EMSCRIPTEN)
1818
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths")

Documents/Doxygen/Doxyfile

Lines changed: 664 additions & 664 deletions
Large diffs are not rendered by default.

Scripts/ExportSourceTree.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
import sys
44
import os
@@ -12,22 +12,22 @@ def GetSdkRevision():
1212
cmd = 'git status --porcelain -b'
1313
lines = os.popen(cmd).readlines()
1414
if not lines[0].startswith('## master'):
15-
print 'ERROR: not on master branch'
15+
print('ERROR: not on master branch')
1616
return None
1717
if len(lines) > 1:
18-
print 'ERROR: git status not empty'
19-
print ''.join(lines)
18+
print('ERROR: git status not empty')
19+
print(''.join(lines))
2020
return None
2121

2222
cmd = 'git tag --contains HEAD'
2323
tags = os.popen(cmd).readlines()
2424
if len(tags) != 1:
25-
print 'ERROR: expected exactly one tag for HEAD, found', len(tags), ':', tags
25+
print('ERROR: expected exactly one tag for HEAD, found', len(tags), ':', tags)
2626
return None
2727
version = tags[0].strip()
2828
sep = version.find('-')
2929
if sep < 0:
30-
print 'ERROR: unrecognized version string format:', version
30+
print('ERROR: unrecognized version string format:', version)
3131
return version[sep+1:]
3232

3333
#############################################################
@@ -53,14 +53,14 @@ def GetVersion():
5353
SDK_REVISION = GetSdkRevision()
5454
if SDK_REVISION is None:
5555
sys.exit(1)
56-
print "Exporting Revision", SDK_REVISION
56+
print("Exporting Revision", SDK_REVISION)
5757

5858
# compute paths
5959
SDK_NAME='Bento4-SRC-'+BENTO4_VERSION+'-'+SDK_REVISION
6060
SDK_OUTPUT_ROOT=BENTO4_HOME+'/SDK'
6161
SDK_ROOT=SDK_OUTPUT_ROOT+'/'+SDK_NAME
6262

63-
print SDK_NAME
63+
print(SDK_NAME)
6464

6565
# remove any previous SDK directory
6666
if os.path.exists(SDK_ROOT):
@@ -72,6 +72,6 @@ def GetVersion():
7272

7373
### export
7474
cmd = 'git archive --format=zip HEAD -o '+SDK_ROOT+'.zip'
75-
print cmd
75+
print(cmd)
7676
#cmd = 'svn export -r'+SDK_REVISION+' https://zebulon.bok.net/svn/Bento4/trunk '+SDK_NAME
7777
os.system(cmd)

Scripts/SdkPackager.py

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
########################################################################
44
#
@@ -39,22 +39,22 @@ def GetSdkRevision():
3939
lines = os.popen(cmd).readlines()
4040
branch = ''
4141
if not lines[0].startswith('## master'):
42-
print 'WARNING: not on master branch'
42+
print('WARNING: not on master branch')
4343
branch = '+' + lines[0][3:].strip()
4444
if len(lines) > 1:
45-
print 'ERROR: git status not empty'
46-
print ''.join(lines)
45+
print('ERROR: git status not empty')
46+
print(''.join(lines))
4747
return None
4848

4949
cmd = 'git tag --contains HEAD'
5050
tags = os.popen(cmd).readlines()
5151
if len(tags) != 1:
52-
print 'ERROR: expected exactly one tag for HEAD, found', len(tags), ':', tags
52+
print('ERROR: expected exactly one tag for HEAD, found', len(tags), ':', tags)
5353
return None
5454
version = tags[0].strip()
5555
sep = version.find('-')
5656
if sep < 0:
57-
print 'ERROR: unrecognized version string format:', version
57+
print('ERROR: unrecognized version string format:', version)
5858
return version[sep+1:] + branch
5959

6060
#############################################################
@@ -70,11 +70,11 @@ def CopyFiles(file_patterns, configs=[''], rename_map={}):
7070
if not os.path.exists(dest_dir):
7171
os.makedirs(dest_dir)
7272
filename = os.path.basename(file)
73-
if rename_map.has_key(filename):
73+
if filename in rename_map:
7474
dest_name = dest_dir+'/'+rename_map[filename]
7575
else:
7676
dest_name = dest_dir
77-
print 'COPY: '+file+' -> '+dest_name
77+
print('COPY: '+file+' -> '+dest_name)
7878
shutil.copy2(file, dest_name)
7979

8080
#############################################################
@@ -95,7 +95,7 @@ def ZipDir(top, archive, dir) :
9595
def ZipIt(basename, dir) :
9696
path = basename+'/'+dir
9797
zip_filename = path+'.zip'
98-
print 'ZIP: '+path+' -> '+zip_filename
98+
print('ZIP: '+path+' -> '+zip_filename)
9999

100100
if os.path.exists(zip_filename):
101101
os.remove(zip_filename)
@@ -117,17 +117,25 @@ def ZipIt(basename, dir) :
117117
SDK_TARGET = None
118118

119119
if len(sys.argv) > 2:
120-
BENTO4_HOME = sys.argv[1]
120+
BENTO4_HOME = sys.argv[2]
121121
else:
122122
script_dir = os.path.abspath(os.path.dirname(__file__))
123123
BENTO4_HOME = os.path.join(script_dir,'..')
124124

125+
CMAKE_BUILD = False
126+
if len(sys.argv) > 3:
127+
if sys.argv[3] == 'cmake':
128+
CMAKE_BUILD = True
129+
else:
130+
print('ERROR: unknown build type')
131+
sys.exit(1)
132+
125133
# ensure that BENTO4_HOME has been set and exists
126134
if not os.path.exists(BENTO4_HOME) :
127-
print 'ERROR: BENTO4_HOME ('+BENTO4_HOME+') does not exist'
135+
print('ERROR: BENTO4_HOME ('+BENTO4_HOME+') does not exist')
128136
sys.exit(1)
129137
else :
130-
print 'BENTO4_HOME = ' + BENTO4_HOME
138+
print('BENTO4_HOME = ' + BENTO4_HOME)
131139

132140
# compute the target if it is not specified
133141
if SDK_TARGET is None:
@@ -154,13 +162,13 @@ def ZipIt(basename, dir) :
154162
'darwin' : 'universal-apple-macosx'
155163
}
156164

157-
if platform_to_target_map.has_key(platform_id):
165+
if platform_id in platform_to_target_map:
158166
SDK_TARGET = platform_to_target_map[platform_id]
159167
else:
160-
print 'ERROR: SDK_TARGET is not set and cannot be detected'
168+
print('ERROR: SDK_TARGET is not set and cannot be detected')
161169
sys.exit(1)
162170

163-
print "TARGET = " + SDK_TARGET
171+
print("TARGET = " + SDK_TARGET)
164172

165173
BENTO4_VERSION = GetVersion()
166174

@@ -174,11 +182,16 @@ def ZipIt(basename, dir) :
174182
SDK_TARGET_DIR='Build/Targets/'+SDK_TARGET
175183
SDK_TARGET_ROOT=BENTO4_HOME+'/'+SDK_TARGET_DIR
176184

177-
# special case for Xcode builds
178-
if SDK_TARGET == 'universal-apple-macosx':
179-
SDK_TARGET_DIR='Build/Targets/universal-apple-macosx/build'
185+
if CMAKE_BUILD:
186+
SDK_BUILD_OUTPUT_DIR = 'cmakebuild'
187+
else:
188+
# special case for Xcode builds
189+
if SDK_TARGET == 'universal-apple-macosx':
190+
SDK_BUILD_OUTPUT_DIR='Build/Targets/universal-apple-macosx/Build/Products/Release'
191+
else:
192+
SDK_BUILD_OUTPUT_DIR = SDK_TARGET_DIR + '/Release'
180193

181-
print SDK_NAME
194+
print(SDK_NAME)
182195

183196
# remove any previous SDK directory
184197
if os.path.exists(SDK_ROOT):
@@ -213,7 +226,7 @@ def ZipIt(basename, dir) :
213226
script_bin_dir = None
214227

215228
# binaries
216-
bin_in = SDK_TARGET_DIR+'/Release'
229+
bin_in = SDK_BUILD_OUTPUT_DIR
217230
bin_files = [
218231
(bin_in,'mp4*.exe','bin'),
219232
(bin_in,'aac2mp4.exe','bin'),

Scripts/SdkPrepForRelease.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /usr/bin/python
1+
#! /usr/bin/env python3
22

33
########################################################################
44
#
@@ -18,7 +18,7 @@
1818
#############################################################
1919
# parse the command line
2020
if len(sys.argv) < 2:
21-
print 'ERROR: SDK revision # expected as first argument'
21+
print('ERROR: SDK revision # expected as first argument')
2222
sys.exit(1)
2323

2424
SDK_REVISION = sys.argv[1]
@@ -31,14 +31,14 @@
3131

3232
# ensure that BENTO4_HOME has been set and exists
3333
if not os.path.exists(BENTO4_HOME) :
34-
print 'ERROR: BENTO4_HOME ('+BENTO4_HOME+') does not exist'
34+
print('ERROR: BENTO4_HOME ('+BENTO4_HOME+') does not exist')
3535
sys.exit(1)
3636
else :
37-
print 'BENTO4_HOME = ' + BENTO4_HOME
37+
print('BENTO4_HOME = ' + BENTO4_HOME)
3838

3939
# patch files
4040
filename = os.path.join(BENTO4_HOME, "Source", "Python", "utils", "mp4-dash.py")
41-
print "Patching", filename
41+
print("Patching", filename)
4242
file_lines = open(filename).readlines()
4343
file_out = open(filename, "wb")
4444
for line in file_lines:
@@ -47,7 +47,7 @@
4747
file_out.write(line)
4848

4949
filename = os.path.join(BENTO4_HOME, "Source", "Python", "utils", "mp4-hls.py")
50-
print "Patching", filename
50+
print("Patching", filename)
5151
file_lines = open(filename).readlines()
5252
file_out = open(filename, "wb")
5353
for line in file_lines:

Source/C++/Apps/Mp4Info/Mp4Info.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,11 @@ ShowSampleDescription_Text(AP4_SampleDescription& description, bool verbose)
561561
printf(" (%s)", nalu_type_name);
562562
}
563563
printf("\n");
564+
const char* sep = "";
564565
for (unsigned int j=0; j<seq.m_Nalus.ItemCount(); j++) {
565-
printf(" ");
566+
printf("%s ", sep);
566567
ShowData(seq.m_Nalus[j]);
568+
sep = "\n";
567569
}
568570
printf("\n }\n");
569571
}

Source/C++/Core/Ap4TrunAtom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ AP4_TrunAtom::InspectFields(AP4_AtomInspector& inspector)
263263
AP4_FormatString(v3, sizeof(v3), "%sc:%u", sep, m_Entries[i].sample_composition_time_offset);
264264
s3 = v3;
265265
}
266-
char value[128];
266+
char value[256];
267267
AP4_FormatString(value, sizeof(value), "%s%s%s%s", s0, s1, s2, s3);
268268
inspector.AddField(header, value);
269269
}
@@ -300,7 +300,7 @@ AP4_TrunAtom::InspectFields(AP4_AtomInspector& inspector)
300300
AP4_FormatString(v3, sizeof(v3), "%ssample_composition_time_offset:%u", sep, m_Entries[i].sample_composition_time_offset);
301301
s3 = v3;
302302
}
303-
char value[128];
303+
char value[256];
304304
AP4_FormatString(value, sizeof(value), "%s%s%s%s", s0, s1, s2, s3);
305305
inspector.AddField(header, value);
306306
}

0 commit comments

Comments
 (0)