rewrite Unit definition (#5079)
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.
This commit is contained in:
Alessandro Ros 2025-10-11 12:18:51 +02:00 committed by GitHub
parent e2294836f5
commit f5f03562d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
86 changed files with 1100 additions and 1602 deletions

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
}