Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (4)
New upstream version 1.1.19
· 5654314f
Emmanuel Bourg
authored
Jan 22, 2019
5654314f
New upstream version 1.1.20
· 3be70205
Emmanuel Bourg
authored
Jan 22, 2019
3be70205
New upstream version 1.1.21
· 4f31aa16
Emmanuel Bourg
authored
Jan 22, 2019
4f31aa16
New upstream version 1.1.22
· d06aee55
Emmanuel Bourg
authored
Jan 22, 2019
d06aee55
Hide whitespace changes
Inline
Side-by-side
examples/pom.xml
View file @
d06aee55
...
...
@@ -5,17 +5,17 @@
<artifactId>
examples
</artifactId>
<name>
ISO Parser Examples
</name>
<version>
1.1.
18
</version>
<version>
1.1.
22
</version>
<parent>
<groupId>
com.googlecode.mp4parser
</groupId>
<artifactId>
mp4parser-project
</artifactId>
<version>
1.1.
18
</version>
<version>
1.1.
22
</version>
</parent>
<dependencies>
<dependency>
<groupId>
com.googlecode.mp4parser
</groupId>
<artifactId>
isoparser
</artifactId>
<version>
1.1.
18
</version>
<version>
1.1.
22
</version>
</dependency>
<dependency>
<groupId>
xom
</groupId>
...
...
@@ -79,7 +79,7 @@
<scm>
<url>
http://code.google.com/p/mp4parser/source/browse/
</url>
<connection>
scm:svn:https://mp4parser.googlecode.com/svn/trunk/examples
</connection>
<tag>
mp4parser-project-1.1.
18
</tag>
<tag>
mp4parser-project-1.1.
22
</tag>
</scm>
<repositories>
<repository>
...
...
isoparser/pom.xml
View file @
d06aee55
...
...
@@ -7,7 +7,7 @@
<description>
A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)
</description>
<url>
http://code.google.com/p/mp4parser/
</url>
<version>
1.1.
18
</version>
<version>
1.1.
22
</version>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
...
...
@@ -197,7 +197,7 @@
<scm>
<url>
https://github.com/sannies/mp4parser
</url>
<tag>
mp4parser-project-1.1.
18
</tag>
<tag>
mp4parser-project-1.1.
22
</tag>
</scm>
<licenses>
...
...
isoparser/src/main/java/com/coremedia/iso/boxes/MediaHeaderBox.java
View file @
d06aee55
...
...
@@ -110,7 +110,7 @@ public class MediaHeaderBox extends AbstractFullBox {
creationTime
=
DateHelper
.
convert
(
IsoTypeReader
.
readUInt32
(
content
));
modificationTime
=
DateHelper
.
convert
(
IsoTypeReader
.
readUInt32
(
content
));
timescale
=
IsoTypeReader
.
readUInt32
(
content
);
duration
=
content
.
getI
nt
(
);
duration
=
IsoTypeReader
.
readUInt32
(
conte
nt
);
}
if
(
duration
<
-
1
)
{
LOG
.
logWarn
(
"mdhd duration is not in expected range"
);
...
...
isoparser/src/main/java/com/coremedia/iso/boxes/MetaBox.java
View file @
d06aee55
...
...
@@ -20,12 +20,15 @@ import com.coremedia.iso.BoxParser;
import
com.coremedia.iso.IsoTypeReader
;
import
com.coremedia.iso.IsoTypeWriter
;
import
com.googlecode.mp4parser.AbstractContainerBox
;
import
com.googlecode.mp4parser.DataSource
;
import
com.googlecode.mp4parser.MemoryDataSourceImpl
;
import
java.io.IOException
;
import
java.nio.ByteBuffer
;
import
com.googlecode.mp4parser.DataSource
;
import
java.nio.channels.WritableByteChannel
;
import
static
com
.
googlecode
.
mp4parser
.
util
.
CastUtils
.
l2i
;
/**
* <h1>4cc = "{@value #TYPE}"</h1>
...
...
@@ -34,9 +37,15 @@ import java.nio.channels.WritableByteChannel;
public
class
MetaBox
extends
AbstractContainerBox
{
public
static
final
String
TYPE
=
"meta"
;
private
boolean
isFullBox
=
true
;
// default is fullbox cause that's what ISO defines, simple box is apple specifc
private
int
version
;
private
int
flags
;
public
MetaBox
()
{
super
(
TYPE
);
}
public
int
getVersion
()
{
return
version
;
}
...
...
@@ -70,30 +79,41 @@ public class MetaBox extends AbstractContainerBox {
IsoTypeWriter
.
writeUInt24
(
bb
,
flags
);
}
public
MetaBox
()
{
super
(
TYPE
);
}
@Override
public
void
parse
(
DataSource
dataSource
,
ByteBuffer
header
,
long
contentSize
,
BoxParser
boxParser
)
throws
IOException
{
ByteBuffer
bb
=
ByteBuffer
.
allocate
(
4
);
ByteBuffer
bb
=
ByteBuffer
.
allocate
(
l2i
(
contentSize
)
);
dataSource
.
read
(
bb
);
parseVersionAndFlags
((
ByteBuffer
)
bb
.
rewind
());
initContainer
(
dataSource
,
contentSize
-
4
,
boxParser
);
bb
.
position
(
4
);
String
isHdlr
=
IsoTypeReader
.
read4cc
(
bb
);
if
(
"hdlr"
.
equals
(
isHdlr
))
{
isFullBox
=
false
;
initContainer
(
new
MemoryDataSourceImpl
((
ByteBuffer
)
bb
.
rewind
()),
contentSize
,
boxParser
);
// we got apple specifc box here
}
else
{
isFullBox
=
true
;
parseVersionAndFlags
((
ByteBuffer
)
bb
.
rewind
());
initContainer
(
new
MemoryDataSourceImpl
(
bb
),
contentSize
-
4
,
boxParser
);
}
}
@Override
public
void
getBox
(
WritableByteChannel
writableByteChannel
)
throws
IOException
{
writableByteChannel
.
write
(
getHeader
());
ByteBuffer
bb
=
ByteBuffer
.
allocate
(
4
);
writeVersionAndFlags
(
bb
);
writableByteChannel
.
write
((
ByteBuffer
)
bb
.
rewind
());
if
(
isFullBox
)
{
ByteBuffer
bb
=
ByteBuffer
.
allocate
(
4
);
writeVersionAndFlags
(
bb
);
writableByteChannel
.
write
((
ByteBuffer
)
bb
.
rewind
());
}
writeContainer
(
writableByteChannel
);
}
@Override
public
long
getSize
()
{
long
s
=
getContainerSize
();
long
t
=
4
;
// bytes to container start
long
t
=
0
;
// bytes to container start
if
(
isFullBox
)
{
t
+=
4
;
}
return
s
+
t
+
((
largeBox
||
(
s
+
t
)
>=
(
1L
<<
32
))
?
16
:
8
);
}
...
...
isoparser/src/main/java/com/coremedia/iso/boxes/UnknownBox.java
View file @
d06aee55
...
...
@@ -56,4 +56,9 @@ public class UnknownBox extends AbstractBox {
public
void
setData
(
ByteBuffer
data
)
{
this
.
data
=
data
;
}
@Override
public
String
toString
()
{
return
getClass
().
getName
()
+
"["
+
getType
()
+
"]@"
+
Integer
.
toHexString
(
hashCode
());
}
}
isoparser/src/main/java/com/coremedia/iso/boxes/fragment/TrackFragmentHeaderBox.java
View file @
d06aee55
...
...
@@ -147,38 +147,14 @@ public class TrackFragmentHeaderBox extends AbstractFullBox {
return
trackId
;
}
public
long
getBaseDataOffset
()
{
return
baseDataOffset
;
}
public
long
getSampleDescriptionIndex
()
{
return
sampleDescriptionIndex
;
}
public
long
getDefaultSampleDuration
()
{
return
defaultSampleDuration
;
}
public
long
getDefaultSampleSize
()
{
return
defaultSampleSize
;
}
public
SampleFlags
getDefaultSampleFlags
()
{
return
defaultSampleFlags
;
}
public
boolean
isDurationIsEmpty
()
{
return
durationIsEmpty
;
}
public
boolean
isDefaultBaseIsMoof
()
{
return
defaultBaseIsMoof
;
}
public
void
setTrackId
(
long
trackId
)
{
this
.
trackId
=
trackId
;
}
public
long
getBaseDataOffset
()
{
return
baseDataOffset
;
}
public
void
setBaseDataOffset
(
long
baseDataOffset
)
{
if
(
baseDataOffset
==
-
1
)
{
setFlags
(
getFlags
()
&
(
Integer
.
MAX_VALUE
^
0x1
));
...
...
@@ -188,6 +164,10 @@ public class TrackFragmentHeaderBox extends AbstractFullBox {
this
.
baseDataOffset
=
baseDataOffset
;
}
public
long
getSampleDescriptionIndex
()
{
return
sampleDescriptionIndex
;
}
public
void
setSampleDescriptionIndex
(
long
sampleDescriptionIndex
)
{
if
(
sampleDescriptionIndex
==
-
1
)
{
setFlags
(
getFlags
()
&
(
Integer
.
MAX_VALUE
^
0x2
));
...
...
@@ -197,28 +177,66 @@ public class TrackFragmentHeaderBox extends AbstractFullBox {
this
.
sampleDescriptionIndex
=
sampleDescriptionIndex
;
}
public
long
getDefaultSampleDuration
()
{
return
defaultSampleDuration
;
}
public
void
setDefaultSampleDuration
(
long
defaultSampleDuration
)
{
setFlags
(
getFlags
()
|
0x8
);
// activate the field
this
.
defaultSampleDuration
=
defaultSampleDuration
;
}
public
long
getDefaultSampleSize
()
{
return
defaultSampleSize
;
}
public
void
setDefaultSampleSize
(
long
defaultSampleSize
)
{
setFlags
(
getFlags
()
|
0x10
);
// activate the field
if
(
defaultSampleSize
!=
-
1
)
{
setFlags
(
getFlags
()
|
0x10
);
}
else
{
setFlags
(
getFlags
()
&
(
0xFFFFFF
^
0x10
));
}
this
.
defaultSampleSize
=
defaultSampleSize
;
}
public
SampleFlags
getDefaultSampleFlags
()
{
return
defaultSampleFlags
;
}
public
void
setDefaultSampleFlags
(
SampleFlags
defaultSampleFlags
)
{
setFlags
(
getFlags
()
|
0x20
);
// activate the field
if
(
defaultSampleFlags
!=
null
)
{
setFlags
(
getFlags
()
|
0x20
);
}
else
{
setFlags
(
getFlags
()
&
(
0xFFFFFF
^
0x20
));
}
this
.
defaultSampleFlags
=
defaultSampleFlags
;
}
public
boolean
isDurationIsEmpty
()
{
return
durationIsEmpty
;
}
public
void
setDurationIsEmpty
(
boolean
durationIsEmpty
)
{
setFlags
(
getFlags
()
|
0x10000
);
// activate the field
if
(
defaultBaseIsMoof
)
{
setFlags
(
getFlags
()
|
0x10000
);
}
else
{
setFlags
(
getFlags
()
&
(
0xFFFFFF
^
0x10000
));
}
this
.
durationIsEmpty
=
durationIsEmpty
;
}
public
boolean
isDefaultBaseIsMoof
()
{
return
defaultBaseIsMoof
;
}
public
void
setDefaultBaseIsMoof
(
boolean
defaultBaseIsMoof
)
{
setFlags
(
getFlags
()
|
0x20000
);
// activate the field
if
(
defaultBaseIsMoof
)
{
setFlags
(
getFlags
()
|
0x20000
);
}
else
{
setFlags
(
getFlags
()
&
(
0xFFFFFF
^
0x20000
));
}
this
.
defaultBaseIsMoof
=
defaultBaseIsMoof
;
}
...
...
isoparser/src/main/java/com/googlecode/mp4parser/FileDataSourceImpl.java
View file @
d06aee55
...
...
@@ -58,7 +58,7 @@ public class FileDataSourceImpl implements DataSource {
}
public
synchronized
ByteBuffer
map
(
long
startPosition
,
long
size
)
throws
IOException
{
LOG
.
logDebug
(
startPosition
+
" "
+
size
);
//
LOG.logDebug(startPosition + " " + size);
return
fc
.
map
(
FileChannel
.
MapMode
.
READ_ONLY
,
startPosition
,
size
);
}
...
...
isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/BetterFragmenter.java
0 → 100644
View file @
d06aee55
package
com.googlecode.mp4parser.authoring.builder
;
import
com.googlecode.mp4parser.authoring.Track
;
import
com.googlecode.mp4parser.util.Mp4Arrays
;
import
static
java
.
util
.
Arrays
.
binarySearch
;
/**
* Created by sannies on 26.03.2016.
*/
public
class
BetterFragmenter
implements
Fragmenter
{
private
double
targetDuration
;
public
BetterFragmenter
(
double
targetDuration
)
{
this
.
targetDuration
=
targetDuration
;
}
public
long
[]
sampleNumbers
(
Track
track
)
{
long
ts
=
track
.
getTrackMetaData
().
getTimescale
();
long
targetTicks
=
(
long
)
(
targetDuration
*
ts
);
long
[]
fragments
=
new
long
[
0
];
long
[]
syncSamples
=
track
.
getSyncSamples
();
long
[]
durations
=
track
.
getSampleDurations
();
if
(
syncSamples
!=
null
)
{
long
[]
syncSampleTicks
=
new
long
[
syncSamples
.
length
];
long
ticks
=
0
;
long
duration
=
track
.
getDuration
();
for
(
int
i
=
0
;
i
<
durations
.
length
;
i
++)
{
int
pos
=
binarySearch
(
syncSamples
,
(
long
)
i
+
1
);
if
(
pos
>=
0
)
{
syncSampleTicks
[
pos
]
=
ticks
;
}
ticks
+=
durations
[
i
];
}
long
nextTargetTick
=
0
;
for
(
int
currentSyncSampleIndex
=
0
;
currentSyncSampleIndex
<
syncSampleTicks
.
length
-
1
;
currentSyncSampleIndex
++)
{
long
tickN1
=
syncSampleTicks
[
currentSyncSampleIndex
];
long
tickN2
=
syncSampleTicks
[
currentSyncSampleIndex
+
1
];
if
(
nextTargetTick
<=
tickN2
)
{
if
(
Math
.
abs
(
tickN1
-
nextTargetTick
)
<
Math
.
abs
(
tickN2
-
nextTargetTick
))
{
fragments
=
Mp4Arrays
.
copyOfAndAppend
(
fragments
,
syncSamples
[
currentSyncSampleIndex
]);
nextTargetTick
=
syncSampleTicks
[
currentSyncSampleIndex
]
+
targetTicks
;
}
}
}
if
(
duration
-
syncSampleTicks
[
syncSampleTicks
.
length
-
1
]
>
targetTicks
/
2
)
{
fragments
=
Mp4Arrays
.
copyOfAndAppend
(
fragments
,
syncSamples
[
syncSampleTicks
.
length
-
1
]);
}
}
else
{
double
time
=
0.0
D
;
fragments
=
new
long
[]{
1L
};
for
(
int
i
=
1
;
i
<
durations
.
length
;
++
i
)
{
time
+=
(
double
)
durations
[
i
]
/
(
double
)
ts
;
if
(
time
>=
targetDuration
)
{
if
(
i
>
0
)
{
fragments
=
Mp4Arrays
.
copyOfAndAppend
(
fragments
,
(
long
)
(
i
+
1
));
}
time
=
0.0
D
;
}
}
if
(
time
<
targetDuration
&&
fragments
.
length
>
1
)
{
long
numberSamplesLastTwoSegments
=
durations
.
length
+
1
-
fragments
[
fragments
.
length
-
2
];
fragments
[
fragments
.
length
-
1
]
=
fragments
[
fragments
.
length
-
2
]
+
numberSamplesLastTwoSegments
/
2
;
}
}
return
fragments
;
}
}
isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/DefaultFragmenterImpl.java
View file @
d06aee55
...
...
@@ -52,7 +52,7 @@ public class DefaultFragmenterImpl implements Fragmenter {
}
}
// In case the last Fragment is shorter: make the previous one a bigger and omit the small one
if
(
time
>
0
&&
time
<
fragmentLength
&&
segmentStartSamples
.
length
>
1
)
{
if
(
time
<
fragmentLength
&&
segmentStartSamples
.
length
>
1
)
{
long
[]
nuSegmentStartSamples
=
new
long
[
segmentStartSamples
.
length
-
1
];
System
.
arraycopy
(
segmentStartSamples
,
0
,
nuSegmentStartSamples
,
0
,
segmentStartSamples
.
length
-
1
);
segmentStartSamples
=
nuSegmentStartSamples
;
...
...
isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/DefaultMp4Builder.java
View file @
d06aee55
...
...
@@ -89,7 +89,7 @@ public class DefaultMp4Builder implements Mp4Builder {
*/
public
Container
build
(
Movie
movie
)
{
if
(
fragmenter
==
null
)
{
fragmenter
=
new
Default
Fragmenter
Impl
(
2
);
fragmenter
=
new
Better
Fragmenter
(
2
);
}
LOG
.
logDebug
(
"Creating movie "
+
movie
);
for
(
Track
track
:
movie
.
getTracks
())
{
...
...
isoparser/src/main/java/com/googlecode/mp4parser/authoring/builder/FragmentedMp4Builder.java
View file @
d06aee55
...
...
@@ -194,7 +194,7 @@ public class FragmentedMp4Builder implements Mp4Builder {
public
Container
build
(
Movie
movie
)
{
LOG
.
fine
(
"Creating movie "
+
movie
);
if
(
fragmenter
==
null
)
{
fragmenter
=
new
Default
Fragmenter
Impl
(
2
);
fragmenter
=
new
Better
Fragmenter
(
2
);
}
BasicContainer
isoFile
=
new
BasicContainer
();
...
...
isoparser/src/test/java/com/googlecode/mp4parser/authoring/builder/BetterFragmenterTest.java
0 → 100644
View file @
d06aee55
package
com.googlecode.mp4parser.authoring.builder
;
import
com.coremedia.iso.boxes.CompositionTimeToSample
;
import
com.coremedia.iso.boxes.SampleDependencyTypeBox
;
import
com.coremedia.iso.boxes.SampleDescriptionBox
;
import
com.coremedia.iso.boxes.SubSampleInformationBox
;
import
com.googlecode.mp4parser.authoring.Edit
;
import
com.googlecode.mp4parser.authoring.Sample
;
import
com.googlecode.mp4parser.authoring.Track
;
import
com.googlecode.mp4parser.authoring.TrackMetaData
;
import
com.googlecode.mp4parser.boxes.mp4.samplegrouping.GroupEntry
;
import
org.junit.Assert
;
import
org.junit.Test
;
import
java.io.IOException
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
public
class
BetterFragmenterTest
{
public
void
verify
(
int
total
,
long
[]
in
,
long
[]
expectedOut
)
{
Track
t
=
new
DummyTrack
(
total
,
in
);
Fragmenter
f
=
new
BetterFragmenter
(
2.0
);
long
[]
segmentStarter
=
f
.
sampleNumbers
(
t
);
Assert
.
assertArrayEquals
(
expectedOut
,
segmentStarter
);
}
@Test
public
void
testPatterns
()
throws
Exception
{
verify
(
151
,
null
,
new
long
[]{
1
,
51
,
101
,
126
});
verify
(
121
,
null
,
new
long
[]{
1
,
51
,
86
});
verify
(
106
,
new
long
[]{
1
,
51
,
62
,
101
},
new
long
[]{
1
,
51
});
verify
(
151
,
new
long
[]{
1
,
6
,
52
,
101
},
new
long
[]{
1
,
52
,
101
});
verify
(
151
,
new
long
[]{
1
,
51
,
62
,
101
},
new
long
[]{
1
,
51
,
101
});
}
class
DummyTrack
implements
Track
{
long
[]
syncSamples
;
long
[]
sampleDurations
;
public
DummyTrack
(
int
total
,
long
...
syncSamples
)
{
this
.
syncSamples
=
syncSamples
;
int
lastSample
=
total
;
sampleDurations
=
new
long
[
lastSample
];
Arrays
.
fill
(
sampleDurations
,
40
);
}
public
SampleDescriptionBox
getSampleDescriptionBox
()
{
return
null
;
}
public
long
[]
getSampleDurations
()
{
return
sampleDurations
;
}
public
long
getDuration
()
{
long
duration
=
0
;
for
(
long
delta
:
getSampleDurations
())
{
duration
+=
delta
;
}
return
duration
;
}
public
List
<
CompositionTimeToSample
.
Entry
>
getCompositionTimeEntries
()
{
return
null
;
}
public
long
[]
getSyncSamples
()
{
return
syncSamples
;
}
public
List
<
SampleDependencyTypeBox
.
Entry
>
getSampleDependencies
()
{
return
null
;
}
public
TrackMetaData
getTrackMetaData
()
{
TrackMetaData
tmd
=
new
TrackMetaData
();
tmd
.
setTimescale
(
1000
);
return
tmd
;
}
public
String
getHandler
()
{
return
null
;
}
public
List
<
Sample
>
getSamples
()
{
return
null
;
}
public
SubSampleInformationBox
getSubsampleInformationBox
()
{
return
null
;
}
public
String
getName
()
{
return
null
;
}
public
List
<
Edit
>
getEdits
()
{
return
null
;
}
public
Map
<
GroupEntry
,
long
[]>
getSampleGroups
()
{
return
null
;
}
public
void
close
()
throws
IOException
{
}
}
}
\ No newline at end of file
isoparser/src/test/java/com/googlecode/mp4parser/authoring/builder/DefaultFragmenterImplTest.java
View file @
d06aee55
...
...
@@ -18,14 +18,15 @@ public class DefaultFragmenterImplTest {
Movie
movie
=
MovieCreator
.
build
(
this
.
getClass
().
getProtectionDomain
().
getCodeSource
().
getLocation
().
getFile
()
+
"/Beethoven - Bagatelle op.119 no.11 i.m4a"
);
long
[]
segments
=
new
DefaultFragmenterImpl
(
2
).
sampleNumbers
(
movie
.
getTracks
().
get
(
0
));
long
[]
segments
=
new
BetterFragmenter
(
2
).
sampleNumbers
(
movie
.
getTracks
().
get
(
0
));
Assert
.
assertArrayEquals
(
new
long
[]{
1
,
8
7
,
17
4
,
26
1
,
34
8
,
43
5
,
52
2
,
60
9
,
69
6
,
78
3
,
87
0
,
95
7
,
104
4
,
113
1
,
121
8
,
130
5
,
139
2
,
14
79
,
156
6
,
165
3
,
174
0
,
182
7
,
191
4
,
200
1
,
208
8
,
217
5
,
226
2
,
23
49
,
243
6
,
252
3
,
261
0
,
269
7
,
278
4
,
287
1
,
295
8
,
304
5
,
313
2
,
32
19
,
330
6
,
339
3
,
348
0
,
356
7
,
365
4
,
374
1
,
382
8
,
391
5
,
400
2
,
40
8
9
,
417
6
,
426
3
,
435
0
,
443
7
,
452
4
,
461
1
,
469
8
},
long
[]{
1
,
8
8
,
17
5
,
26
2
,
34
9
,
43
6
,
52
3
,
6
1
0
,
69
7
,
78
4
,
87
1
,
95
8
,
104
5
,
113
2
,
121
9
,
130
6
,
139
3
,
14
80
,
156
7
,
165
4
,
174
1
,
182
8
,
191
5
,
200
2
,
208
9
,
217
6
,
226
3
,
23
50
,
243
7
,
252
4
,
261
1
,
269
8
,
278
5
,
287
2
,
295
9
,
304
6
,
313
3
,
32
20
,
330
7
,
339
4
,
348
1
,
356
8
,
365
5
,
374
2
,
382
9
,
391
6
,
400
3
,
409
0
,
417
7
,
426
4
,
435
1
,
443
8
,
452
5
,
461
2
,
469
9
,
4775
,
},
segments
);
long
[]
segments2
=
new
Default
Fragmenter
Impl
(
4
).
sampleNumbers
(
movie
.
getTracks
().
get
(
0
));
long
[]
segments2
=
new
Better
Fragmenter
(
4
).
sampleNumbers
(
movie
.
getTracks
().
get
(
0
));
Assert
.
assertArrayEquals
(
new
long
[]{
1
,
17
3
,
34
6
,
5
19
,
69
2
,
86
5
,
103
8
,
121
1
,
138
4
,
155
7
,
173
0
,
190
3
,
207
6
,
22
49
,
242
2
,
259
5
,
276
8
,
294
1
,
311
4
,
328
7
,
346
0
,
363
3
,
380
6
,
39
79
,
415
2
,
432
5
,
449
8
,
467
1
,},
long
[]{
1
,
17
4
,
34
7
,
5
20
,
69
3
,
86
6
,
103
9
,
121
2
,
138
5
,
155
8
,
173
1
,
190
4
,
207
7
,
22
50
,
242
3
,
259
6
,
276
9
,
294
2
,
311
5
,
328
8
,
346
1
,
363
4
,
380
7
,
39
80
,
415
3
,
432
6
,
449
9
,
467
2
,
4762
,},
segments2
);
...
...
isoparser/src/test/java/com/googlecode/mp4parser/authoring/tracks/AC3TrackImplTest.java
View file @
d06aee55
...
...
@@ -8,10 +8,7 @@ import com.googlecode.mp4parser.authoring.Track;
import
com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder
;
import
org.junit.Test
;
import
java.io.BufferedInputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.nio.channels.WritableByteChannel
;
public
class
AC3TrackImplTest
{
@Test
...
...
@@ -22,7 +19,7 @@ public class AC3TrackImplTest {
DefaultMp4Builder
mp4Builder
=
new
DefaultMp4Builder
();
Container
c
=
mp4Builder
.
build
(
m
);
//c.writeContainer(new FileOutputStream("C:\\dev\\mp4parser\\isoparser\\src\\test\\resources\\com\\googlecode\\mp4parser\\authoring\\tracks\\ac3-sample.mp4").getChannel());
//c.writeContainer(new FileOutputStream("C:\\dev\\mp4parser\\isoparser\\src\\test\\resources\\com\\googlecode\\mp4parser\\authoring\\tracks\\ac3-sample
-2
.mp4").getChannel());
IsoFile
isoFileReference
=
new
IsoFile
(
this
.
getClass
().
getProtectionDomain
().
getCodeSource
().
getLocation
().
getFile
()
+
"/com/googlecode/mp4parser/authoring/tracks/ac3-sample.mp4"
);
BoxComparator
.
check
(
c
,
isoFileReference
,
"/moov[0]/mvhd[0]"
,
"/moov[0]/trak[0]/tkhd[0]"
,
"/moov[0]/trak[0]/mdia[0]/mdhd[0]"
);
}
...
...
pom.xml
View file @
d06aee55
...
...
@@ -3,7 +3,7 @@
<groupId>
com.googlecode.mp4parser
</groupId>
<artifactId>
mp4parser-project
</artifactId>
<packaging>
pom
</packaging>
<version>
1.1.
18
</version>
<version>
1.1.
22
</version>
<name>
MP4 Parser Project
</name>
<url>
http://code.google.com/p/mp4parser/
</url>
<licenses>
...
...
@@ -83,6 +83,6 @@
<scm>
<url>
https://github.com/sannies/mp4parser
</url>
<connection>
scm:git:git@github.com:sannies/mp4parser.git
</connection>
<tag>
mp4parser-project-1.1.
18
</tag>
<tag>
mp4parser-project-1.1.
22
</tag>
</scm>
</project>