diff --git a/examples/server-h264-save-to-disk/main.go b/examples/server-h264-save-to-disk/main.go index a3acfed5..e3c3bcf4 100644 --- a/examples/server-h264-save-to-disk/main.go +++ b/examples/server-h264-save-to-disk/main.go @@ -10,8 +10,8 @@ import ( "github.com/aler9/gortsplib/v2" "github.com/aler9/gortsplib/v2/pkg/base" "github.com/aler9/gortsplib/v2/pkg/format" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph264" "github.com/aler9/gortsplib/v2/pkg/media" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtph264" ) // This example shows how to diff --git a/pkg/format/track_test.go b/pkg/format/format_test.go similarity index 100% rename from pkg/format/track_test.go rename to pkg/format/format_test.go diff --git a/pkg/format/g711.go b/pkg/format/g711.go index 6f5a8e55..ff4499eb 100644 --- a/pkg/format/g711.go +++ b/pkg/format/g711.go @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpsimpleaudio" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" ) // G711 is a G711 format, encoded with mu-law or A-law. diff --git a/pkg/format/g722.go b/pkg/format/g722.go index da50eff5..23b782d0 100644 --- a/pkg/format/g722.go +++ b/pkg/format/g722.go @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpsimpleaudio" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" ) // G722 is a G722 format. diff --git a/pkg/format/h264.go b/pkg/format/h264.go index 12321120..edf0b06f 100644 --- a/pkg/format/h264.go +++ b/pkg/format/h264.go @@ -10,8 +10,8 @@ import ( "github.com/pion/rtp" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph264" "github.com/aler9/gortsplib/v2/pkg/h264" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtph264" ) // check whether a RTP/H264 packet contains a IDR, without decoding the packet. diff --git a/pkg/format/h265.go b/pkg/format/h265.go index 2f52e464..72e3003a 100644 --- a/pkg/format/h265.go +++ b/pkg/format/h265.go @@ -9,7 +9,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtph265" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph265" ) // H265 is a H265 format. diff --git a/pkg/format/lpcm.go b/pkg/format/lpcm.go index e49d65cc..091d238c 100644 --- a/pkg/format/lpcm.go +++ b/pkg/format/lpcm.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtplpcm" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtplpcm" ) // LPCM is an uncompressed, Linear PCM format. diff --git a/pkg/format/mpeg4audio.go b/pkg/format/mpeg4audio.go index 29de6b2c..8707fc9e 100644 --- a/pkg/format/mpeg4audio.go +++ b/pkg/format/mpeg4audio.go @@ -8,8 +8,8 @@ import ( "github.com/pion/rtp" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmpeg4audio" "github.com/aler9/gortsplib/v2/pkg/mpeg4audio" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpmpeg4audio" ) // MPEG4Audio is a MPEG-4 audio format. diff --git a/pkg/format/opus.go b/pkg/format/opus.go index ed930393..c8be3108 100644 --- a/pkg/format/opus.go +++ b/pkg/format/opus.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpsimpleaudio" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpsimpleaudio" ) // Opus is a Opus format. diff --git a/pkg/format/vp8.go b/pkg/format/vp8.go index 8fe7b4a3..f7ef0c64 100644 --- a/pkg/format/vp8.go +++ b/pkg/format/vp8.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpvp8" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp8" ) // VP8 is a VP8 format. diff --git a/pkg/format/vp9.go b/pkg/format/vp9.go index 9d84b8fa..c18744a1 100644 --- a/pkg/format/vp9.go +++ b/pkg/format/vp9.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/rtpcodecs/rtpvp9" + "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp9" ) // VP9 is a VP9 format. diff --git a/pkg/formatdecenc/formatdecenc.go b/pkg/formatdecenc/formatdecenc.go new file mode 100644 index 00000000..8cb1250a --- /dev/null +++ b/pkg/formatdecenc/formatdecenc.go @@ -0,0 +1,2 @@ +// Package formatdecenc contains decoders and encoders to decode and encode RTP packets. +package formatdecenc diff --git a/pkg/rtpcodecs/rtph264/decoder.go b/pkg/formatdecenc/rtph264/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtph264/decoder.go rename to pkg/formatdecenc/rtph264/decoder.go diff --git a/pkg/rtpcodecs/rtph264/decoder_test.go b/pkg/formatdecenc/rtph264/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtph264/decoder_test.go rename to pkg/formatdecenc/rtph264/decoder_test.go diff --git a/pkg/rtpcodecs/rtph264/encoder.go b/pkg/formatdecenc/rtph264/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtph264/encoder.go rename to pkg/formatdecenc/rtph264/encoder.go diff --git a/pkg/rtpcodecs/rtph264/encoder_test.go b/pkg/formatdecenc/rtph264/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtph264/encoder_test.go rename to pkg/formatdecenc/rtph264/encoder_test.go diff --git a/pkg/rtpcodecs/rtph264/nalutype.go b/pkg/formatdecenc/rtph264/nalutype.go similarity index 100% rename from pkg/rtpcodecs/rtph264/nalutype.go rename to pkg/formatdecenc/rtph264/nalutype.go diff --git a/pkg/rtpcodecs/rtph264/nalutype_test.go b/pkg/formatdecenc/rtph264/nalutype_test.go similarity index 100% rename from pkg/rtpcodecs/rtph264/nalutype_test.go rename to pkg/formatdecenc/rtph264/nalutype_test.go diff --git a/pkg/rtpcodecs/rtph264/rtph264.go b/pkg/formatdecenc/rtph264/rtph264.go similarity index 100% rename from pkg/rtpcodecs/rtph264/rtph264.go rename to pkg/formatdecenc/rtph264/rtph264.go diff --git a/pkg/rtpcodecs/rtph265/decoder.go b/pkg/formatdecenc/rtph265/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtph265/decoder.go rename to pkg/formatdecenc/rtph265/decoder.go diff --git a/pkg/rtpcodecs/rtph265/decoder_test.go b/pkg/formatdecenc/rtph265/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtph265/decoder_test.go rename to pkg/formatdecenc/rtph265/decoder_test.go diff --git a/pkg/rtpcodecs/rtph265/encoder.go b/pkg/formatdecenc/rtph265/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtph265/encoder.go rename to pkg/formatdecenc/rtph265/encoder.go diff --git a/pkg/rtpcodecs/rtph265/encoder_test.go b/pkg/formatdecenc/rtph265/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtph265/encoder_test.go rename to pkg/formatdecenc/rtph265/encoder_test.go diff --git a/pkg/rtpcodecs/rtph265/rtph265.go b/pkg/formatdecenc/rtph265/rtph265.go similarity index 100% rename from pkg/rtpcodecs/rtph265/rtph265.go rename to pkg/formatdecenc/rtph265/rtph265.go diff --git a/pkg/rtpcodecs/rtplpcm/decoder.go b/pkg/formatdecenc/rtplpcm/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtplpcm/decoder.go rename to pkg/formatdecenc/rtplpcm/decoder.go diff --git a/pkg/rtpcodecs/rtplpcm/decoder_test.go b/pkg/formatdecenc/rtplpcm/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtplpcm/decoder_test.go rename to pkg/formatdecenc/rtplpcm/decoder_test.go diff --git a/pkg/rtpcodecs/rtplpcm/encoder.go b/pkg/formatdecenc/rtplpcm/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtplpcm/encoder.go rename to pkg/formatdecenc/rtplpcm/encoder.go diff --git a/pkg/rtpcodecs/rtplpcm/encoder_test.go b/pkg/formatdecenc/rtplpcm/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtplpcm/encoder_test.go rename to pkg/formatdecenc/rtplpcm/encoder_test.go diff --git a/pkg/rtpcodecs/rtplpcm/rtpsimpleaudio.go b/pkg/formatdecenc/rtplpcm/rtpsimpleaudio.go similarity index 100% rename from pkg/rtpcodecs/rtplpcm/rtpsimpleaudio.go rename to pkg/formatdecenc/rtplpcm/rtpsimpleaudio.go diff --git a/pkg/rtpcodecs/rtpmpeg4audio/decoder.go b/pkg/formatdecenc/rtpmpeg4audio/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtpmpeg4audio/decoder.go rename to pkg/formatdecenc/rtpmpeg4audio/decoder.go diff --git a/pkg/rtpcodecs/rtpmpeg4audio/decoder_test.go b/pkg/formatdecenc/rtpmpeg4audio/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpmpeg4audio/decoder_test.go rename to pkg/formatdecenc/rtpmpeg4audio/decoder_test.go diff --git a/pkg/rtpcodecs/rtpmpeg4audio/encoder.go b/pkg/formatdecenc/rtpmpeg4audio/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtpmpeg4audio/encoder.go rename to pkg/formatdecenc/rtpmpeg4audio/encoder.go diff --git a/pkg/rtpcodecs/rtpmpeg4audio/encoder_test.go b/pkg/formatdecenc/rtpmpeg4audio/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpmpeg4audio/encoder_test.go rename to pkg/formatdecenc/rtpmpeg4audio/encoder_test.go diff --git a/pkg/rtpcodecs/rtpmpeg4audio/rtpmpeg4audio.go b/pkg/formatdecenc/rtpmpeg4audio/rtpmpeg4audio.go similarity index 100% rename from pkg/rtpcodecs/rtpmpeg4audio/rtpmpeg4audio.go rename to pkg/formatdecenc/rtpmpeg4audio/rtpmpeg4audio.go diff --git a/pkg/rtpcodecs/rtpsimpleaudio/decoder.go b/pkg/formatdecenc/rtpsimpleaudio/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtpsimpleaudio/decoder.go rename to pkg/formatdecenc/rtpsimpleaudio/decoder.go diff --git a/pkg/rtpcodecs/rtpsimpleaudio/decoder_test.go b/pkg/formatdecenc/rtpsimpleaudio/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpsimpleaudio/decoder_test.go rename to pkg/formatdecenc/rtpsimpleaudio/decoder_test.go diff --git a/pkg/rtpcodecs/rtpsimpleaudio/encoder.go b/pkg/formatdecenc/rtpsimpleaudio/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtpsimpleaudio/encoder.go rename to pkg/formatdecenc/rtpsimpleaudio/encoder.go diff --git a/pkg/rtpcodecs/rtpsimpleaudio/encoder_test.go b/pkg/formatdecenc/rtpsimpleaudio/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpsimpleaudio/encoder_test.go rename to pkg/formatdecenc/rtpsimpleaudio/encoder_test.go diff --git a/pkg/rtpcodecs/rtpsimpleaudio/rtpsimpleaudio.go b/pkg/formatdecenc/rtpsimpleaudio/rtpsimpleaudio.go similarity index 100% rename from pkg/rtpcodecs/rtpsimpleaudio/rtpsimpleaudio.go rename to pkg/formatdecenc/rtpsimpleaudio/rtpsimpleaudio.go diff --git a/pkg/rtpcodecs/rtpvp8/decoder.go b/pkg/formatdecenc/rtpvp8/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtpvp8/decoder.go rename to pkg/formatdecenc/rtpvp8/decoder.go diff --git a/pkg/rtpcodecs/rtpvp8/decoder_test.go b/pkg/formatdecenc/rtpvp8/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpvp8/decoder_test.go rename to pkg/formatdecenc/rtpvp8/decoder_test.go diff --git a/pkg/rtpcodecs/rtpvp8/encoder.go b/pkg/formatdecenc/rtpvp8/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtpvp8/encoder.go rename to pkg/formatdecenc/rtpvp8/encoder.go diff --git a/pkg/rtpcodecs/rtpvp8/encoder_test.go b/pkg/formatdecenc/rtpvp8/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpvp8/encoder_test.go rename to pkg/formatdecenc/rtpvp8/encoder_test.go diff --git a/pkg/rtpcodecs/rtpvp8/rtpvp8.go b/pkg/formatdecenc/rtpvp8/rtpvp8.go similarity index 100% rename from pkg/rtpcodecs/rtpvp8/rtpvp8.go rename to pkg/formatdecenc/rtpvp8/rtpvp8.go diff --git a/pkg/rtpcodecs/rtpvp9/decoder.go b/pkg/formatdecenc/rtpvp9/decoder.go similarity index 100% rename from pkg/rtpcodecs/rtpvp9/decoder.go rename to pkg/formatdecenc/rtpvp9/decoder.go diff --git a/pkg/rtpcodecs/rtpvp9/decoder_test.go b/pkg/formatdecenc/rtpvp9/decoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpvp9/decoder_test.go rename to pkg/formatdecenc/rtpvp9/decoder_test.go diff --git a/pkg/rtpcodecs/rtpvp9/encoder.go b/pkg/formatdecenc/rtpvp9/encoder.go similarity index 100% rename from pkg/rtpcodecs/rtpvp9/encoder.go rename to pkg/formatdecenc/rtpvp9/encoder.go diff --git a/pkg/rtpcodecs/rtpvp9/encoder_test.go b/pkg/formatdecenc/rtpvp9/encoder_test.go similarity index 100% rename from pkg/rtpcodecs/rtpvp9/encoder_test.go rename to pkg/formatdecenc/rtpvp9/encoder_test.go diff --git a/pkg/rtpcodecs/rtpvp9/rtpvp9.go b/pkg/formatdecenc/rtpvp9/rtpvp9.go similarity index 100% rename from pkg/rtpcodecs/rtpvp9/rtpvp9.go rename to pkg/formatdecenc/rtpvp9/rtpvp9.go diff --git a/pkg/rtpcodecs/rtpcodecs.go b/pkg/rtpcodecs/rtpcodecs.go deleted file mode 100644 index 6dc43baf..00000000 --- a/pkg/rtpcodecs/rtpcodecs.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package rtpcodecs contains utilities that convert RTP packets into codec-specific elements and vice versa. -package rtpcodecs