mirror of https://bitbucket.org/ausocean/av.git
Improving pes packet data struct
This commit is contained in:
parent
fae1fdd4ee
commit
2a3f058e77
|
@ -25,26 +25,60 @@ LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package packets
|
package packets
|
||||||
|
/*
|
||||||
|
============================================================================
|
||||||
|
| octet no | bit 0 | bit 1 | bit 2 | bit 3 | bit 4 | bit 5 | bit 6 | bit 7 |
|
||||||
|
============================================================================
|
||||||
|
| octet 0 | 0x00 |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 1 | 0x00 |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 2 | 0x01 |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 3 | Stream ID (0xE0 for video) |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 4 | PES Packet Length (no bytes in packet after this field) |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 5 | PES Length cont. |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 6 | 0x2 | SC | Prior | DAI | Copyr | Copy |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 7 | PDI | ESCRF | ESRF | DSMTMF| ACIF | CRCF | EF |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| octet 8 | PES Header Length |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| optional | optional fields (determined by flags above) (variable Length) |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| - | ... |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| optional | stuffing bytes (varible length) |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| - | ... |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| Optional | Data (variable length) |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
| - | ... |
|
||||||
|
----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
type PESPacket struct {
|
type PESPacket struct {
|
||||||
StreamID byte
|
StreamID byte
|
||||||
Length uint16
|
Length uint16
|
||||||
ScramblingControl byte
|
SC byte // Scrambling control
|
||||||
Priority bool
|
Priority bool // Priority Indicator
|
||||||
DAI bool // data alginment indicator
|
DAI bool // Data alginment indicator
|
||||||
Copyright bool
|
Copyright bool // Copyright indicator
|
||||||
Original bool
|
Original bool // Original data indicator
|
||||||
PDI byte // PTS DTS indicator
|
PDI byte // PTS DTS indicator
|
||||||
ESCR bool
|
ESCRF bool // Elementary stream clock reference flag
|
||||||
ESRate bool
|
ESRF bool // Elementary stream rate reference flag
|
||||||
DSMTrickMode bool
|
DSMTMF bool // Dsm trick mode flag
|
||||||
ACI bool // additional copy info flag
|
ACI bool // Additional copy info flag
|
||||||
CRC bool
|
CRC bool //
|
||||||
Ext bool
|
EF bool // Extension flag
|
||||||
HeaderLength byte
|
HeaderLength byte // Pes header length
|
||||||
OptFields []byte
|
OptFields []byte // Optional fields
|
||||||
Stuffing []byte
|
Stuffing []byte // Stuffing bytes
|
||||||
Data []byte
|
Data []byte // Pes packet data
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *PESPacket) ToByteSlice() (output []byte) {
|
func (p *PESPacket) ToByteSlice() (output []byte) {
|
||||||
|
|
Loading…
Reference in New Issue