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
a545f184
authored
2014-09-25 15:01:59 -0700
by
Simeon Bateman
Committed by
David LaPalomento
2015-07-31 16:40:38 -0400
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added parsing of binary data for section_number and last_section_number for PAT and PMT packets
1 parent
938a2f7f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
src/transmuxer.js
src/transmuxer.js
View file @
a545f18
...
...
@@ -104,6 +104,9 @@ ParseStream = function() {
};
parsePat
=
function
(
payload
,
pat
)
{
pat
.
section_number
=
payload
[
7
];
pat
.
last_section_number
=
payload
[
8
];
// skip the PSI header and parse the first PMT entry
self
.
pmtPid
=
(
payload
[
10
]
&
0x1F
)
<<
8
|
payload
[
11
];
pat
.
pmtPid
=
self
.
pmtPid
;
...
...
@@ -120,6 +123,9 @@ ParseStream = function() {
parsePmt
=
function
(
payload
,
pmt
)
{
var
tableEnd
,
programInfoLength
,
offset
;
pmt
.
section_number
=
payload
[
6
];
pmt
.
last_section_number
=
payload
[
7
];
// PMTs can be sent ahead of the time when they should actually
// take effect. We don't believe this should ever be the case
// for HLS but we'll ignore "forward" PMT declarations if we see
...
...
@@ -154,9 +160,14 @@ ParseStream = function() {
};
parsePes
=
function
(
payload
,
pes
)
{
var
dataAlignmentIndicator
,
ptsDtsFlags
;
var
ptsDtsFlags
,
pesLength
;
// PES packet length
pesLength
=
payload
[
4
]
<<
8
|
payload
[
5
];
// find out if this packets starts a new keyframe
dataAlignmentIndicator
=
(
payload
[
6
]
&
0x04
)
!==
0
;
pes
.
dataAlignmentIndicator
=
(
payload
[
6
]
&
0x04
)
!==
0
;
// PES packets may be annotated with a PTS value, or a PTS value
// and a DTS value. Determine what combination of values is
// available to work with.
...
...
@@ -238,6 +249,10 @@ ParseStream = function() {
};
};
ParseStream
.
prototype
=
new
videojs
.
Hls
.
Stream
();
ParseStream
.
STREAM_TYPES
=
{
h264
:
0x1b
,
adts
:
0x0f
};
window
.
videojs
.
mp2t
=
{
PAT_PID
:
0x0000
,
...
...
Please
register
or
sign in
to post a comment