mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
move RTP decoders/encoders into pkt/rtpcodecs
This commit is contained in:
@@ -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())
|
||||||
|
2
pkg/rtpcodecs/rtpcodecs.go
Normal file
2
pkg/rtpcodecs/rtpcodecs.go
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Package rtpcodecs contains utilities to convert codec-specific elements from/to RTP packets.
|
||||||
|
package rtpcodecs
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
@@ -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.
|
||||||
|
Reference in New Issue
Block a user