Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
videojs-contrib-hls
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3e86d199
authored
10 years ago
by
David LaPalomento
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Parse sdtp boxes
Add an inspector function for sdtp boxes.
1 parent
a35f70c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
1 deletions
test/mp4-inspector_test.js
test/muxer/js/mp4-inspector.js
test/mp4-inspector_test.js
View file @
3e86d19
...
...
@@ -766,6 +766,33 @@ test('can parse a trun with per-sample flags', function() {
});
test
(
'can parse an sdtp'
,
function
()
{
var
data
=
box
(
'sdtp'
,
0x00
,
// version
0x00
,
0x00
,
0x00
,
// flags
// reserved + sample_depends_on +
// sample_is_dependend_on + sample_has_redundancy
0x15
,
// reserved + sample_depends_on +
// sample_is_dependend_on + sample_has_redundancy
0x27
);
deepEqual
(
videojs
.
inspectMp4
(
new
Uint8Array
(
data
)),
[{
type
:
'sdtp'
,
version
:
0
,
flags
:
new
Uint8Array
([
0
,
0
,
0
]),
size
:
14
,
samples
:
[{
sampleDependsOn
:
1
,
sampleIsDependedOn
:
1
,
sampleHasRedundancy
:
1
},
{
sampleDependsOn
:
2
,
sampleIsDependedOn
:
1
,
sampleHasRedundancy
:
3
}]
}]);
});
test
(
'can parse a sidx'
,
function
(){
var
data
=
box
(
'sidx'
,
0x00
,
// version
...
...
This diff is collapsed.
Click to expand it.
test/muxer/js/mp4-inspector.js
View file @
3e86d19
...
...
@@ -277,6 +277,23 @@ var
initialDelay
:
view
.
getUint32
(
8
)
};
},
sdtp
:
function
(
data
)
{
var
result
=
{
version
:
data
[
0
],
flags
:
new
Uint8Array
(
data
.
subarray
(
1
,
4
)),
samples
:
[]
},
i
;
for
(
i
=
4
;
i
<
data
.
byteLength
;
i
++
)
{
result
.
samples
.
push
({
sampleDependsOn
:
(
data
[
i
]
&
0x30
)
>>
4
,
sampleIsDependedOn
:
(
data
[
i
]
&
0x0c
)
>>
2
,
sampleHasRedundancy
:
data
[
i
]
&
0x03
});
}
return
result
;
},
sidx
:
function
(
data
)
{
var
view
=
new
DataView
(
data
.
buffer
,
data
.
byteOffset
,
data
.
byteLength
),
result
=
{
...
...
@@ -301,7 +318,7 @@ var
sapDeltaTime
:
view
.
getUint32
(
i
+
8
)
&
0x0FFFFFFF
});
}
return
result
;
},
stbl
:
function
(
data
)
{
...
...
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment