rewrite Unit definition (#5079)

Stream units now share the same struct, with a specialized payload.
This commit is contained in:
Alessandro Ros
2025-10-11 12:18:51 +02:00
committed by GitHub
parent e2294836f5
commit f5f03562d3
86 changed files with 1100 additions and 1602 deletions
+4 -8
View File
@@ -3,10 +3,8 @@ package codecprocessor
import (
"crypto/rand"
"time"
"github.com/bluenviron/gortsplib/v5/pkg/format"
"github.com/pion/rtp"
"github.com/bluenviron/mediamtx/internal/logger"
"github.com/bluenviron/mediamtx/internal/unit"
@@ -24,15 +22,13 @@ func randUint32() (uint32, error) {
// Processor is the codec-specific part of the processing that happens inside stream.Stream.
type Processor interface {
// process a Unit.
ProcessUnit(unit.Unit) error
ProcessUnit(*unit.Unit) error
// process a RTP packet and convert it into a unit.
// process a RTP packet.
ProcessRTPPacket(
pkt *rtp.Packet,
ntp time.Time,
pts int64,
u *unit.Unit,
hasNonRTSPReaders bool,
) (unit.Unit, error)
) error
initialize() error
}