Add support pipe to exec source

This commit is contained in:
Alexey Khit
2023-05-03 07:49:10 +03:00
parent 2e8be342ef
commit e78f9fa69d
6 changed files with 277 additions and 17 deletions
+1 -1
View File
@@ -137,7 +137,7 @@ func (p *PES) GetPacket() (pkt *rtp.Packet) {
pkt = &rtp.Packet{
Header: rtp.Header{
PayloadType: p.StreamType,
Timestamp: uint32(time.Duration(time.Now().UnixNano()) * 90000 / time.Second),
Timestamp: core.Now90000(),
},
Payload: payload,
}
+8
View File
@@ -129,6 +129,14 @@ func (r *Reader) GetPacket() *rtp.Packet {
return nil
}
func (r *Reader) GetStreamTypes() []byte {
types := make([]byte, 0, len(r.pes))
for _, pes := range r.pes {
types = append(types, pes.StreamType)
}
return types
}
// Sync - search sync byte
func (r *Reader) Sync() bool {
// drop previous readed packet