move RTP decoders/encoders into pkt/rtpcodecs

This commit is contained in:
aler9
2022-11-15 23:08:36 +01:00
parent 9795e9175a
commit c2c0230669
49 changed files with 14 additions and 15 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/aler9/gortsplib" "github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/base" "github.com/aler9/gortsplib/pkg/base"
"github.com/aler9/gortsplib/pkg/rtph264" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtph264"
) )
// This example shows how to // This example shows how to
@@ -79,10 +79,7 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
} }
// setup RTP/H264->H264 decoder // setup RTP/H264->H264 decoder
rtpDec := &rtph264.Decoder{ rtpDec := h264track.CreateDecoder()
PacketizationMode: h264track.PacketizationMode,
}
rtpDec.Init()
// setup H264->MPEGTS muxer // setup H264->MPEGTS muxer
mpegtsMuxer, err := newMPEGTSMuxer(h264track.SafeSPS(), h264track.SafePPS()) mpegtsMuxer, err := newMPEGTSMuxer(h264track.SafeSPS(), h264track.SafePPS())

View File

@@ -0,0 +1,2 @@
// Package rtpcodecs contains utilities to convert codec-specific elements from/to RTP packets.
package rtpcodecs

View File

@@ -6,7 +6,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpsimpleaudio" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpsimpleaudio"
) )
// TrackG722 is a G722 track. // TrackG722 is a G722 track.

View File

@@ -10,7 +10,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtph264" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtph264"
) )
// TrackH264 is a H264 track. // TrackH264 is a H264 track.

View File

@@ -9,7 +9,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtph265" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtph265"
) )
// TrackH265 is a H265 track. // TrackH265 is a H265 track.

View File

@@ -7,7 +7,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtplpcm" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtplpcm"
) )
// TrackLPCM is an uncompressed, Linear PCM track. // TrackLPCM is an uncompressed, Linear PCM track.

View File

@@ -9,7 +9,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/mpeg4audio" "github.com/aler9/gortsplib/pkg/mpeg4audio"
"github.com/aler9/gortsplib/pkg/rtpmpeg4audio" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpmpeg4audio"
) )
// TrackMPEG4Audio is a MPEG-4 audio track. // TrackMPEG4Audio is a MPEG-4 audio track.

View File

@@ -7,7 +7,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpsimpleaudio" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpsimpleaudio"
) )
// TrackOpus is a Opus track. // TrackOpus is a Opus track.

View File

@@ -6,7 +6,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpsimpleaudio" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpsimpleaudio"
) )
// TrackPCMA is a PCMA track. // TrackPCMA is a PCMA track.

View File

@@ -6,7 +6,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpsimpleaudio" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpsimpleaudio"
) )
// TrackPCMU is a PCMU track. // TrackPCMU is a PCMU track.

View File

@@ -7,7 +7,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpvp8" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpvp8"
) )
// TrackVP8 is a VP8 track. // TrackVP8 is a VP8 track.

View File

@@ -7,7 +7,7 @@ import (
psdp "github.com/pion/sdp/v3" psdp "github.com/pion/sdp/v3"
"github.com/aler9/gortsplib/pkg/rtpvp9" "github.com/aler9/gortsplib/pkg/rtpcodecs/rtpvp9"
) )
// TrackVP9 is a VP9 track. // TrackVP9 is a VP9 track.