diff --git a/examples/client-read-format-h264-save-to-disk/mpegtsmuxer.go b/examples/client-read-format-h264-save-to-disk/mpegtsmuxer.go index db499377..7a8fe870 100644 --- a/examples/client-read-format-h264-save-to-disk/mpegtsmuxer.go +++ b/examples/client-read-format-h264-save-to-disk/mpegtsmuxer.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/aler9/gortsplib/v2/pkg/h264" + "github.com/aler9/gortsplib/v2/pkg/codecs/h264" "github.com/asticode/go-astits" ) diff --git a/examples/server-h264-save-to-disk/mpegtsmuxer.go b/examples/server-h264-save-to-disk/mpegtsmuxer.go index db499377..7a8fe870 100644 --- a/examples/server-h264-save-to-disk/mpegtsmuxer.go +++ b/examples/server-h264-save-to-disk/mpegtsmuxer.go @@ -7,7 +7,7 @@ import ( "os" "time" - "github.com/aler9/gortsplib/v2/pkg/h264" + "github.com/aler9/gortsplib/v2/pkg/codecs/h264" "github.com/asticode/go-astits" ) diff --git a/pkg/codecs/codecs.go b/pkg/codecs/codecs.go new file mode 100644 index 00000000..de008c72 --- /dev/null +++ b/pkg/codecs/codecs.go @@ -0,0 +1,2 @@ +// Package codecs contains codec-specific utilities. +package codecs diff --git a/pkg/h264/annexb.go b/pkg/codecs/h264/annexb.go similarity index 100% rename from pkg/h264/annexb.go rename to pkg/codecs/h264/annexb.go diff --git a/pkg/h264/annexb_test.go b/pkg/codecs/h264/annexb_test.go similarity index 100% rename from pkg/h264/annexb_test.go rename to pkg/codecs/h264/annexb_test.go diff --git a/pkg/h264/avcc.go b/pkg/codecs/h264/avcc.go similarity index 100% rename from pkg/h264/avcc.go rename to pkg/codecs/h264/avcc.go diff --git a/pkg/h264/avcc_test.go b/pkg/codecs/h264/avcc_test.go similarity index 100% rename from pkg/h264/avcc_test.go rename to pkg/codecs/h264/avcc_test.go diff --git a/pkg/h264/dtsextractor.go b/pkg/codecs/h264/dtsextractor.go similarity index 100% rename from pkg/h264/dtsextractor.go rename to pkg/codecs/h264/dtsextractor.go diff --git a/pkg/h264/dtsextractor_test.go b/pkg/codecs/h264/dtsextractor_test.go similarity index 100% rename from pkg/h264/dtsextractor_test.go rename to pkg/codecs/h264/dtsextractor_test.go diff --git a/pkg/h264/emulationprevention.go b/pkg/codecs/h264/emulationprevention.go similarity index 100% rename from pkg/h264/emulationprevention.go rename to pkg/codecs/h264/emulationprevention.go diff --git a/pkg/h264/emulationprevention_test.go b/pkg/codecs/h264/emulationprevention_test.go similarity index 100% rename from pkg/h264/emulationprevention_test.go rename to pkg/codecs/h264/emulationprevention_test.go diff --git a/pkg/h264/h264.go b/pkg/codecs/h264/h264.go similarity index 100% rename from pkg/h264/h264.go rename to pkg/codecs/h264/h264.go diff --git a/pkg/h264/idrpresent.go b/pkg/codecs/h264/idrpresent.go similarity index 100% rename from pkg/h264/idrpresent.go rename to pkg/codecs/h264/idrpresent.go diff --git a/pkg/h264/idrpresent_test.go b/pkg/codecs/h264/idrpresent_test.go similarity index 100% rename from pkg/h264/idrpresent_test.go rename to pkg/codecs/h264/idrpresent_test.go diff --git a/pkg/h264/nalutype.go b/pkg/codecs/h264/nalutype.go similarity index 100% rename from pkg/h264/nalutype.go rename to pkg/codecs/h264/nalutype.go diff --git a/pkg/h264/nalutype_test.go b/pkg/codecs/h264/nalutype_test.go similarity index 100% rename from pkg/h264/nalutype_test.go rename to pkg/codecs/h264/nalutype_test.go diff --git a/pkg/h264/sps.go b/pkg/codecs/h264/sps.go similarity index 100% rename from pkg/h264/sps.go rename to pkg/codecs/h264/sps.go diff --git a/pkg/h264/sps_test.go b/pkg/codecs/h264/sps_test.go similarity index 100% rename from pkg/h264/sps_test.go rename to pkg/codecs/h264/sps_test.go diff --git a/pkg/h265/h265.go b/pkg/codecs/h265/h265.go similarity index 100% rename from pkg/h265/h265.go rename to pkg/codecs/h265/h265.go diff --git a/pkg/h265/nalutype.go b/pkg/codecs/h265/nalutype.go similarity index 100% rename from pkg/h265/nalutype.go rename to pkg/codecs/h265/nalutype.go diff --git a/pkg/h265/nalutype_test.go b/pkg/codecs/h265/nalutype_test.go similarity index 100% rename from pkg/h265/nalutype_test.go rename to pkg/codecs/h265/nalutype_test.go diff --git a/pkg/h265/sps.go b/pkg/codecs/h265/sps.go similarity index 99% rename from pkg/h265/sps.go rename to pkg/codecs/h265/sps.go index 4fd2e769..223581a7 100644 --- a/pkg/h265/sps.go +++ b/pkg/codecs/h265/sps.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/aler9/gortsplib/v2/pkg/bits" - "github.com/aler9/gortsplib/v2/pkg/h264" + "github.com/aler9/gortsplib/v2/pkg/codecs/h264" ) var subWidthC = []uint32{ diff --git a/pkg/h265/sps_test.go b/pkg/codecs/h265/sps_test.go similarity index 100% rename from pkg/h265/sps_test.go rename to pkg/codecs/h265/sps_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_huffman_table.go b/pkg/codecs/jpeg/define_huffman_table.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_huffman_table.go rename to pkg/codecs/jpeg/define_huffman_table.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_huffman_table_test.go b/pkg/codecs/jpeg/define_huffman_table_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_huffman_table_test.go rename to pkg/codecs/jpeg/define_huffman_table_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_quantization_table.go b/pkg/codecs/jpeg/define_quantization_table.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_quantization_table.go rename to pkg/codecs/jpeg/define_quantization_table.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_quantization_table_test.go b/pkg/codecs/jpeg/define_quantization_table_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_quantization_table_test.go rename to pkg/codecs/jpeg/define_quantization_table_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_restart_interval.go b/pkg/codecs/jpeg/define_restart_interval.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_restart_interval.go rename to pkg/codecs/jpeg/define_restart_interval.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/define_restart_interval_test.go b/pkg/codecs/jpeg/define_restart_interval_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/define_restart_interval_test.go rename to pkg/codecs/jpeg/define_restart_interval_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/jpeg.go b/pkg/codecs/jpeg/jpeg.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/jpeg.go rename to pkg/codecs/jpeg/jpeg.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_frame1.go b/pkg/codecs/jpeg/start_of_frame1.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_frame1.go rename to pkg/codecs/jpeg/start_of_frame1.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_frame1_test.go b/pkg/codecs/jpeg/start_of_frame1_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_frame1_test.go rename to pkg/codecs/jpeg/start_of_frame1_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_image.go b/pkg/codecs/jpeg/start_of_image.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_image.go rename to pkg/codecs/jpeg/start_of_image.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_image_test.go b/pkg/codecs/jpeg/start_of_image_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_image_test.go rename to pkg/codecs/jpeg/start_of_image_test.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_scan.go b/pkg/codecs/jpeg/start_of_scan.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_scan.go rename to pkg/codecs/jpeg/start_of_scan.go diff --git a/pkg/formatdecenc/rtpmjpeg/jpeg/start_of_scan_test.go b/pkg/codecs/jpeg/start_of_scan_test.go similarity index 100% rename from pkg/formatdecenc/rtpmjpeg/jpeg/start_of_scan_test.go rename to pkg/codecs/jpeg/start_of_scan_test.go diff --git a/pkg/format/h264.go b/pkg/format/h264.go index 324afa33..17027aef 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/codecs/h264" "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph264" - "github.com/aler9/gortsplib/v2/pkg/h264" ) // check whether a RTP/H264 packet contains a IDR, without decoding the packet. diff --git a/pkg/formatdecenc/rtph264/decoder.go b/pkg/formatdecenc/rtph264/decoder.go index 204a5d1e..089a198b 100644 --- a/pkg/formatdecenc/rtph264/decoder.go +++ b/pkg/formatdecenc/rtph264/decoder.go @@ -8,7 +8,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/h264" + "github.com/aler9/gortsplib/v2/pkg/codecs/h264" "github.com/aler9/gortsplib/v2/pkg/rtptimedec" ) diff --git a/pkg/formatdecenc/rtph264/encoder.go b/pkg/formatdecenc/rtph264/encoder.go index 7b70b10a..dc86f6e5 100644 --- a/pkg/formatdecenc/rtph264/encoder.go +++ b/pkg/formatdecenc/rtph264/encoder.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/h264" + "github.com/aler9/gortsplib/v2/pkg/codecs/h264" ) const ( diff --git a/pkg/formatdecenc/rtph265/decoder.go b/pkg/formatdecenc/rtph265/decoder.go index 7e19f5bf..b8c2bbc6 100644 --- a/pkg/formatdecenc/rtph265/decoder.go +++ b/pkg/formatdecenc/rtph265/decoder.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/aler9/gortsplib/v2/pkg/h265" + "github.com/aler9/gortsplib/v2/pkg/codecs/h265" "github.com/aler9/gortsplib/v2/pkg/rtptimedec" ) diff --git a/pkg/formatdecenc/rtpmjpeg/decoder.go b/pkg/formatdecenc/rtpmjpeg/decoder.go index 83fecb93..94a37b6f 100644 --- a/pkg/formatdecenc/rtpmjpeg/decoder.go +++ b/pkg/formatdecenc/rtpmjpeg/decoder.go @@ -7,8 +7,8 @@ import ( "github.com/pion/rtp" + "github.com/aler9/gortsplib/v2/pkg/codecs/jpeg" "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg/headers" - "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg/jpeg" "github.com/aler9/gortsplib/v2/pkg/rtptimedec" ) diff --git a/pkg/formatdecenc/rtpmjpeg/encoder.go b/pkg/formatdecenc/rtpmjpeg/encoder.go index e2eddb5e..77dc56c9 100644 --- a/pkg/formatdecenc/rtpmjpeg/encoder.go +++ b/pkg/formatdecenc/rtpmjpeg/encoder.go @@ -8,8 +8,8 @@ import ( "github.com/pion/rtp" + "github.com/aler9/gortsplib/v2/pkg/codecs/jpeg" "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg/headers" - "github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpmjpeg/jpeg" ) const (