Constructor
new M2tsSegmenter(packetSize, psinon-null, timingContentType, frameDuration, pcrPidnullable)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
packetSize |
number | ||
psi |
Uint8Array | ||
timingContentType |
string | ||
frameDuration |
number | Seconds per frame from the catalog, or 0 when the catalog does not say. | |
pcrPid |
number |
<nullable> |
- Implements:
- Source:
Members
timelineOffset_ :number
Maps media time onto presentation time. Non-zero only once a
discontinuity has moved the media's own clock.
Type:
- number
- Source:
tsParser_ :shaka.util.TsParser
Kept across groups so that its 33-bit timestamp rollover reference
survives, which is what lets a group that straddles the wrap be timed
correctly.
Type:
- Source:
Methods
append_(datanon-null)
Validates an object's source packets and holds onto them until the group
ends.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Uint8Array |
- Source:
buildGroupData_() → {Uint8Array}
Copies the group's transport packets into one buffer, behind the
initialization packets.
The 192-to-188 normalization happens as part of this copy rather than as a
pass of its own, so supporting M2TS source packets costs no extra
allocation and no extra traffic over the plain transport stream path.
The PAT/PMT is prepended because the draft only requires a publisher to
repeat the program information periodically, so a group may open without
it, and a transport stream cannot be interpreted without it.
- Source:
Returns:
- Type
- Uint8Array
getTiming_() → {?{startTime: number, duration: number}}
Derives the group's presentation timing from the timestamps of the
elementary stream the track is presented as.
- Source:
Returns:
- Type
- ?{startTime: number, duration: number}
isDiscontinuity_(datanon-null, packet) → {boolean}
Reads the adaptation field's discontinuity_indicator, which is how the
draft requires a publisher to signal that it moved the clock between two
groups.
When the catalog names the PCR PID we only trust that PID, because on
other PIDs the same bit signals a continuity counter discontinuity, which
is a different thing and does not move the clock.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Uint8Array | |
packet |
number | Offset of the transport packet. |
- Source:
Returns:
- Type
- boolean
push(objnon-null) → {Array<!shaka.extern.MsfSegment>}
Consumes one MoQT object and returns the segments it completed, which is
usually none or one. Objects with an empty payload carry an object status
rather than media and are delivered here too, because for some packagings
they are the signal that a Group has ended.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
shaka.extern.MsfObject |
- Implements:
- Source:
Returns:
- Type
- Array<!shaka.extern.MsfSegment>
resetGroup_()
- Source: