mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
Some checks are pending
code_lint / go (push) Waiting to run
code_lint / go_mod (push) Waiting to run
code_lint / docs (push) Waiting to run
code_lint / api_docs (push) Waiting to run
code_test / test_64 (push) Waiting to run
code_test / test_32 (push) Waiting to run
code_test / test_e2e (push) Waiting to run
Stream units now share the same struct, with a specialized payload.
29 lines
476 B
Go
29 lines
476 B
Go
// Package unit contains the unit definition.
|
|
package unit
|
|
|
|
import (
|
|
"reflect"
|
|
"time"
|
|
|
|
"github.com/pion/rtp"
|
|
)
|
|
|
|
// Unit is an atomic unit of a stream.
|
|
type Unit struct {
|
|
// relative time
|
|
PTS int64
|
|
|
|
// absolute time
|
|
NTP time.Time
|
|
|
|
// RTP packets
|
|
RTPPackets []*rtp.Packet
|
|
|
|
// codec-dependent payload
|
|
Payload Payload
|
|
}
|
|
|
|
// NilPayload checks whether the payload is nil.
|
|
func (u Unit) NilPayload() bool {
|
|
return u.Payload == nil || reflect.ValueOf(u.Payload).IsNil()
|
|
}
|