From 5e5a21240d2634fab8becd6b3bdb8c12671afd5e Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Mon, 14 Aug 2023 20:47:28 +0200 Subject: [PATCH] rename pkg/formats into pkt/format --- README.md | 38 +++---- client.go | 6 +- client_format.go | 6 +- client_play_test.go | 44 ++++----- client_record_test.go | 4 +- examples/client-publish-format-g711/main.go | 4 +- examples/client-publish-format-g722/main.go | 4 +- examples/client-publish-format-h264/main.go | 4 +- examples/client-publish-format-h265/main.go | 4 +- examples/client-publish-format-lpcm/main.go | 4 +- examples/client-publish-format-mjpeg/main.go | 4 +- .../client-publish-format-mpeg4audio/main.go | 4 +- examples/client-publish-format-opus/main.go | 4 +- examples/client-publish-format-vp8/main.go | 4 +- examples/client-publish-format-vp9/main.go | 4 +- examples/client-publish-options/main.go | 4 +- examples/client-publish-pause/main.go | 4 +- examples/client-read-format-g711/main.go | 4 +- examples/client-read-format-g722/main.go | 4 +- .../main.go | 6 +- .../main.go | 6 +- examples/client-read-format-h264/main.go | 6 +- examples/client-read-format-h265/main.go | 6 +- examples/client-read-format-lpcm/main.go | 4 +- examples/client-read-format-mjpeg/main.go | 6 +- .../main.go | 4 +- .../client-read-format-mpeg4audio/main.go | 4 +- examples/client-read-format-opus/main.go | 4 +- examples/client-read-format-vp8/main.go | 6 +- examples/client-read-format-vp9/main.go | 6 +- examples/client-read-options/main.go | 4 +- examples/client-read-pause/main.go | 4 +- examples/client-read-republish/main.go | 4 +- examples/client-read/main.go | 4 +- examples/proxy/client.go | 4 +- examples/server-h264-save-to-disk/main.go | 8 +- examples/server-tls/main.go | 4 +- examples/server/main.go | 4 +- internal/highleveltests/server_test.go | 4 +- pkg/{formats => format}/av1.go | 4 +- pkg/{formats => format}/av1_test.go | 2 +- pkg/{formats => format}/format.go | 4 +- pkg/{formats => format}/format_test.go | 2 +- pkg/{formats => format}/g711.go | 4 +- pkg/{formats => format}/g711_test.go | 2 +- pkg/{formats => format}/g722.go | 4 +- pkg/{formats => format}/g722_test.go | 2 +- pkg/{formats => format}/g726.go | 2 +- pkg/{formats => format}/g726_test.go | 2 +- pkg/{formats => format}/generic.go | 2 +- pkg/{formats => format}/generic_test.go | 2 +- pkg/{formats => format}/h264.go | 4 +- pkg/{formats => format}/h264_test.go | 2 +- pkg/{formats => format}/h265.go | 4 +- pkg/{formats => format}/h265_test.go | 2 +- pkg/{formats => format}/lpcm.go | 4 +- pkg/{formats => format}/lpcm_test.go | 2 +- pkg/{formats => format}/mjpeg.go | 4 +- pkg/{formats => format}/mjpeg_test.go | 2 +- pkg/{formats => format}/mpeg1_audio.go | 4 +- pkg/{formats => format}/mpeg1_audio_test.go | 2 +- pkg/{formats => format}/mpeg1_video.go | 2 +- pkg/{formats => format}/mpeg1_video_test.go | 2 +- .../mpeg4_audio_generic.go | 4 +- .../mpeg4_audio_generic_test.go | 2 +- pkg/{formats => format}/mpeg4_audio_latm.go | 4 +- .../mpeg4_audio_latm_test.go | 2 +- pkg/{formats => format}/mpeg4_video_es.go | 4 +- .../mpeg4_video_es_test.go | 2 +- pkg/format/mpeg4_video_generic.go | 3 + pkg/format/mpeg4_video_generic_test.go | 3 + pkg/{formats => format}/mpegts.go | 2 +- pkg/{formats => format}/mpegts_test.go | 2 +- pkg/{formats => format}/opus.go | 4 +- pkg/{formats => format}/opus_test.go | 2 +- pkg/{formats => format}/rtpav1/decoder.go | 0 .../rtpav1/decoder_test.go | 0 pkg/{formats => format}/rtpav1/encoder.go | 0 .../rtpav1/encoder_test.go | 0 pkg/{formats => format}/rtpav1/rtpav1.go | 0 .../fuzz/FuzzDecoder/079a435e5445c35b | 0 .../fuzz/FuzzDecoder/1bcf1d62b055a123 | 0 .../fuzz/FuzzDecoder/894f7b51b885dbb1 | 0 .../fuzz/FuzzDecoder/bf1e5b208e57f701 | 0 pkg/{formats => format}/rtph264/decoder.go | 0 .../rtph264/decoder_test.go | 0 pkg/{formats => format}/rtph264/encoder.go | 0 .../rtph264/encoder_test.go | 0 pkg/{formats => format}/rtph264/rtph264.go | 0 .../fuzz/FuzzDecoder/11dca3ad0def7057 | 0 .../fuzz/FuzzDecoder/60892a24d67609fc | 0 .../fuzz/FuzzDecoder/84ed65595ad05a58 | 0 .../fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 | 0 .../fuzz/FuzzDecoder/ecf7d0b7f06fcc4a | 0 .../fuzz/FuzzDecoder/edbcdbb8d9f1bdac | 0 .../fuzz/FuzzDecoder/ef62dc47a38f1a39 | 0 pkg/{formats => format}/rtph265/decoder.go | 0 .../rtph265/decoder_test.go | 0 pkg/{formats => format}/rtph265/encoder.go | 0 .../rtph265/encoder_test.go | 0 pkg/{formats => format}/rtph265/rtph265.go | 0 .../fuzz/FuzzDecoder/25f2b139d5d03b01 | 0 .../fuzz/FuzzDecoder/2d69a60004f3edfd | 0 .../fuzz/FuzzDecoder/5cedd25e23c9f9aa | 0 .../fuzz/FuzzDecoder/717a02ebf21c41db | 0 .../fuzz/FuzzDecoder/84ed65595ad05a58 | 0 .../fuzz/FuzzDecoder/95e634df087d6476 | 0 .../fuzz/FuzzDecoder/a7fab38f1f1629f8 | 0 .../fuzz/FuzzDecoder/e807a721f4e89fcb | 0 pkg/{formats => format}/rtplpcm/decoder.go | 0 .../rtplpcm/decoder_test.go | 0 pkg/{formats => format}/rtplpcm/encoder.go | 0 .../rtplpcm/encoder_test.go | 0 pkg/{formats => format}/rtplpcm/rtplpcm.go | 0 .../fuzz/FuzzDecoder/582528ddfad69eb5 | 0 pkg/{formats => format}/rtpmjpeg/decoder.go | 0 .../rtpmjpeg/decoder_test.go | 0 pkg/{formats => format}/rtpmjpeg/encoder.go | 0 .../rtpmjpeg/encoder_test.go | 0 .../rtpmjpeg/header_jpeg.go | 0 .../rtpmjpeg/header_jpeg_test.go | 0 .../rtpmjpeg/header_quantization_table.go | 0 .../header_quantization_table_test.go | 0 .../rtpmjpeg/header_restart_marker.go | 0 .../rtpmjpeg/header_restart_marker_test.go | 0 pkg/{formats => format}/rtpmjpeg/rtpmjpeg.go | 0 .../fuzz/FuzzDecoder/5c3e3cea6fcbf660 | 0 .../fuzz/FuzzDecoder/8b8df3a54310aad8 | 0 .../fuzz/FuzzDecoder/acf99ee7fd60497d | 0 .../fuzz/FuzzDecoder/c582eb998d5b265e | 0 .../fuzz/FuzzDecoder/f1b261959da64dfa | 0 .../rtpmpeg1audio/decoder.go | 0 .../rtpmpeg1audio/decoder_test.go | 0 .../rtpmpeg1audio/encoder.go | 0 .../rtpmpeg1audio/encoder_test.go | 0 .../rtpmpeg1audio/rtpmpeg1audio.go | 0 .../fuzz/FuzzDecoder/035c6218e0188ec4 | 0 .../fuzz/FuzzDecoder/0d51e18d32a6771a | 0 .../fuzz/FuzzDecoder/2dcc1140d95305bd | 0 .../fuzz/FuzzDecoder/30bd4b8733a5f13f | 0 .../fuzz/FuzzDecoder/c1623732f13f642e | 0 .../fuzz/FuzzDecoder/cf7295b77ea49fed | 0 .../rtpmpeg4audio/decoder.go | 2 +- .../rtpmpeg4audio/encoder.go | 2 +- .../rtpmpeg4audio/rtpmpeg4audio.go | 0 .../rtpmpeg4audiogeneric/decoder.go | 0 .../rtpmpeg4audiogeneric/decoder_test.go | 0 .../rtpmpeg4audiogeneric/encoder.go | 0 .../rtpmpeg4audiogeneric/encoder_test.go | 0 .../rtpmpeg4audio_generic.go | 0 .../fuzz/FuzzDecoder/0133a2a9bd638ceb | 0 .../fuzz/FuzzDecoder/079a435e5445c35b | 0 .../fuzz/FuzzDecoder/571808e383aba6a5 | 0 .../fuzz/FuzzDecoder/8f3e197fb87140b2 | 0 .../fuzz/FuzzDecoder/9418bac23c1c4f72 | 0 .../fuzz/FuzzDecoder/97f31764971cea9c | 0 .../fuzz/FuzzDecoder/a68704dd42c38106 | 0 .../fuzz/FuzzDecoder/c7480ec341b553d6 | 0 .../rtpmpeg4audiolatm/decoder.go | 0 .../rtpmpeg4audiolatm/decoder_test.go | 0 .../rtpmpeg4audiolatm/encoder.go | 0 .../rtpmpeg4audiolatm/encoder_test.go | 0 .../rtpmpeg4audiolatm/payload_length_info.go | 0 .../rtpmpeg4audiolatm/rtpmpeg4audio_latm.go | 0 .../fuzz/FuzzDecoder/079a435e5445c35b | 0 .../rtpmpeg4video/decoder.go | 0 .../rtpmpeg4video/decoder_test.go | 0 .../rtpmpeg4video/encoder.go | 0 .../rtpmpeg4video/encoder_test.go | 0 .../rtpmpeg4video/rtpmpeg4video.go | 0 .../rtpsimpleaudio/decoder.go | 0 .../rtpsimpleaudio/decoder_test.go | 0 .../rtpsimpleaudio/encoder.go | 0 .../rtpsimpleaudio/encoder_test.go | 0 .../rtpsimpleaudio/rtpsimpleaudio.go | 0 pkg/{formats => format}/rtpvp8/decoder.go | 0 .../rtpvp8/decoder_test.go | 0 pkg/{formats => format}/rtpvp8/encoder.go | 0 .../rtpvp8/encoder_test.go | 0 pkg/{formats => format}/rtpvp8/rtpvp8.go | 0 .../fuzz/FuzzDecoder/01b49f6ea4a5f782 | 0 .../fuzz/FuzzDecoder/079a435e5445c35b | 0 .../fuzz/FuzzDecoder/2b9461645a4b90d2 | 0 pkg/{formats => format}/rtpvp9/decoder.go | 0 .../rtpvp9/decoder_test.go | 0 pkg/{formats => format}/rtpvp9/encoder.go | 0 .../rtpvp9/encoder_test.go | 0 pkg/{formats => format}/rtpvp9/rtpvp9.go | 0 .../fuzz/FuzzDecoder/41b798362d81811a | 0 .../fuzz/FuzzDecoder/5c3924785d154da4 | 0 pkg/{formats => format}/speex.go | 2 +- pkg/{formats => format}/speex_test.go | 2 +- .../fuzz/FuzzUnmarshalH264/708789f132a57d65 | 0 .../fuzz/FuzzUnmarshalH264/85649d45641911d0 | 0 .../fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 | 0 .../fuzz/FuzzUnmarshalH265/09376da4826c9233 | 0 .../fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf | 0 .../fuzz/FuzzUnmarshalH265/fae5e048802aad6c | 0 .../fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 | 0 .../fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c | 0 .../00e15d22123489fd | 0 .../aa424148ecba23f1 | 0 .../fuzz/FuzzUnmarshalOpus/771e938e4458e983 | 0 .../fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 | 0 .../fuzz/FuzzUnmarshalVP8/85649d45641911d0 | 0 .../fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 | 0 .../fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 | 0 .../fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb | 0 .../fuzz/FuzzUnmarshalVP9/671f05b72e69d643 | 0 .../fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 | 0 .../fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b | 0 .../fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 | 0 pkg/{formats => format}/vorbis.go | 2 +- pkg/{formats => format}/vorbis_test.go | 2 +- pkg/{formats => format}/vp8.go | 4 +- pkg/{formats => format}/vp8_test.go | 2 +- pkg/{formats => format}/vp9.go | 4 +- pkg/{formats => format}/vp9_test.go | 2 +- pkg/formats/mpeg4_video_generic.go | 3 - pkg/formats/mpeg4_video_generic_test.go | 3 - pkg/media/media.go | 6 +- pkg/media/media_test.go | 4 +- pkg/media/medias_test.go | 98 +++++++++---------- server_play_test.go | 14 +-- server_record_test.go | 14 +-- server_session.go | 4 +- server_session_format.go | 6 +- server_stream_format.go | 4 +- 228 files changed, 266 insertions(+), 266 deletions(-) rename pkg/{formats => format}/av1.go (96%) rename pkg/{formats => format}/av1_test.go (96%) rename pkg/{formats => format}/format.go (96%) rename pkg/{formats => format}/format_test.go (99%) rename pkg/{formats => format}/g711.go (95%) rename pkg/{formats => format}/g711_test.go (98%) rename pkg/{formats => format}/g722.go (94%) rename pkg/{formats => format}/g722_test.go (97%) rename pkg/{formats => format}/g726.go (98%) rename pkg/{formats => format}/g726_test.go (94%) rename pkg/{formats => format}/generic.go (99%) rename pkg/{formats => format}/generic_test.go (97%) rename pkg/{formats => format}/h264.go (98%) rename pkg/{formats => format}/h264_test.go (98%) rename pkg/{formats => format}/h265.go (98%) rename pkg/{formats => format}/h265_test.go (99%) rename pkg/{formats => format}/lpcm.go (96%) rename pkg/{formats => format}/lpcm_test.go (98%) rename pkg/{formats => format}/mjpeg.go (93%) rename pkg/{formats => format}/mjpeg_test.go (99%) rename pkg/{formats => format}/mpeg1_audio.go (93%) rename pkg/{formats => format}/mpeg1_audio_test.go (99%) rename pkg/{formats => format}/mpeg1_video.go (96%) rename pkg/{formats => format}/mpeg1_video_test.go (95%) rename pkg/{formats => format}/mpeg4_audio_generic.go (98%) rename pkg/{formats => format}/mpeg4_audio_generic_test.go (98%) rename pkg/{formats => format}/mpeg4_audio_latm.go (97%) rename pkg/{formats => format}/mpeg4_audio_latm_test.go (98%) rename pkg/{formats => format}/mpeg4_video_es.go (96%) rename pkg/{formats => format}/mpeg4_video_es_test.go (98%) create mode 100644 pkg/format/mpeg4_video_generic.go create mode 100644 pkg/format/mpeg4_video_generic_test.go rename pkg/{formats => format}/mpegts.go (96%) rename pkg/{formats => format}/mpegts_test.go (94%) rename pkg/{formats => format}/opus.go (96%) rename pkg/{formats => format}/opus_test.go (97%) rename pkg/{formats => format}/rtpav1/decoder.go (100%) rename pkg/{formats => format}/rtpav1/decoder_test.go (100%) rename pkg/{formats => format}/rtpav1/encoder.go (100%) rename pkg/{formats => format}/rtpav1/encoder_test.go (100%) rename pkg/{formats => format}/rtpav1/rtpav1.go (100%) rename pkg/{formats => format}/rtpav1/testdata/fuzz/FuzzDecoder/079a435e5445c35b (100%) rename pkg/{formats => format}/rtpav1/testdata/fuzz/FuzzDecoder/1bcf1d62b055a123 (100%) rename pkg/{formats => format}/rtpav1/testdata/fuzz/FuzzDecoder/894f7b51b885dbb1 (100%) rename pkg/{formats => format}/rtpav1/testdata/fuzz/FuzzDecoder/bf1e5b208e57f701 (100%) rename pkg/{formats => format}/rtph264/decoder.go (100%) rename pkg/{formats => format}/rtph264/decoder_test.go (100%) rename pkg/{formats => format}/rtph264/encoder.go (100%) rename pkg/{formats => format}/rtph264/encoder_test.go (100%) rename pkg/{formats => format}/rtph264/rtph264.go (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/11dca3ad0def7057 (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/60892a24d67609fc (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/ecf7d0b7f06fcc4a (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac (100%) rename pkg/{formats => format}/rtph264/testdata/fuzz/FuzzDecoder/ef62dc47a38f1a39 (100%) rename pkg/{formats => format}/rtph265/decoder.go (100%) rename pkg/{formats => format}/rtph265/decoder_test.go (100%) rename pkg/{formats => format}/rtph265/encoder.go (100%) rename pkg/{formats => format}/rtph265/encoder_test.go (100%) rename pkg/{formats => format}/rtph265/rtph265.go (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/25f2b139d5d03b01 (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/2d69a60004f3edfd (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/5cedd25e23c9f9aa (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/95e634df087d6476 (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8 (100%) rename pkg/{formats => format}/rtph265/testdata/fuzz/FuzzDecoder/e807a721f4e89fcb (100%) rename pkg/{formats => format}/rtplpcm/decoder.go (100%) rename pkg/{formats => format}/rtplpcm/decoder_test.go (100%) rename pkg/{formats => format}/rtplpcm/encoder.go (100%) rename pkg/{formats => format}/rtplpcm/encoder_test.go (100%) rename pkg/{formats => format}/rtplpcm/rtplpcm.go (100%) rename pkg/{formats => format}/rtplpcm/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 (100%) rename pkg/{formats => format}/rtpmjpeg/decoder.go (100%) rename pkg/{formats => format}/rtpmjpeg/decoder_test.go (100%) rename pkg/{formats => format}/rtpmjpeg/encoder.go (100%) rename pkg/{formats => format}/rtpmjpeg/encoder_test.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_jpeg.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_jpeg_test.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_quantization_table.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_quantization_table_test.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_restart_marker.go (100%) rename pkg/{formats => format}/rtpmjpeg/header_restart_marker_test.go (100%) rename pkg/{formats => format}/rtpmjpeg/rtpmjpeg.go (100%) rename pkg/{formats => format}/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660 (100%) rename pkg/{formats => format}/rtpmjpeg/testdata/fuzz/FuzzDecoder/8b8df3a54310aad8 (100%) rename pkg/{formats => format}/rtpmjpeg/testdata/fuzz/FuzzDecoder/acf99ee7fd60497d (100%) rename pkg/{formats => format}/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e (100%) rename pkg/{formats => format}/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa (100%) rename pkg/{formats => format}/rtpmpeg1audio/decoder.go (100%) rename pkg/{formats => format}/rtpmpeg1audio/decoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg1audio/encoder.go (100%) rename pkg/{formats => format}/rtpmpeg1audio/encoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg1audio/rtpmpeg1audio.go (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/035c6218e0188ec4 (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/0d51e18d32a6771a (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/2dcc1140d95305bd (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/30bd4b8733a5f13f (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/c1623732f13f642e (100%) rename pkg/{formats => format}/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/cf7295b77ea49fed (100%) rename pkg/{formats => format}/rtpmpeg4audio/decoder.go (80%) rename pkg/{formats => format}/rtpmpeg4audio/encoder.go (65%) rename pkg/{formats => format}/rtpmpeg4audio/rtpmpeg4audio.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/decoder.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/decoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/encoder.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/encoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/rtpmpeg4audio_generic.go (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/079a435e5445c35b (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/571808e383aba6a5 (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2 (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/9418bac23c1c4f72 (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/97f31764971cea9c (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/a68704dd42c38106 (100%) rename pkg/{formats => format}/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/c7480ec341b553d6 (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/decoder.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/decoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/encoder.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/encoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/payload_length_info.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/rtpmpeg4audio_latm.go (100%) rename pkg/{formats => format}/rtpmpeg4audiolatm/testdata/fuzz/FuzzDecoder/079a435e5445c35b (100%) rename pkg/{formats => format}/rtpmpeg4video/decoder.go (100%) rename pkg/{formats => format}/rtpmpeg4video/decoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4video/encoder.go (100%) rename pkg/{formats => format}/rtpmpeg4video/encoder_test.go (100%) rename pkg/{formats => format}/rtpmpeg4video/rtpmpeg4video.go (100%) rename pkg/{formats => format}/rtpsimpleaudio/decoder.go (100%) rename pkg/{formats => format}/rtpsimpleaudio/decoder_test.go (100%) rename pkg/{formats => format}/rtpsimpleaudio/encoder.go (100%) rename pkg/{formats => format}/rtpsimpleaudio/encoder_test.go (100%) rename pkg/{formats => format}/rtpsimpleaudio/rtpsimpleaudio.go (100%) rename pkg/{formats => format}/rtpvp8/decoder.go (100%) rename pkg/{formats => format}/rtpvp8/decoder_test.go (100%) rename pkg/{formats => format}/rtpvp8/encoder.go (100%) rename pkg/{formats => format}/rtpvp8/encoder_test.go (100%) rename pkg/{formats => format}/rtpvp8/rtpvp8.go (100%) rename pkg/{formats => format}/rtpvp8/testdata/fuzz/FuzzDecoder/01b49f6ea4a5f782 (100%) rename pkg/{formats => format}/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b (100%) rename pkg/{formats => format}/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2 (100%) rename pkg/{formats => format}/rtpvp9/decoder.go (100%) rename pkg/{formats => format}/rtpvp9/decoder_test.go (100%) rename pkg/{formats => format}/rtpvp9/encoder.go (100%) rename pkg/{formats => format}/rtpvp9/encoder_test.go (100%) rename pkg/{formats => format}/rtpvp9/rtpvp9.go (100%) rename pkg/{formats => format}/rtpvp9/testdata/fuzz/FuzzDecoder/41b798362d81811a (100%) rename pkg/{formats => format}/rtpvp9/testdata/fuzz/FuzzDecoder/5c3924785d154da4 (100%) rename pkg/{formats => format}/speex.go (98%) rename pkg/{formats => format}/speex_test.go (95%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH264/708789f132a57d65 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH264/85649d45641911d0 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH265/09376da4826c9233 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalH265/fae5e048802aad6c (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/00e15d22123489fd (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/aa424148ecba23f1 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVP8/85649d45641911d0 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVP9/671f05b72e69d643 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b (100%) rename pkg/{formats => format}/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 (100%) rename pkg/{formats => format}/vorbis.go (99%) rename pkg/{formats => format}/vorbis_test.go (96%) rename pkg/{formats => format}/vp8.go (96%) rename pkg/{formats => format}/vp8_test.go (96%) rename pkg/{formats => format}/vp9.go (96%) rename pkg/{formats => format}/vp9_test.go (96%) delete mode 100644 pkg/formats/mpeg4_video_generic.go delete mode 100644 pkg/formats/mpeg4_video_generic_test.go diff --git a/README.md b/README.md index 8be6bea2..76963fb7 100644 --- a/README.md +++ b/README.md @@ -102,35 +102,35 @@ In RTSP, media streams are routed between server and clients by using RTP packet |format / codec|variant|documentation|encoder and decoder available| |--------------|-------|-------------|-----------------------------| -|AV1||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#AV1)|:heavy_check_mark:| -|VP9||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#VP9)|:heavy_check_mark:| -|VP8||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#VP8)|:heavy_check_mark:| -|H265||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#H265)|:heavy_check_mark:| -|H264||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#H264)|:heavy_check_mark:| -|MPEG-4 Video (H263, Xvid)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEG4VideoES)|:heavy_check_mark:| -|MPEG-1/2 Video||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEG1Video)|| -|M-JPEG||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MJPEG)|:heavy_check_mark:| +|AV1||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#AV1)|:heavy_check_mark:| +|VP9||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#VP9)|:heavy_check_mark:| +|VP8||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#VP8)|:heavy_check_mark:| +|H265||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#H265)|:heavy_check_mark:| +|H264||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#H264)|:heavy_check_mark:| +|MPEG-4 Video (H263, Xvid)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG4VideoES)|:heavy_check_mark:| +|MPEG-1/2 Video||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG1Video)|| +|M-JPEG||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MJPEG)|:heavy_check_mark:| ### Audio |format / codec|variant|documentation|encoder and decoder available| |--------------|-------|-------------|-----------------------------| -|Opus||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#Opus)|:heavy_check_mark:| -|Vorbis||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#Vorbis)|| -|MPEG-4 Audio (AAC)|Generic (RFC3640)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEG4AudioGeneric)|:heavy_check_mark:| -|MPEG-4 Audio (AAC)|LATM (RFC6416)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEG4AudioLATM)|:heavy_check_mark:| -|MPEG-1/2 Audio (MP3)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEG1Audio)|:heavy_check_mark:| -|Speex||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#Speex)|| -|G726||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#G726)|| -|G722||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#G722)|:heavy_check_mark:| -|G711 (PCMA, PCMU)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#G711)|:heavy_check_mark:| -|LPCM||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#LPCM)|:heavy_check_mark:| +|Opus||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Opus)|:heavy_check_mark:| +|Vorbis||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Vorbis)|| +|MPEG-4 Audio (AAC)|Generic (RFC3640)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG4AudioGeneric)|:heavy_check_mark:| +|MPEG-4 Audio (AAC)|LATM (RFC6416)|[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG4AudioLATM)|:heavy_check_mark:| +|MPEG-1/2 Audio (MP3)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEG1Audio)|:heavy_check_mark:| +|Speex||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#Speex)|| +|G726||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G726)|| +|G722||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G722)|:heavy_check_mark:| +|G711 (PCMA, PCMU)||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#G711)|:heavy_check_mark:| +|LPCM||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#LPCM)|:heavy_check_mark:| ### Mixed |format / codec|variant|documentation|encoder and decoder available| |--------------|-------|-------------|-----------------------------| -|MPEG-TS||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/formats#MPEGTS)|| +|MPEG-TS||[link](https://pkg.go.dev/github.com/bluenviron/gortsplib/v4/pkg/format#MPEGTS)|| ## Standards diff --git a/client.go b/client.go index c20e797b..1dbf6de8 100644 --- a/client.go +++ b/client.go @@ -23,7 +23,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/base" "github.com/bluenviron/gortsplib/v4/pkg/bytecounter" "github.com/bluenviron/gortsplib/v4/pkg/conn" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/liberrors" "github.com/bluenviron/gortsplib/v4/pkg/media" @@ -199,7 +199,7 @@ type ClientOnDecodeErrorFunc func(err error) type OnPacketRTPFunc func(*rtp.Packet) // OnPacketRTPAnyFunc is the prototype of the callback passed to OnPacketRTP(Any). -type OnPacketRTPAnyFunc func(*media.Media, formats.Format, *rtp.Packet) +type OnPacketRTPAnyFunc func(*media.Media, format.Format, *rtp.Packet) // OnPacketRTCPFunc is the prototype of the callback passed to OnPacketRTCP(). type OnPacketRTCPFunc func(rtcp.Packet) @@ -1639,7 +1639,7 @@ func (c *Client) OnPacketRTCPAny(cb OnPacketRTCPAnyFunc) { } // OnPacketRTP sets the callback that is called when a RTP packet is read. -func (c *Client) OnPacketRTP(medi *media.Media, forma formats.Format, cb OnPacketRTPFunc) { +func (c *Client) OnPacketRTP(medi *media.Media, forma format.Format, cb OnPacketRTPFunc) { cm := c.medias[medi] ct := cm.formats[forma.PayloadType()] ct.onPacketRTP = cb diff --git a/client_format.go b/client_format.go index e567baf8..8b261e03 100644 --- a/client_format.go +++ b/client_format.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtcp" "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/rtcpreceiver" "github.com/bluenviron/gortsplib/v4/pkg/rtcpsender" "github.com/bluenviron/gortsplib/v4/pkg/rtplossdetector" @@ -16,7 +16,7 @@ import ( type clientFormat struct { cm *clientMedia - format formats.Format + format format.Format udpReorderer *rtpreorderer.Reorderer // play udpRTCPReceiver *rtcpreceiver.RTCPReceiver // play tcpLossDetector *rtplossdetector.LossDetector // play @@ -24,7 +24,7 @@ type clientFormat struct { onPacketRTP OnPacketRTPFunc } -func newClientFormat(cm *clientMedia, forma formats.Format) *clientFormat { +func newClientFormat(cm *clientMedia, forma format.Format) *clientFormat { return &clientFormat{ cm: cm, format: forma, diff --git a/client_play_test.go b/client_play_test.go index 170c5a82..28de67ae 100644 --- a/client_play_test.go +++ b/client_play_test.go @@ -18,7 +18,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/auth" "github.com/bluenviron/gortsplib/v4/pkg/base" "github.com/bluenviron/gortsplib/v4/pkg/conn" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" @@ -38,7 +38,7 @@ func mustMarshalMedias(medias media.Medias) []byte { return byts } -func readAll(c *Client, ur string, cb func(*media.Media, formats.Format, *rtp.Packet)) error { +func readAll(c *Client, ur string, cb func(*media.Media, format.Format, *rtp.Packet)) error { u, err := url.Parse(ur) if err != nil { return err @@ -79,7 +79,7 @@ func TestClientPlayFormats(t *testing.T) { media2 := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.MPEG4Audio{ + Formats: []format.Format{&format.MPEG4Audio{ PayloadTyp: 96, Config: &mpeg4audio.Config{ Type: mpeg4audio.ObjectTypeAACLC, @@ -94,7 +94,7 @@ func TestClientPlayFormats(t *testing.T) { media3 := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.MPEG4Audio{ + Formats: []format.Format{&format.MPEG4Audio{ PayloadTyp: 96, Config: &mpeg4audio.Config{ Type: mpeg4audio.ObjectTypeAACLC, @@ -271,7 +271,7 @@ func TestClientPlay(t *testing.T) { require.Equal(t, base.Describe, req.Method) require.Equal(t, mustParseURL(scheme+"://"+listenIP+":8554/test/stream?param=value"), req.URL) - forma := &formats.Generic{ + forma := &format.Generic{ PayloadTyp: 96, RTPMa: "private/90000", } @@ -281,11 +281,11 @@ func TestClientPlay(t *testing.T) { medias := media.Medias{ &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, } resetMediaControls(medias) @@ -496,7 +496,7 @@ func TestClientPlay(t *testing.T) { err = c.SetupAll(medias, baseURL) require.NoError(t, err) - c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { require.Equal(t, &testRTPPacket, pkt) err := c.WritePacketRTCP(medi, &testRTCPPacket) require.NoError(t, err) @@ -547,7 +547,7 @@ func TestClientPlayPartial(t *testing.T) { require.Equal(t, base.Describe, req.Method) require.Equal(t, mustParseURL("rtsp://"+listenIP+":8554/teststream"), req.URL) - forma := &formats.Generic{ + forma := &format.Generic{ PayloadTyp: 96, RTPMa: "private/90000", } @@ -557,11 +557,11 @@ func TestClientPlayPartial(t *testing.T) { medias := media.Medias{ &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, } resetMediaControls(medias) @@ -652,7 +652,7 @@ func TestClientPlayPartial(t *testing.T) { _, err = c.Setup(medias[1], baseURL, 0, 0) require.NoError(t, err) - c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { require.Equal(t, medias[1], medi) require.Equal(t, medias[1].Formats[0], forma) require.Equal(t, &testRTPPacket, pkt) @@ -937,7 +937,7 @@ func TestClientPlayAnyPort(t *testing.T) { var med *media.Media err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { require.Equal(t, &testRTPPacket, pkt) med = medi close(packetRecv) @@ -1065,7 +1065,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(packetRecv) }) require.NoError(t, err) @@ -1245,7 +1245,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(packetRecv) }) require.NoError(t, err) @@ -1486,7 +1486,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) { } err = readAll(&c, "rtsp://myuser:mypass@localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(packetRecv) }) require.NoError(t, err) @@ -1609,7 +1609,7 @@ func TestClientPlayDifferentInterleavedIDs(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(packetRecv) }) require.NoError(t, err) @@ -1797,7 +1797,7 @@ func TestClientPlayRedirect(t *testing.T) { ru = "rtsp://testusr:testpwd@localhost:8554/path1" } err = readAll(&c, ru, - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(packetRecv) }) require.NoError(t, err) @@ -1999,7 +1999,7 @@ func TestClientPlayPause(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { if atomic.SwapInt32(&firstFrame, 1) == 0 { close(packetRecv) } @@ -2464,7 +2464,7 @@ func TestClientPlayIgnoreTCPInvalidMedia(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/teststream", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { close(recv) }) require.NoError(t, err) @@ -2877,7 +2877,7 @@ func TestClientPlayDifferentSource(t *testing.T) { } err = readAll(&c, "rtsp://localhost:8554/test/stream?param=value", - func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { require.Equal(t, &testRTPPacket, pkt) close(packetRecv) }) @@ -2941,7 +2941,7 @@ func TestClientPlayDecodeErrors(t *testing.T) { medias := media.Medias{&media.Media{ Type: media.TypeApplication, - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 97, RTPMa: "private/90000", }}, diff --git a/client_record_test.go b/client_record_test.go index e4668b02..473624b0 100644 --- a/client_record_test.go +++ b/client_record_test.go @@ -14,7 +14,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/base" "github.com/bluenviron/gortsplib/v4/pkg/conn" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/sdp" @@ -23,7 +23,7 @@ import ( var testH264Media = &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, SPS: []byte{0x01, 0x02, 0x03, 0x04}, PPS: []byte{0x01, 0x02, 0x03, 0x04}, diff --git a/examples/client-publish-format-g711/main.go b/examples/client-publish-format-g711/main.go index 52b61a79..d5c66796 100644 --- a/examples/client-publish-format-g711/main.go +++ b/examples/client-publish-format-g711/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { // create a media that contains a G711 format medi := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.G711{}}, + Formats: []format.Format{&format.G711{}}, } c := gortsplib.Client{} diff --git a/examples/client-publish-format-g722/main.go b/examples/client-publish-format-g722/main.go index 0de82422..d21d7ec9 100644 --- a/examples/client-publish-format-g722/main.go +++ b/examples/client-publish-format-g722/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { // create a media that contains a G722 format medi := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.G722{}}, + Formats: []format.Format{&format.G722{}}, } c := gortsplib.Client{} diff --git a/examples/client-publish-format-h264/main.go b/examples/client-publish-format-h264/main.go index 36bb4972..6f8de274 100644 --- a/examples/client-publish-format-h264/main.go +++ b/examples/client-publish-format-h264/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -40,7 +40,7 @@ func main() { // create a media that contains a H264 format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, PacketizationMode: 1, }}, diff --git a/examples/client-publish-format-h265/main.go b/examples/client-publish-format-h265/main.go index 6dae4239..20437569 100644 --- a/examples/client-publish-format-h265/main.go +++ b/examples/client-publish-format-h265/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -39,7 +39,7 @@ func main() { // create a media that contains a H265 format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H265{ + Formats: []format.Format{&format.H265{ PayloadTyp: 96, }}, } diff --git a/examples/client-publish-format-lpcm/main.go b/examples/client-publish-format-lpcm/main.go index b04c311a..6ef5159b 100644 --- a/examples/client-publish-format-lpcm/main.go +++ b/examples/client-publish-format-lpcm/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { // create a media that contains a LPCM format medi := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.LPCM{ + Formats: []format.Format{&format.LPCM{ PayloadTyp: 96, BitDepth: 16, SampleRate: 44100, diff --git a/examples/client-publish-format-mjpeg/main.go b/examples/client-publish-format-mjpeg/main.go index 76b4ec73..c9e30edb 100644 --- a/examples/client-publish-format-mjpeg/main.go +++ b/examples/client-publish-format-mjpeg/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { // create a media that contains a M-JPEG format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.MJPEG{}}, + Formats: []format.Format{&format.MJPEG{}}, } // connect to the server and start recording the media diff --git a/examples/client-publish-format-mpeg4audio/main.go b/examples/client-publish-format-mpeg4audio/main.go index 3251e616..fe2df99a 100644 --- a/examples/client-publish-format-mpeg4audio/main.go +++ b/examples/client-publish-format-mpeg4audio/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/pion/rtp" @@ -39,7 +39,7 @@ func main() { // create a media that contains a MPEG4-audio format medi := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.MPEG4Audio{ + Formats: []format.Format{&format.MPEG4Audio{ PayloadTyp: 96, Config: &mpeg4audio.Config{ Type: mpeg4audio.ObjectTypeAACLC, diff --git a/examples/client-publish-format-opus/main.go b/examples/client-publish-format-opus/main.go index 96cb9f2d..5cda7324 100644 --- a/examples/client-publish-format-opus/main.go +++ b/examples/client-publish-format-opus/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { // create a media that contains a Opus format medi := &media.Media{ Type: media.TypeAudio, - Formats: []formats.Format{&formats.Opus{ + Formats: []format.Format{&format.Opus{ PayloadTyp: 96, IsStereo: false, }}, diff --git a/examples/client-publish-format-vp8/main.go b/examples/client-publish-format-vp8/main.go index 7af3b102..ed2ad00e 100644 --- a/examples/client-publish-format-vp8/main.go +++ b/examples/client-publish-format-vp8/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -39,7 +39,7 @@ func main() { // create a media that contains a VP8 format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.VP8{ + Formats: []format.Format{&format.VP8{ PayloadTyp: 96, }}, } diff --git a/examples/client-publish-format-vp9/main.go b/examples/client-publish-format-vp9/main.go index 6e281d64..3ba463b7 100644 --- a/examples/client-publish-format-vp9/main.go +++ b/examples/client-publish-format-vp9/main.go @@ -5,7 +5,7 @@ import ( "net" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -39,7 +39,7 @@ func main() { // create a media that contains a VP9 format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.VP9{ + Formats: []format.Format{&format.VP9{ PayloadTyp: 96, }}, } diff --git a/examples/client-publish-options/main.go b/examples/client-publish-options/main.go index 9aabf2d3..d25f3699 100644 --- a/examples/client-publish-options/main.go +++ b/examples/client-publish-options/main.go @@ -6,7 +6,7 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -40,7 +40,7 @@ func main() { // create a media that contains a H264 media medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, PacketizationMode: 1, }}, diff --git a/examples/client-publish-pause/main.go b/examples/client-publish-pause/main.go index 75a148ce..54d2024a 100644 --- a/examples/client-publish-pause/main.go +++ b/examples/client-publish-pause/main.go @@ -6,7 +6,7 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/pion/rtp" ) @@ -41,7 +41,7 @@ func main() { // create a media that contains a H264 format medi := &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, PacketizationMode: 1, }}, diff --git a/examples/client-read-format-g711/main.go b/examples/client-read-format-g711/main.go index 83f54b9f..d4e40600 100644 --- a/examples/client-read-format-g711/main.go +++ b/examples/client-read-format-g711/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the G711 media and format - var forma *formats.G711 + var forma *format.G711 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-g722/main.go b/examples/client-read-format-g722/main.go index b08837f1..0fd07716 100644 --- a/examples/client-read-format-g722/main.go +++ b/examples/client-read-format-g722/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the G722 media and format - var forma *formats.G722 + var forma *format.G722 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-h264-convert-to-jpeg/main.go b/examples/client-read-format-h264-convert-to-jpeg/main.go index 06f4dc7f..b70b2c4e 100644 --- a/examples/client-read-format-h264-convert-to-jpeg/main.go +++ b/examples/client-read-format-h264-convert-to-jpeg/main.go @@ -9,8 +9,8 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph264" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -64,7 +64,7 @@ func main() { } // find the H264 media and format - var forma *formats.H264 + var forma *format.H264 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-h264-save-to-disk/main.go b/examples/client-read-format-h264-save-to-disk/main.go index 487f7660..0307a4ed 100644 --- a/examples/client-read-format-h264-save-to-disk/main.go +++ b/examples/client-read-format-h264-save-to-disk/main.go @@ -4,8 +4,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph264" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { } // find the H264 media and format - var forma *formats.H264 + var forma *format.H264 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-h264/main.go b/examples/client-read-format-h264/main.go index 9fe4a0f7..a562fd2f 100644 --- a/examples/client-read-format-h264/main.go +++ b/examples/client-read-format-h264/main.go @@ -4,8 +4,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph264" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -41,7 +41,7 @@ func main() { } // find the H264 media and format - var forma *formats.H264 + var forma *format.H264 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-h265/main.go b/examples/client-read-format-h265/main.go index 8a607f58..6e494082 100644 --- a/examples/client-read-format-h265/main.go +++ b/examples/client-read-format-h265/main.go @@ -4,8 +4,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph265" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph265" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { } // find the H265 media and format - var forma *formats.H265 + var forma *format.H265 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-lpcm/main.go b/examples/client-read-format-lpcm/main.go index c1dc51d6..b1fc83a5 100644 --- a/examples/client-read-format-lpcm/main.go +++ b/examples/client-read-format-lpcm/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the LPCM media and format - var forma *formats.LPCM + var forma *format.LPCM medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-mjpeg/main.go b/examples/client-read-format-mjpeg/main.go index 8a8ca8c2..fb8f4497 100644 --- a/examples/client-read-format-mjpeg/main.go +++ b/examples/client-read-format-mjpeg/main.go @@ -6,8 +6,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmjpeg" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmjpeg" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -41,7 +41,7 @@ func main() { } // find the M-JPEG media and format - var forma *formats.MJPEG + var forma *format.MJPEG medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-mpeg4audio-save-to-disk/main.go b/examples/client-read-format-mpeg4audio-save-to-disk/main.go index 2ce5072c..5d9a6c8f 100644 --- a/examples/client-read-format-mpeg4audio-save-to-disk/main.go +++ b/examples/client-read-format-mpeg4audio-save-to-disk/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the MPEG4-audio media and format - var forma *formats.MPEG4Audio + var forma *format.MPEG4Audio medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-mpeg4audio/main.go b/examples/client-read-format-mpeg4audio/main.go index 24e373b0..6520ccaa 100644 --- a/examples/client-read-format-mpeg4audio/main.go +++ b/examples/client-read-format-mpeg4audio/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the MPEG4-audio media and format - var forma *formats.MPEG4Audio + var forma *format.MPEG4Audio medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-opus/main.go b/examples/client-read-format-opus/main.go index 8ed829a1..350f5aa0 100644 --- a/examples/client-read-format-opus/main.go +++ b/examples/client-read-format-opus/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -37,7 +37,7 @@ func main() { } // find the Opus media and format - var forma *formats.Opus + var forma *format.Opus medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-vp8/main.go b/examples/client-read-format-vp8/main.go index 0089d21a..8b29a5ab 100644 --- a/examples/client-read-format-vp8/main.go +++ b/examples/client-read-format-vp8/main.go @@ -4,8 +4,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpvp8" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp8" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { } // find the VP8 media and format - var forma *formats.VP8 + var forma *format.VP8 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-format-vp9/main.go b/examples/client-read-format-vp9/main.go index 53daa8b7..da894a3e 100644 --- a/examples/client-read-format-vp9/main.go +++ b/examples/client-read-format-vp9/main.go @@ -4,8 +4,8 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpvp9" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp9" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" ) @@ -38,7 +38,7 @@ func main() { } // find the VP9 media and format - var forma *formats.VP9 + var forma *format.VP9 medi := medias.FindFormat(&forma) if medi == nil { panic("media not found") diff --git a/examples/client-read-options/main.go b/examples/client-read-options/main.go index 48263e66..15caaa72 100644 --- a/examples/client-read-options/main.go +++ b/examples/client-read-options/main.go @@ -5,7 +5,7 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtcp" @@ -53,7 +53,7 @@ func main() { } // called when a RTP packet arrives - c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { log.Printf("RTP packet from media %v\n", medi) }) diff --git a/examples/client-read-pause/main.go b/examples/client-read-pause/main.go index 083bd1fb..a22b41c8 100644 --- a/examples/client-read-pause/main.go +++ b/examples/client-read-pause/main.go @@ -5,7 +5,7 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtcp" @@ -47,7 +47,7 @@ func main() { } // called when a RTP packet arrives - c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { log.Printf("RTP packet from media %v\n", medi) }) diff --git a/examples/client-read-republish/main.go b/examples/client-read-republish/main.go index 41f0bdb4..45d3dc08 100644 --- a/examples/client-read-republish/main.go +++ b/examples/client-read-republish/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" @@ -54,7 +54,7 @@ func main() { defer publisher.Close() // read RTP packets from the reader and route them to the publisher - reader.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + reader.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { publisher.WritePacketRTP(medi, pkt) }) diff --git a/examples/client-read/main.go b/examples/client-read/main.go index f151332f..bfd87ed2 100644 --- a/examples/client-read/main.go +++ b/examples/client-read/main.go @@ -4,7 +4,7 @@ import ( "log" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtcp" @@ -44,7 +44,7 @@ func main() { } // called when a RTP packet arrives - c.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + c.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { log.Printf("RTP packet from media %v\n", medi) }) diff --git a/examples/proxy/client.go b/examples/proxy/client.go index e8dc24f9..ea0a3938 100644 --- a/examples/proxy/client.go +++ b/examples/proxy/client.go @@ -5,7 +5,7 @@ import ( "time" "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/url" "github.com/pion/rtp" @@ -74,7 +74,7 @@ func (c *client) read() error { log.Printf("stream is ready and can be read from the server at rtsp://localhost:8554/stream\n") // called when a RTP packet arrives - rc.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + rc.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { // route incoming packets to the server stream stream.WritePacketRTP(medi, pkt) }) diff --git a/examples/server-h264-save-to-disk/main.go b/examples/server-h264-save-to-disk/main.go index 8ebd2fc6..23490229 100644 --- a/examples/server-h264-save-to-disk/main.go +++ b/examples/server-h264-save-to-disk/main.go @@ -9,8 +9,8 @@ import ( "github.com/bluenviron/gortsplib/v4" "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/formats" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph264" + "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" "github.com/bluenviron/gortsplib/v4/pkg/media" ) @@ -23,7 +23,7 @@ type serverHandler struct { mutex sync.Mutex publisher *gortsplib.ServerSession media *media.Media - format *formats.H264 + format *format.H264 rtpDec *rtph264.Decoder mpegtsMuxer *mpegtsMuxer } @@ -67,7 +67,7 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) ( } // find the H264 media and format - var forma *formats.H264 + var forma *format.H264 medi := ctx.Medias.FindFormat(&forma) if medi == nil { return &base.Response{ diff --git a/examples/server-tls/main.go b/examples/server-tls/main.go index 4326e4f1..bcc971c2 100644 --- a/examples/server-tls/main.go +++ b/examples/server-tls/main.go @@ -9,7 +9,7 @@ import ( "github.com/bluenviron/gortsplib/v4" "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" ) @@ -127,7 +127,7 @@ func (sh *serverHandler) OnRecord(ctx *gortsplib.ServerHandlerOnRecordCtx) (*bas log.Printf("record request") // called when receiving a RTP packet - ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { // route the RTP packet to all readers sh.stream.WritePacketRTP(medi, pkt) }) diff --git a/examples/server/main.go b/examples/server/main.go index dfcbc434..e4df20c2 100644 --- a/examples/server/main.go +++ b/examples/server/main.go @@ -8,7 +8,7 @@ import ( "github.com/bluenviron/gortsplib/v4" "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" ) @@ -126,7 +126,7 @@ func (sh *serverHandler) OnRecord(ctx *gortsplib.ServerHandlerOnRecordCtx) (*bas log.Printf("record request") // called when receiving a RTP packet - ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { // route the RTP packet to all readers sh.stream.WritePacketRTP(medi, pkt) }) diff --git a/internal/highleveltests/server_test.go b/internal/highleveltests/server_test.go index f878f924..a7a5b484 100644 --- a/internal/highleveltests/server_test.go +++ b/internal/highleveltests/server_test.go @@ -19,7 +19,7 @@ import ( "github.com/bluenviron/gortsplib/v4" "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/media" ) @@ -386,7 +386,7 @@ func TestServerRecordRead(t *testing.T) { }, fmt.Errorf("invalid query (%s)", ctx.Query) } - ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma formats.Format, pkt *rtp.Packet) { + ctx.Session.OnPacketRTPAny(func(medi *media.Media, forma format.Format, pkt *rtp.Packet) { stream.WritePacketRTP(medi, pkt) }) diff --git a/pkg/formats/av1.go b/pkg/format/av1.go similarity index 96% rename from pkg/formats/av1.go rename to pkg/format/av1.go index 7cf8911e..0916ba19 100644 --- a/pkg/formats/av1.go +++ b/pkg/format/av1.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "fmt" @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpav1" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpav1" ) // AV1 is a RTP format for the AV1 codec. diff --git a/pkg/formats/av1_test.go b/pkg/format/av1_test.go similarity index 96% rename from pkg/formats/av1_test.go rename to pkg/format/av1_test.go index 9f673fd1..b3dfa8c3 100644 --- a/pkg/formats/av1_test.go +++ b/pkg/format/av1_test.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "testing" diff --git a/pkg/formats/format.go b/pkg/format/format.go similarity index 96% rename from pkg/formats/format.go rename to pkg/format/format.go index 8e475a89..5690a51f 100644 --- a/pkg/formats/format.go +++ b/pkg/format/format.go @@ -1,5 +1,5 @@ -// Package formats contains RTP format definitions, decoders and encoders. -package formats +// Package format contains RTP format definitions, decoders and encoders. +package format import ( "strings" diff --git a/pkg/formats/format_test.go b/pkg/format/format_test.go similarity index 99% rename from pkg/formats/format_test.go rename to pkg/format/format_test.go index f6259d13..d51202d5 100644 --- a/pkg/formats/format_test.go +++ b/pkg/format/format_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/g711.go b/pkg/format/g711.go similarity index 95% rename from pkg/formats/g711.go rename to pkg/format/g711.go index ef595c80..cd34c539 100644 --- a/pkg/formats/g711.go +++ b/pkg/format/g711.go @@ -1,9 +1,9 @@ -package formats +package format import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpsimpleaudio" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpsimpleaudio" ) // G711 is a RTP format for the G711 codec, encoded with mu-law or A-law. diff --git a/pkg/formats/g711_test.go b/pkg/format/g711_test.go similarity index 98% rename from pkg/formats/g711_test.go rename to pkg/format/g711_test.go index 979f7c05..abdd1958 100644 --- a/pkg/formats/g711_test.go +++ b/pkg/format/g711_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/g722.go b/pkg/format/g722.go similarity index 94% rename from pkg/formats/g722.go rename to pkg/format/g722.go index 70efb8be..7a71725c 100644 --- a/pkg/formats/g722.go +++ b/pkg/format/g722.go @@ -1,9 +1,9 @@ -package formats +package format import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpsimpleaudio" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpsimpleaudio" ) // G722 is a RTP format for the G722 codec. diff --git a/pkg/formats/g722_test.go b/pkg/format/g722_test.go similarity index 97% rename from pkg/formats/g722_test.go rename to pkg/format/g722_test.go index f3c5a513..1c6cfb4f 100644 --- a/pkg/formats/g722_test.go +++ b/pkg/format/g722_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/g726.go b/pkg/format/g726.go similarity index 98% rename from pkg/formats/g726.go rename to pkg/format/g726.go index c0028c52..cec444ac 100644 --- a/pkg/formats/g726.go +++ b/pkg/format/g726.go @@ -1,4 +1,4 @@ -package formats +package format import ( "strconv" diff --git a/pkg/formats/g726_test.go b/pkg/format/g726_test.go similarity index 94% rename from pkg/formats/g726_test.go rename to pkg/format/g726_test.go index afee52d7..347f9acc 100644 --- a/pkg/formats/g726_test.go +++ b/pkg/format/g726_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/generic.go b/pkg/format/generic.go similarity index 99% rename from pkg/formats/generic.go rename to pkg/format/generic.go index 74d338b2..fe827550 100644 --- a/pkg/formats/generic.go +++ b/pkg/format/generic.go @@ -1,4 +1,4 @@ -package formats +package format import ( "fmt" diff --git a/pkg/formats/generic_test.go b/pkg/format/generic_test.go similarity index 97% rename from pkg/formats/generic_test.go rename to pkg/format/generic_test.go index 1c727637..abd3a72c 100644 --- a/pkg/formats/generic_test.go +++ b/pkg/format/generic_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/h264.go b/pkg/format/h264.go similarity index 98% rename from pkg/formats/h264.go rename to pkg/format/h264.go index b8655703..d59d3d2a 100644 --- a/pkg/formats/h264.go +++ b/pkg/format/h264.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/base64" @@ -10,7 +10,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph264" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" "github.com/bluenviron/mediacommon/pkg/codecs/h264" ) diff --git a/pkg/formats/h264_test.go b/pkg/format/h264_test.go similarity index 98% rename from pkg/formats/h264_test.go rename to pkg/format/h264_test.go index b0000643..b89d3826 100644 --- a/pkg/formats/h264_test.go +++ b/pkg/format/h264_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/h265.go b/pkg/format/h265.go similarity index 98% rename from pkg/formats/h265.go rename to pkg/format/h265.go index 99ebea0d..0d3232a9 100644 --- a/pkg/formats/h265.go +++ b/pkg/format/h265.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/base64" @@ -9,7 +9,7 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/h265" "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtph265" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtph265" ) // H265 is a RTP format for the H265 codec. diff --git a/pkg/formats/h265_test.go b/pkg/format/h265_test.go similarity index 99% rename from pkg/formats/h265_test.go rename to pkg/format/h265_test.go index 577104c9..38e19f28 100644 --- a/pkg/formats/h265_test.go +++ b/pkg/format/h265_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/lpcm.go b/pkg/format/lpcm.go similarity index 96% rename from pkg/formats/lpcm.go rename to pkg/format/lpcm.go index 3f5c9aaa..01d10e42 100644 --- a/pkg/formats/lpcm.go +++ b/pkg/format/lpcm.go @@ -1,4 +1,4 @@ -package formats +package format import ( "strconv" @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtplpcm" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtplpcm" ) // LPCM is a RTP format for the uncompressed, Linear PCM codec. diff --git a/pkg/formats/lpcm_test.go b/pkg/format/lpcm_test.go similarity index 98% rename from pkg/formats/lpcm_test.go rename to pkg/format/lpcm_test.go index 4a40fb2a..7ad18bd0 100644 --- a/pkg/formats/lpcm_test.go +++ b/pkg/format/lpcm_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mjpeg.go b/pkg/format/mjpeg.go similarity index 93% rename from pkg/formats/mjpeg.go rename to pkg/format/mjpeg.go index 8296acf3..1b344465 100644 --- a/pkg/formats/mjpeg.go +++ b/pkg/format/mjpeg.go @@ -1,9 +1,9 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmjpeg" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmjpeg" ) // MJPEG is a RTP format for the Motion-JPEG codec. diff --git a/pkg/formats/mjpeg_test.go b/pkg/format/mjpeg_test.go similarity index 99% rename from pkg/formats/mjpeg_test.go rename to pkg/format/mjpeg_test.go index 7e1c9ed4..b53914a9 100644 --- a/pkg/formats/mjpeg_test.go +++ b/pkg/format/mjpeg_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mpeg1_audio.go b/pkg/format/mpeg1_audio.go similarity index 93% rename from pkg/formats/mpeg1_audio.go rename to pkg/format/mpeg1_audio.go index 6e9e87cb..ec57a45c 100644 --- a/pkg/formats/mpeg1_audio.go +++ b/pkg/format/mpeg1_audio.go @@ -1,9 +1,9 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg1audio" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg1audio" ) // MPEG1Audio is a RTP format for a MPEG-1/2 Audio codec. diff --git a/pkg/formats/mpeg1_audio_test.go b/pkg/format/mpeg1_audio_test.go similarity index 99% rename from pkg/formats/mpeg1_audio_test.go rename to pkg/format/mpeg1_audio_test.go index bc1fd88a..57e50ad6 100644 --- a/pkg/formats/mpeg1_audio_test.go +++ b/pkg/format/mpeg1_audio_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mpeg1_video.go b/pkg/format/mpeg1_video.go similarity index 96% rename from pkg/formats/mpeg1_video.go rename to pkg/format/mpeg1_video.go index 1e861446..ee9ac0e5 100644 --- a/pkg/formats/mpeg1_video.go +++ b/pkg/format/mpeg1_video.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "github.com/pion/rtp" diff --git a/pkg/formats/mpeg1_video_test.go b/pkg/format/mpeg1_video_test.go similarity index 95% rename from pkg/formats/mpeg1_video_test.go rename to pkg/format/mpeg1_video_test.go index ee85fbbf..90634bc7 100644 --- a/pkg/formats/mpeg1_video_test.go +++ b/pkg/format/mpeg1_video_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mpeg4_audio_generic.go b/pkg/format/mpeg4_audio_generic.go similarity index 98% rename from pkg/formats/mpeg4_audio_generic.go rename to pkg/format/mpeg4_audio_generic.go index 29728e38..1452970a 100644 --- a/pkg/formats/mpeg4_audio_generic.go +++ b/pkg/format/mpeg4_audio_generic.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/hex" @@ -9,7 +9,7 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg4audio" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audio" ) // MPEG4Audio is an alias for MPEG4AudioGeneric. diff --git a/pkg/formats/mpeg4_audio_generic_test.go b/pkg/format/mpeg4_audio_generic_test.go similarity index 98% rename from pkg/formats/mpeg4_audio_generic_test.go rename to pkg/format/mpeg4_audio_generic_test.go index 024019d1..5f1f6a5a 100644 --- a/pkg/formats/mpeg4_audio_generic_test.go +++ b/pkg/format/mpeg4_audio_generic_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mpeg4_audio_latm.go b/pkg/format/mpeg4_audio_latm.go similarity index 97% rename from pkg/formats/mpeg4_audio_latm.go rename to pkg/format/mpeg4_audio_latm.go index c2fa49a3..8c97fec9 100644 --- a/pkg/formats/mpeg4_audio_latm.go +++ b/pkg/format/mpeg4_audio_latm.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/hex" @@ -8,7 +8,7 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg4audiolatm" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audiolatm" ) // MPEG4AudioLATM is a RTP format for a MPEG-4 Audio codec. diff --git a/pkg/formats/mpeg4_audio_latm_test.go b/pkg/format/mpeg4_audio_latm_test.go similarity index 98% rename from pkg/formats/mpeg4_audio_latm_test.go rename to pkg/format/mpeg4_audio_latm_test.go index 79d2c639..a5e16e56 100644 --- a/pkg/formats/mpeg4_audio_latm_test.go +++ b/pkg/format/mpeg4_audio_latm_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/mpeg4_video_es.go b/pkg/format/mpeg4_video_es.go similarity index 96% rename from pkg/formats/mpeg4_video_es.go rename to pkg/format/mpeg4_video_es.go index a69efad8..8cd477ea 100644 --- a/pkg/formats/mpeg4_video_es.go +++ b/pkg/format/mpeg4_video_es.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/hex" @@ -8,7 +8,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg4video" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4video" ) // MPEG4Video is an alias for MPEG4VideoES. diff --git a/pkg/formats/mpeg4_video_es_test.go b/pkg/format/mpeg4_video_es_test.go similarity index 98% rename from pkg/formats/mpeg4_video_es_test.go rename to pkg/format/mpeg4_video_es_test.go index 93cf53c8..c017273a 100644 --- a/pkg/formats/mpeg4_video_es_test.go +++ b/pkg/format/mpeg4_video_es_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/format/mpeg4_video_generic.go b/pkg/format/mpeg4_video_generic.go new file mode 100644 index 00000000..478f94ad --- /dev/null +++ b/pkg/format/mpeg4_video_generic.go @@ -0,0 +1,3 @@ +package format + +// TODO diff --git a/pkg/format/mpeg4_video_generic_test.go b/pkg/format/mpeg4_video_generic_test.go new file mode 100644 index 00000000..478f94ad --- /dev/null +++ b/pkg/format/mpeg4_video_generic_test.go @@ -0,0 +1,3 @@ +package format + +// TODO diff --git a/pkg/formats/mpegts.go b/pkg/format/mpegts.go similarity index 96% rename from pkg/formats/mpegts.go rename to pkg/format/mpegts.go index 2050edcb..124c6573 100644 --- a/pkg/formats/mpegts.go +++ b/pkg/format/mpegts.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "github.com/pion/rtp" diff --git a/pkg/formats/mpegts_test.go b/pkg/format/mpegts_test.go similarity index 94% rename from pkg/formats/mpegts_test.go rename to pkg/format/mpegts_test.go index e257cb7f..3d792652 100644 --- a/pkg/formats/mpegts_test.go +++ b/pkg/format/mpegts_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/opus.go b/pkg/format/opus.go similarity index 96% rename from pkg/formats/opus.go rename to pkg/format/opus.go index b73f1be6..745bc7f2 100644 --- a/pkg/formats/opus.go +++ b/pkg/format/opus.go @@ -1,4 +1,4 @@ -package formats +package format import ( "fmt" @@ -7,7 +7,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpsimpleaudio" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpsimpleaudio" ) // Opus is a RTP format for the Opus codec. diff --git a/pkg/formats/opus_test.go b/pkg/format/opus_test.go similarity index 97% rename from pkg/formats/opus_test.go rename to pkg/format/opus_test.go index 3f6b9967..01f66e69 100644 --- a/pkg/formats/opus_test.go +++ b/pkg/format/opus_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/rtpav1/decoder.go b/pkg/format/rtpav1/decoder.go similarity index 100% rename from pkg/formats/rtpav1/decoder.go rename to pkg/format/rtpav1/decoder.go diff --git a/pkg/formats/rtpav1/decoder_test.go b/pkg/format/rtpav1/decoder_test.go similarity index 100% rename from pkg/formats/rtpav1/decoder_test.go rename to pkg/format/rtpav1/decoder_test.go diff --git a/pkg/formats/rtpav1/encoder.go b/pkg/format/rtpav1/encoder.go similarity index 100% rename from pkg/formats/rtpav1/encoder.go rename to pkg/format/rtpav1/encoder.go diff --git a/pkg/formats/rtpav1/encoder_test.go b/pkg/format/rtpav1/encoder_test.go similarity index 100% rename from pkg/formats/rtpav1/encoder_test.go rename to pkg/format/rtpav1/encoder_test.go diff --git a/pkg/formats/rtpav1/rtpav1.go b/pkg/format/rtpav1/rtpav1.go similarity index 100% rename from pkg/formats/rtpav1/rtpav1.go rename to pkg/format/rtpav1/rtpav1.go diff --git a/pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/079a435e5445c35b b/pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/079a435e5445c35b similarity index 100% rename from pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/079a435e5445c35b rename to pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/079a435e5445c35b diff --git a/pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/1bcf1d62b055a123 b/pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/1bcf1d62b055a123 similarity index 100% rename from pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/1bcf1d62b055a123 rename to pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/1bcf1d62b055a123 diff --git a/pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/894f7b51b885dbb1 b/pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/894f7b51b885dbb1 similarity index 100% rename from pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/894f7b51b885dbb1 rename to pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/894f7b51b885dbb1 diff --git a/pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/bf1e5b208e57f701 b/pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/bf1e5b208e57f701 similarity index 100% rename from pkg/formats/rtpav1/testdata/fuzz/FuzzDecoder/bf1e5b208e57f701 rename to pkg/format/rtpav1/testdata/fuzz/FuzzDecoder/bf1e5b208e57f701 diff --git a/pkg/formats/rtph264/decoder.go b/pkg/format/rtph264/decoder.go similarity index 100% rename from pkg/formats/rtph264/decoder.go rename to pkg/format/rtph264/decoder.go diff --git a/pkg/formats/rtph264/decoder_test.go b/pkg/format/rtph264/decoder_test.go similarity index 100% rename from pkg/formats/rtph264/decoder_test.go rename to pkg/format/rtph264/decoder_test.go diff --git a/pkg/formats/rtph264/encoder.go b/pkg/format/rtph264/encoder.go similarity index 100% rename from pkg/formats/rtph264/encoder.go rename to pkg/format/rtph264/encoder.go diff --git a/pkg/formats/rtph264/encoder_test.go b/pkg/format/rtph264/encoder_test.go similarity index 100% rename from pkg/formats/rtph264/encoder_test.go rename to pkg/format/rtph264/encoder_test.go diff --git a/pkg/formats/rtph264/rtph264.go b/pkg/format/rtph264/rtph264.go similarity index 100% rename from pkg/formats/rtph264/rtph264.go rename to pkg/format/rtph264/rtph264.go diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/11dca3ad0def7057 b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/11dca3ad0def7057 similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/11dca3ad0def7057 rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/11dca3ad0def7057 diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/60892a24d67609fc b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/60892a24d67609fc similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/60892a24d67609fc rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/60892a24d67609fc diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/9b4d0ab6bd98d3a9 diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/ecf7d0b7f06fcc4a b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/ecf7d0b7f06fcc4a similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/ecf7d0b7f06fcc4a rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/ecf7d0b7f06fcc4a diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/edbcdbb8d9f1bdac diff --git a/pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/ef62dc47a38f1a39 b/pkg/format/rtph264/testdata/fuzz/FuzzDecoder/ef62dc47a38f1a39 similarity index 100% rename from pkg/formats/rtph264/testdata/fuzz/FuzzDecoder/ef62dc47a38f1a39 rename to pkg/format/rtph264/testdata/fuzz/FuzzDecoder/ef62dc47a38f1a39 diff --git a/pkg/formats/rtph265/decoder.go b/pkg/format/rtph265/decoder.go similarity index 100% rename from pkg/formats/rtph265/decoder.go rename to pkg/format/rtph265/decoder.go diff --git a/pkg/formats/rtph265/decoder_test.go b/pkg/format/rtph265/decoder_test.go similarity index 100% rename from pkg/formats/rtph265/decoder_test.go rename to pkg/format/rtph265/decoder_test.go diff --git a/pkg/formats/rtph265/encoder.go b/pkg/format/rtph265/encoder.go similarity index 100% rename from pkg/formats/rtph265/encoder.go rename to pkg/format/rtph265/encoder.go diff --git a/pkg/formats/rtph265/encoder_test.go b/pkg/format/rtph265/encoder_test.go similarity index 100% rename from pkg/formats/rtph265/encoder_test.go rename to pkg/format/rtph265/encoder_test.go diff --git a/pkg/formats/rtph265/rtph265.go b/pkg/format/rtph265/rtph265.go similarity index 100% rename from pkg/formats/rtph265/rtph265.go rename to pkg/format/rtph265/rtph265.go diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/25f2b139d5d03b01 b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/25f2b139d5d03b01 similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/25f2b139d5d03b01 rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/25f2b139d5d03b01 diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/2d69a60004f3edfd b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/2d69a60004f3edfd similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/2d69a60004f3edfd rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/2d69a60004f3edfd diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/5cedd25e23c9f9aa b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/5cedd25e23c9f9aa similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/5cedd25e23c9f9aa rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/5cedd25e23c9f9aa diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/717a02ebf21c41db diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/84ed65595ad05a58 diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/95e634df087d6476 b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/95e634df087d6476 similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/95e634df087d6476 rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/95e634df087d6476 diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8 b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8 similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8 rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/a7fab38f1f1629f8 diff --git a/pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/e807a721f4e89fcb b/pkg/format/rtph265/testdata/fuzz/FuzzDecoder/e807a721f4e89fcb similarity index 100% rename from pkg/formats/rtph265/testdata/fuzz/FuzzDecoder/e807a721f4e89fcb rename to pkg/format/rtph265/testdata/fuzz/FuzzDecoder/e807a721f4e89fcb diff --git a/pkg/formats/rtplpcm/decoder.go b/pkg/format/rtplpcm/decoder.go similarity index 100% rename from pkg/formats/rtplpcm/decoder.go rename to pkg/format/rtplpcm/decoder.go diff --git a/pkg/formats/rtplpcm/decoder_test.go b/pkg/format/rtplpcm/decoder_test.go similarity index 100% rename from pkg/formats/rtplpcm/decoder_test.go rename to pkg/format/rtplpcm/decoder_test.go diff --git a/pkg/formats/rtplpcm/encoder.go b/pkg/format/rtplpcm/encoder.go similarity index 100% rename from pkg/formats/rtplpcm/encoder.go rename to pkg/format/rtplpcm/encoder.go diff --git a/pkg/formats/rtplpcm/encoder_test.go b/pkg/format/rtplpcm/encoder_test.go similarity index 100% rename from pkg/formats/rtplpcm/encoder_test.go rename to pkg/format/rtplpcm/encoder_test.go diff --git a/pkg/formats/rtplpcm/rtplpcm.go b/pkg/format/rtplpcm/rtplpcm.go similarity index 100% rename from pkg/formats/rtplpcm/rtplpcm.go rename to pkg/format/rtplpcm/rtplpcm.go diff --git a/pkg/formats/rtplpcm/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 b/pkg/format/rtplpcm/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 similarity index 100% rename from pkg/formats/rtplpcm/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 rename to pkg/format/rtplpcm/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 diff --git a/pkg/formats/rtpmjpeg/decoder.go b/pkg/format/rtpmjpeg/decoder.go similarity index 100% rename from pkg/formats/rtpmjpeg/decoder.go rename to pkg/format/rtpmjpeg/decoder.go diff --git a/pkg/formats/rtpmjpeg/decoder_test.go b/pkg/format/rtpmjpeg/decoder_test.go similarity index 100% rename from pkg/formats/rtpmjpeg/decoder_test.go rename to pkg/format/rtpmjpeg/decoder_test.go diff --git a/pkg/formats/rtpmjpeg/encoder.go b/pkg/format/rtpmjpeg/encoder.go similarity index 100% rename from pkg/formats/rtpmjpeg/encoder.go rename to pkg/format/rtpmjpeg/encoder.go diff --git a/pkg/formats/rtpmjpeg/encoder_test.go b/pkg/format/rtpmjpeg/encoder_test.go similarity index 100% rename from pkg/formats/rtpmjpeg/encoder_test.go rename to pkg/format/rtpmjpeg/encoder_test.go diff --git a/pkg/formats/rtpmjpeg/header_jpeg.go b/pkg/format/rtpmjpeg/header_jpeg.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_jpeg.go rename to pkg/format/rtpmjpeg/header_jpeg.go diff --git a/pkg/formats/rtpmjpeg/header_jpeg_test.go b/pkg/format/rtpmjpeg/header_jpeg_test.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_jpeg_test.go rename to pkg/format/rtpmjpeg/header_jpeg_test.go diff --git a/pkg/formats/rtpmjpeg/header_quantization_table.go b/pkg/format/rtpmjpeg/header_quantization_table.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_quantization_table.go rename to pkg/format/rtpmjpeg/header_quantization_table.go diff --git a/pkg/formats/rtpmjpeg/header_quantization_table_test.go b/pkg/format/rtpmjpeg/header_quantization_table_test.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_quantization_table_test.go rename to pkg/format/rtpmjpeg/header_quantization_table_test.go diff --git a/pkg/formats/rtpmjpeg/header_restart_marker.go b/pkg/format/rtpmjpeg/header_restart_marker.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_restart_marker.go rename to pkg/format/rtpmjpeg/header_restart_marker.go diff --git a/pkg/formats/rtpmjpeg/header_restart_marker_test.go b/pkg/format/rtpmjpeg/header_restart_marker_test.go similarity index 100% rename from pkg/formats/rtpmjpeg/header_restart_marker_test.go rename to pkg/format/rtpmjpeg/header_restart_marker_test.go diff --git a/pkg/formats/rtpmjpeg/rtpmjpeg.go b/pkg/format/rtpmjpeg/rtpmjpeg.go similarity index 100% rename from pkg/formats/rtpmjpeg/rtpmjpeg.go rename to pkg/format/rtpmjpeg/rtpmjpeg.go diff --git a/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660 b/pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660 similarity index 100% rename from pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660 rename to pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/5c3e3cea6fcbf660 diff --git a/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/8b8df3a54310aad8 b/pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/8b8df3a54310aad8 similarity index 100% rename from pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/8b8df3a54310aad8 rename to pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/8b8df3a54310aad8 diff --git a/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/acf99ee7fd60497d b/pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/acf99ee7fd60497d similarity index 100% rename from pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/acf99ee7fd60497d rename to pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/acf99ee7fd60497d diff --git a/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e b/pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e similarity index 100% rename from pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e rename to pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/c582eb998d5b265e diff --git a/pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa b/pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa similarity index 100% rename from pkg/formats/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa rename to pkg/format/rtpmjpeg/testdata/fuzz/FuzzDecoder/f1b261959da64dfa diff --git a/pkg/formats/rtpmpeg1audio/decoder.go b/pkg/format/rtpmpeg1audio/decoder.go similarity index 100% rename from pkg/formats/rtpmpeg1audio/decoder.go rename to pkg/format/rtpmpeg1audio/decoder.go diff --git a/pkg/formats/rtpmpeg1audio/decoder_test.go b/pkg/format/rtpmpeg1audio/decoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg1audio/decoder_test.go rename to pkg/format/rtpmpeg1audio/decoder_test.go diff --git a/pkg/formats/rtpmpeg1audio/encoder.go b/pkg/format/rtpmpeg1audio/encoder.go similarity index 100% rename from pkg/formats/rtpmpeg1audio/encoder.go rename to pkg/format/rtpmpeg1audio/encoder.go diff --git a/pkg/formats/rtpmpeg1audio/encoder_test.go b/pkg/format/rtpmpeg1audio/encoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg1audio/encoder_test.go rename to pkg/format/rtpmpeg1audio/encoder_test.go diff --git a/pkg/formats/rtpmpeg1audio/rtpmpeg1audio.go b/pkg/format/rtpmpeg1audio/rtpmpeg1audio.go similarity index 100% rename from pkg/formats/rtpmpeg1audio/rtpmpeg1audio.go rename to pkg/format/rtpmpeg1audio/rtpmpeg1audio.go diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/035c6218e0188ec4 b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/035c6218e0188ec4 similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/035c6218e0188ec4 rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/035c6218e0188ec4 diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/0d51e18d32a6771a b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/0d51e18d32a6771a similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/0d51e18d32a6771a rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/0d51e18d32a6771a diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/2dcc1140d95305bd b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/2dcc1140d95305bd similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/2dcc1140d95305bd rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/2dcc1140d95305bd diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/30bd4b8733a5f13f b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/30bd4b8733a5f13f similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/30bd4b8733a5f13f rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/30bd4b8733a5f13f diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/c1623732f13f642e b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/c1623732f13f642e similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/c1623732f13f642e rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/c1623732f13f642e diff --git a/pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/cf7295b77ea49fed b/pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/cf7295b77ea49fed similarity index 100% rename from pkg/formats/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/cf7295b77ea49fed rename to pkg/format/rtpmpeg1audio/testdata/fuzz/FuzzDecoder/cf7295b77ea49fed diff --git a/pkg/formats/rtpmpeg4audio/decoder.go b/pkg/format/rtpmpeg4audio/decoder.go similarity index 80% rename from pkg/formats/rtpmpeg4audio/decoder.go rename to pkg/format/rtpmpeg4audio/decoder.go index 7299501c..4ee73a17 100644 --- a/pkg/formats/rtpmpeg4audio/decoder.go +++ b/pkg/format/rtpmpeg4audio/decoder.go @@ -3,7 +3,7 @@ package rtpmpeg4audio import ( "errors" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg4audiogeneric" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audiogeneric" ) // ErrMorePacketsNeeded is an alis for rtpmpeg4audiogeneric.ErrMorePacketsNeeded. diff --git a/pkg/formats/rtpmpeg4audio/encoder.go b/pkg/format/rtpmpeg4audio/encoder.go similarity index 65% rename from pkg/formats/rtpmpeg4audio/encoder.go rename to pkg/format/rtpmpeg4audio/encoder.go index c42c1861..57597cc1 100644 --- a/pkg/formats/rtpmpeg4audio/encoder.go +++ b/pkg/format/rtpmpeg4audio/encoder.go @@ -1,7 +1,7 @@ package rtpmpeg4audio import ( - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpmpeg4audiogeneric" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audiogeneric" ) // Encoder is an alias for rtpmpeg4audiogeneric.Encoder. diff --git a/pkg/formats/rtpmpeg4audio/rtpmpeg4audio.go b/pkg/format/rtpmpeg4audio/rtpmpeg4audio.go similarity index 100% rename from pkg/formats/rtpmpeg4audio/rtpmpeg4audio.go rename to pkg/format/rtpmpeg4audio/rtpmpeg4audio.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/decoder.go b/pkg/format/rtpmpeg4audiogeneric/decoder.go similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/decoder.go rename to pkg/format/rtpmpeg4audiogeneric/decoder.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/decoder_test.go b/pkg/format/rtpmpeg4audiogeneric/decoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/decoder_test.go rename to pkg/format/rtpmpeg4audiogeneric/decoder_test.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/encoder.go b/pkg/format/rtpmpeg4audiogeneric/encoder.go similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/encoder.go rename to pkg/format/rtpmpeg4audiogeneric/encoder.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/encoder_test.go b/pkg/format/rtpmpeg4audiogeneric/encoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/encoder_test.go rename to pkg/format/rtpmpeg4audiogeneric/encoder_test.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/rtpmpeg4audio_generic.go b/pkg/format/rtpmpeg4audiogeneric/rtpmpeg4audio_generic.go similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/rtpmpeg4audio_generic.go rename to pkg/format/rtpmpeg4audiogeneric/rtpmpeg4audio_generic.go diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/0133a2a9bd638ceb diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/079a435e5445c35b b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/079a435e5445c35b similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/079a435e5445c35b rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/079a435e5445c35b diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/571808e383aba6a5 b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/571808e383aba6a5 similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/571808e383aba6a5 rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/571808e383aba6a5 diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2 b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2 similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2 rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/8f3e197fb87140b2 diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/9418bac23c1c4f72 b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/9418bac23c1c4f72 similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/9418bac23c1c4f72 rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/9418bac23c1c4f72 diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/97f31764971cea9c b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/97f31764971cea9c similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/97f31764971cea9c rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/97f31764971cea9c diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/a68704dd42c38106 b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/a68704dd42c38106 similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/a68704dd42c38106 rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/a68704dd42c38106 diff --git a/pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/c7480ec341b553d6 b/pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/c7480ec341b553d6 similarity index 100% rename from pkg/formats/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/c7480ec341b553d6 rename to pkg/format/rtpmpeg4audiogeneric/testdata/fuzz/FuzzDecoder/c7480ec341b553d6 diff --git a/pkg/formats/rtpmpeg4audiolatm/decoder.go b/pkg/format/rtpmpeg4audiolatm/decoder.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/decoder.go rename to pkg/format/rtpmpeg4audiolatm/decoder.go diff --git a/pkg/formats/rtpmpeg4audiolatm/decoder_test.go b/pkg/format/rtpmpeg4audiolatm/decoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/decoder_test.go rename to pkg/format/rtpmpeg4audiolatm/decoder_test.go diff --git a/pkg/formats/rtpmpeg4audiolatm/encoder.go b/pkg/format/rtpmpeg4audiolatm/encoder.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/encoder.go rename to pkg/format/rtpmpeg4audiolatm/encoder.go diff --git a/pkg/formats/rtpmpeg4audiolatm/encoder_test.go b/pkg/format/rtpmpeg4audiolatm/encoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/encoder_test.go rename to pkg/format/rtpmpeg4audiolatm/encoder_test.go diff --git a/pkg/formats/rtpmpeg4audiolatm/payload_length_info.go b/pkg/format/rtpmpeg4audiolatm/payload_length_info.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/payload_length_info.go rename to pkg/format/rtpmpeg4audiolatm/payload_length_info.go diff --git a/pkg/formats/rtpmpeg4audiolatm/rtpmpeg4audio_latm.go b/pkg/format/rtpmpeg4audiolatm/rtpmpeg4audio_latm.go similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/rtpmpeg4audio_latm.go rename to pkg/format/rtpmpeg4audiolatm/rtpmpeg4audio_latm.go diff --git a/pkg/formats/rtpmpeg4audiolatm/testdata/fuzz/FuzzDecoder/079a435e5445c35b b/pkg/format/rtpmpeg4audiolatm/testdata/fuzz/FuzzDecoder/079a435e5445c35b similarity index 100% rename from pkg/formats/rtpmpeg4audiolatm/testdata/fuzz/FuzzDecoder/079a435e5445c35b rename to pkg/format/rtpmpeg4audiolatm/testdata/fuzz/FuzzDecoder/079a435e5445c35b diff --git a/pkg/formats/rtpmpeg4video/decoder.go b/pkg/format/rtpmpeg4video/decoder.go similarity index 100% rename from pkg/formats/rtpmpeg4video/decoder.go rename to pkg/format/rtpmpeg4video/decoder.go diff --git a/pkg/formats/rtpmpeg4video/decoder_test.go b/pkg/format/rtpmpeg4video/decoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4video/decoder_test.go rename to pkg/format/rtpmpeg4video/decoder_test.go diff --git a/pkg/formats/rtpmpeg4video/encoder.go b/pkg/format/rtpmpeg4video/encoder.go similarity index 100% rename from pkg/formats/rtpmpeg4video/encoder.go rename to pkg/format/rtpmpeg4video/encoder.go diff --git a/pkg/formats/rtpmpeg4video/encoder_test.go b/pkg/format/rtpmpeg4video/encoder_test.go similarity index 100% rename from pkg/formats/rtpmpeg4video/encoder_test.go rename to pkg/format/rtpmpeg4video/encoder_test.go diff --git a/pkg/formats/rtpmpeg4video/rtpmpeg4video.go b/pkg/format/rtpmpeg4video/rtpmpeg4video.go similarity index 100% rename from pkg/formats/rtpmpeg4video/rtpmpeg4video.go rename to pkg/format/rtpmpeg4video/rtpmpeg4video.go diff --git a/pkg/formats/rtpsimpleaudio/decoder.go b/pkg/format/rtpsimpleaudio/decoder.go similarity index 100% rename from pkg/formats/rtpsimpleaudio/decoder.go rename to pkg/format/rtpsimpleaudio/decoder.go diff --git a/pkg/formats/rtpsimpleaudio/decoder_test.go b/pkg/format/rtpsimpleaudio/decoder_test.go similarity index 100% rename from pkg/formats/rtpsimpleaudio/decoder_test.go rename to pkg/format/rtpsimpleaudio/decoder_test.go diff --git a/pkg/formats/rtpsimpleaudio/encoder.go b/pkg/format/rtpsimpleaudio/encoder.go similarity index 100% rename from pkg/formats/rtpsimpleaudio/encoder.go rename to pkg/format/rtpsimpleaudio/encoder.go diff --git a/pkg/formats/rtpsimpleaudio/encoder_test.go b/pkg/format/rtpsimpleaudio/encoder_test.go similarity index 100% rename from pkg/formats/rtpsimpleaudio/encoder_test.go rename to pkg/format/rtpsimpleaudio/encoder_test.go diff --git a/pkg/formats/rtpsimpleaudio/rtpsimpleaudio.go b/pkg/format/rtpsimpleaudio/rtpsimpleaudio.go similarity index 100% rename from pkg/formats/rtpsimpleaudio/rtpsimpleaudio.go rename to pkg/format/rtpsimpleaudio/rtpsimpleaudio.go diff --git a/pkg/formats/rtpvp8/decoder.go b/pkg/format/rtpvp8/decoder.go similarity index 100% rename from pkg/formats/rtpvp8/decoder.go rename to pkg/format/rtpvp8/decoder.go diff --git a/pkg/formats/rtpvp8/decoder_test.go b/pkg/format/rtpvp8/decoder_test.go similarity index 100% rename from pkg/formats/rtpvp8/decoder_test.go rename to pkg/format/rtpvp8/decoder_test.go diff --git a/pkg/formats/rtpvp8/encoder.go b/pkg/format/rtpvp8/encoder.go similarity index 100% rename from pkg/formats/rtpvp8/encoder.go rename to pkg/format/rtpvp8/encoder.go diff --git a/pkg/formats/rtpvp8/encoder_test.go b/pkg/format/rtpvp8/encoder_test.go similarity index 100% rename from pkg/formats/rtpvp8/encoder_test.go rename to pkg/format/rtpvp8/encoder_test.go diff --git a/pkg/formats/rtpvp8/rtpvp8.go b/pkg/format/rtpvp8/rtpvp8.go similarity index 100% rename from pkg/formats/rtpvp8/rtpvp8.go rename to pkg/format/rtpvp8/rtpvp8.go diff --git a/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/01b49f6ea4a5f782 b/pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/01b49f6ea4a5f782 similarity index 100% rename from pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/01b49f6ea4a5f782 rename to pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/01b49f6ea4a5f782 diff --git a/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b b/pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b similarity index 100% rename from pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b rename to pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/079a435e5445c35b diff --git a/pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2 b/pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2 similarity index 100% rename from pkg/formats/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2 rename to pkg/format/rtpvp8/testdata/fuzz/FuzzDecoder/2b9461645a4b90d2 diff --git a/pkg/formats/rtpvp9/decoder.go b/pkg/format/rtpvp9/decoder.go similarity index 100% rename from pkg/formats/rtpvp9/decoder.go rename to pkg/format/rtpvp9/decoder.go diff --git a/pkg/formats/rtpvp9/decoder_test.go b/pkg/format/rtpvp9/decoder_test.go similarity index 100% rename from pkg/formats/rtpvp9/decoder_test.go rename to pkg/format/rtpvp9/decoder_test.go diff --git a/pkg/formats/rtpvp9/encoder.go b/pkg/format/rtpvp9/encoder.go similarity index 100% rename from pkg/formats/rtpvp9/encoder.go rename to pkg/format/rtpvp9/encoder.go diff --git a/pkg/formats/rtpvp9/encoder_test.go b/pkg/format/rtpvp9/encoder_test.go similarity index 100% rename from pkg/formats/rtpvp9/encoder_test.go rename to pkg/format/rtpvp9/encoder_test.go diff --git a/pkg/formats/rtpvp9/rtpvp9.go b/pkg/format/rtpvp9/rtpvp9.go similarity index 100% rename from pkg/formats/rtpvp9/rtpvp9.go rename to pkg/format/rtpvp9/rtpvp9.go diff --git a/pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoder/41b798362d81811a b/pkg/format/rtpvp9/testdata/fuzz/FuzzDecoder/41b798362d81811a similarity index 100% rename from pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoder/41b798362d81811a rename to pkg/format/rtpvp9/testdata/fuzz/FuzzDecoder/41b798362d81811a diff --git a/pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoder/5c3924785d154da4 b/pkg/format/rtpvp9/testdata/fuzz/FuzzDecoder/5c3924785d154da4 similarity index 100% rename from pkg/formats/rtpvp9/testdata/fuzz/FuzzDecoder/5c3924785d154da4 rename to pkg/format/rtpvp9/testdata/fuzz/FuzzDecoder/5c3924785d154da4 diff --git a/pkg/formats/speex.go b/pkg/format/speex.go similarity index 98% rename from pkg/formats/speex.go rename to pkg/format/speex.go index 5484df1a..c82f55cc 100644 --- a/pkg/formats/speex.go +++ b/pkg/format/speex.go @@ -1,4 +1,4 @@ -package formats +package format import ( "fmt" diff --git a/pkg/formats/speex_test.go b/pkg/format/speex_test.go similarity index 95% rename from pkg/formats/speex_test.go rename to pkg/format/speex_test.go index 2f057a08..53df6551 100644 --- a/pkg/formats/speex_test.go +++ b/pkg/format/speex_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH264/708789f132a57d65 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/708789f132a57d65 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH264/708789f132a57d65 rename to pkg/format/testdata/fuzz/FuzzUnmarshalH264/708789f132a57d65 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH264/85649d45641911d0 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/85649d45641911d0 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH264/85649d45641911d0 rename to pkg/format/testdata/fuzz/FuzzUnmarshalH264/85649d45641911d0 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 b/pkg/format/testdata/fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 rename to pkg/format/testdata/fuzz/FuzzUnmarshalH264/d0410f4fd49cc1b8 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH265/09376da4826c9233 b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/09376da4826c9233 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH265/09376da4826c9233 rename to pkg/format/testdata/fuzz/FuzzUnmarshalH265/09376da4826c9233 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf rename to pkg/format/testdata/fuzz/FuzzUnmarshalH265/63e3b0a8cb682bdf diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalH265/fae5e048802aad6c b/pkg/format/testdata/fuzz/FuzzUnmarshalH265/fae5e048802aad6c similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalH265/fae5e048802aad6c rename to pkg/format/testdata/fuzz/FuzzUnmarshalH265/fae5e048802aad6c diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 b/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 rename to pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/4e36b64da83067c2 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c b/pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c rename to pkg/format/testdata/fuzz/FuzzUnmarshalLPCM/e9e3ffbe3b3a072c diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/00e15d22123489fd b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/00e15d22123489fd similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/00e15d22123489fd rename to pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/00e15d22123489fd diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/aa424148ecba23f1 b/pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/aa424148ecba23f1 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/aa424148ecba23f1 rename to pkg/format/testdata/fuzz/FuzzUnmarshalMPEG4VideoES/aa424148ecba23f1 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 rename to pkg/format/testdata/fuzz/FuzzUnmarshalOpus/771e938e4458e983 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 b/pkg/format/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 rename to pkg/format/testdata/fuzz/FuzzUnmarshalOpus/9cd9b70960b4a733 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVP8/85649d45641911d0 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/85649d45641911d0 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVP8/85649d45641911d0 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVP8/85649d45641911d0 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVP8/aa424148ecba23f1 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVP9/4c51a06c202d48d0 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb rename to pkg/format/testdata/fuzz/FuzzUnmarshalVP9/54e9dd922dda87eb diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/671f05b72e69d643 b/pkg/format/testdata/fuzz/FuzzUnmarshalVP9/671f05b72e69d643 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVP9/671f05b72e69d643 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVP9/671f05b72e69d643 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/199c2c84b007b8d1 diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b rename to pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/1e2e9f272753060b diff --git a/pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 b/pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 similarity index 100% rename from pkg/formats/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 rename to pkg/format/testdata/fuzz/FuzzUnmarshalVorbis/70149aff1d6b6142 diff --git a/pkg/formats/vorbis.go b/pkg/format/vorbis.go similarity index 99% rename from pkg/formats/vorbis.go rename to pkg/format/vorbis.go index 18c0d472..fbfad92d 100644 --- a/pkg/formats/vorbis.go +++ b/pkg/format/vorbis.go @@ -1,4 +1,4 @@ -package formats +package format import ( "encoding/base64" diff --git a/pkg/formats/vorbis_test.go b/pkg/format/vorbis_test.go similarity index 96% rename from pkg/formats/vorbis_test.go rename to pkg/format/vorbis_test.go index 3a18cd98..b1200969 100644 --- a/pkg/formats/vorbis_test.go +++ b/pkg/format/vorbis_test.go @@ -1,4 +1,4 @@ -package formats +package format import ( "testing" diff --git a/pkg/formats/vp8.go b/pkg/format/vp8.go similarity index 96% rename from pkg/formats/vp8.go rename to pkg/format/vp8.go index 00f4a26c..13316f30 100644 --- a/pkg/formats/vp8.go +++ b/pkg/format/vp8.go @@ -1,4 +1,4 @@ -package formats +package format import ( "fmt" @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpvp8" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp8" ) // VP8 is a RTP format for the VP8 codec. diff --git a/pkg/formats/vp8_test.go b/pkg/format/vp8_test.go similarity index 96% rename from pkg/formats/vp8_test.go rename to pkg/format/vp8_test.go index 5703f81c..d72a3bcc 100644 --- a/pkg/formats/vp8_test.go +++ b/pkg/format/vp8_test.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "testing" diff --git a/pkg/formats/vp9.go b/pkg/format/vp9.go similarity index 96% rename from pkg/formats/vp9.go rename to pkg/format/vp9.go index 67a032a5..161e076a 100644 --- a/pkg/formats/vp9.go +++ b/pkg/format/vp9.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "fmt" @@ -6,7 +6,7 @@ import ( "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats/rtpvp9" + "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp9" ) // VP9 is a RTP format for the VP9 codec. diff --git a/pkg/formats/vp9_test.go b/pkg/format/vp9_test.go similarity index 96% rename from pkg/formats/vp9_test.go rename to pkg/format/vp9_test.go index 897661df..2995ac0c 100644 --- a/pkg/formats/vp9_test.go +++ b/pkg/format/vp9_test.go @@ -1,4 +1,4 @@ -package formats //nolint:dupl +package format //nolint:dupl import ( "testing" diff --git a/pkg/formats/mpeg4_video_generic.go b/pkg/formats/mpeg4_video_generic.go deleted file mode 100644 index 124b18d4..00000000 --- a/pkg/formats/mpeg4_video_generic.go +++ /dev/null @@ -1,3 +0,0 @@ -package formats - -// TODO diff --git a/pkg/formats/mpeg4_video_generic_test.go b/pkg/formats/mpeg4_video_generic_test.go deleted file mode 100644 index 124b18d4..00000000 --- a/pkg/formats/mpeg4_video_generic_test.go +++ /dev/null @@ -1,3 +0,0 @@ -package formats - -// TODO diff --git a/pkg/media/media.go b/pkg/media/media.go index 94f3b0c9..c67e056e 100644 --- a/pkg/media/media.go +++ b/pkg/media/media.go @@ -11,7 +11,7 @@ import ( psdp "github.com/pion/sdp/v3" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/url" ) @@ -125,7 +125,7 @@ type Media struct { Control string // Formats contained into the media. - Formats []formats.Format + Formats []format.Format } func (m *Media) unmarshal(md *psdp.MediaDescription) error { @@ -156,7 +156,7 @@ func (m *Media) unmarshal(md *psdp.MediaDescription) error { rtpMap := getFormatAttribute(md.Attributes, payloadTypeInt, "rtpmap") fmtp := decodeFMTP(getFormatAttribute(md.Attributes, payloadTypeInt, "fmtp")) - format, err := formats.Unmarshal(string(m.Type), payloadTypeInt, rtpMap, fmtp) + format, err := format.Unmarshal(string(m.Type), payloadTypeInt, rtpMap, fmtp) if err != nil { return err } diff --git a/pkg/media/media_test.go b/pkg/media/media_test.go index 2e348d14..a2f3fcd3 100644 --- a/pkg/media/media_test.go +++ b/pkg/media/media_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/sdp" "github.com/bluenviron/gortsplib/v4/pkg/url" ) @@ -147,7 +147,7 @@ func TestMediaURL(t *testing.T) { func TestMediaURLError(t *testing.T) { media := &Media{ Type: "video", - Formats: []formats.Format{&formats.H264{}}, + Formats: []format.Format{&format.H264{}}, } _, err := media.URL(nil) require.EqualError(t, err, "Content-Base header not provided") diff --git a/pkg/media/medias_test.go b/pkg/media/medias_test.go index edd2bd9a..e31004c0 100644 --- a/pkg/media/medias_test.go +++ b/pkg/media/medias_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/sdp" ) @@ -60,7 +60,7 @@ var casesMedias = []struct { { Type: "video", Control: "rtsp://10.0.100.50/profile5/media.smp/trackID=v", - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 97, PacketizationMode: 1, SPS: []byte{0x67, 0x64, 0x00, 0x28, 0xac, 0xb4, 0x03, 0xc0, 0x11, 0x3f, 0x2a}, @@ -71,13 +71,13 @@ var casesMedias = []struct { Type: "audio", Direction: DirectionRecvonly, Control: "rtsp://10.0.100.50/profile5/media.smp/trackID=a", - Formats: []formats.Format{&formats.G711{ + Formats: []format.Format{&format.G711{ MULaw: true, }}, }, { Type: "application", - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 107, }}, }, @@ -127,7 +127,7 @@ var casesMedias = []struct { { Type: "video", Control: "trackID=1", - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 97, PacketizationMode: 1, SPS: []byte{0x67, 0x64, 0x00, 0x28, 0xac, 0xb4, 0x03, 0xc0, 0x11, 0x3f, 0x2a}, @@ -138,13 +138,13 @@ var casesMedias = []struct { Type: "audio", Direction: DirectionRecvonly, Control: "trackID=2", - Formats: []formats.Format{&formats.G711{ + Formats: []format.Format{&format.G711{ MULaw: true, }}, }, { Type: "application", - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 107, }}, }, @@ -295,64 +295,64 @@ var casesMedias = []struct { { Type: "audio", Direction: DirectionSendonly, - Formats: []formats.Format{ - &formats.Opus{ + Formats: []format.Format{ + &format.Opus{ PayloadTyp: 111, IsStereo: false, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 103, RTPMa: "ISAC/16000", ClockRat: 16000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 104, RTPMa: "ISAC/32000", ClockRat: 32000, }, - &formats.G722{}, - &formats.Generic{ + &format.G722{}, + &format.Generic{ PayloadTyp: 102, RTPMa: "ILBC/8000", ClockRat: 8000, }, - &formats.G711{ + &format.G711{ MULaw: true, }, - &formats.G711{ + &format.G711{ MULaw: false, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 106, RTPMa: "CN/32000", ClockRat: 32000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 105, RTPMa: "CN/16000", ClockRat: 16000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 13, RTPMa: "CN/8000", ClockRat: 8000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 110, RTPMa: "telephone-event/48000", ClockRat: 48000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 112, RTPMa: "telephone-event/32000", ClockRat: 32000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 113, RTPMa: "telephone-event/16000", ClockRat: 16000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 126, RTPMa: "telephone-event/8000", ClockRat: 8000, @@ -362,11 +362,11 @@ var casesMedias = []struct { { Type: "video", Direction: DirectionSendonly, - Formats: []formats.Format{ - &formats.VP8{ + Formats: []format.Format{ + &format.VP8{ PayloadTyp: 96, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 97, RTPMa: "rtx/90000", FMT: map[string]string{ @@ -374,10 +374,10 @@ var casesMedias = []struct { }, ClockRat: 90000, }, - &formats.VP9{ + &format.VP9{ PayloadTyp: 98, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 99, RTPMa: "rtx/90000", FMT: map[string]string{ @@ -385,11 +385,11 @@ var casesMedias = []struct { }, ClockRat: 90000, }, - &formats.H264{ + &format.H264{ PayloadTyp: 100, PacketizationMode: 1, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 101, RTPMa: "rtx/90000", FMT: map[string]string{ @@ -397,12 +397,12 @@ var casesMedias = []struct { }, ClockRat: 90000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 127, RTPMa: "red/90000", ClockRat: 90000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 124, RTPMa: "rtx/90000", FMT: map[string]string{ @@ -410,7 +410,7 @@ var casesMedias = []struct { }, ClockRat: 90000, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 125, RTPMa: "ulpfec/90000", ClockRat: 90000, @@ -445,8 +445,8 @@ var casesMedias = []struct { Medias{ { Type: "video", - Formats: []formats.Format{ - &formats.H264{ + Formats: []format.Format{ + &format.H264{ PayloadTyp: 96, SPS: []byte{ 0x67, 0x4d, 0x00, 0x2a, 0x9d, 0xa8, 0x1e, 0x00, @@ -455,7 +455,7 @@ var casesMedias = []struct { PPS: []byte{0x68, 0xee, 0x3c, 0x80}, PacketizationMode: 1, }, - &formats.Generic{ + &format.Generic{ PayloadTyp: 98, RTPMa: "MetaData", }, @@ -500,19 +500,19 @@ var casesMedias = []struct { Type: "video", Direction: DirectionRecvonly, Control: "rtsp://192.168.0.1/video", - Formats: []formats.Format{&formats.MJPEG{}}, + Formats: []format.Format{&format.MJPEG{}}, }, { Type: "audio", Direction: DirectionRecvonly, Control: "rtsp://192.168.0.1/audio", - Formats: []formats.Format{&formats.G711{MULaw: true}}, + Formats: []format.Format{&format.G711{MULaw: true}}, }, { Type: "audio", Direction: DirectionSendonly, Control: "rtsp://192.168.0.1/audioback", - Formats: []formats.Format{&formats.G711{MULaw: true}}, + Formats: []format.Format{&format.G711{MULaw: true}}, }, }, }, @@ -535,7 +535,7 @@ var casesMedias = []struct { Medias{ { Type: "application/TP-LINK", - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 95, RTPMa: "TP-LINK/90000", ClockRat: 90000, @@ -563,7 +563,7 @@ var casesMedias = []struct { Medias{ { Type: "application/MERCURY", - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 95, RTPMa: "MERCURY/90000", ClockRat: 90000, @@ -592,8 +592,8 @@ var casesMedias = []struct { Medias{ { Type: "video", - Formats: []formats.Format{ - &formats.H264{ + Formats: []format.Format{ + &format.H264{ PayloadTyp: 96, PacketizationMode: 1, }, @@ -664,7 +664,7 @@ func TestMediasMarshal(t *testing.T) { } func TestMediasFindFormat(t *testing.T) { - tr := &formats.Generic{ + tr := &format.Generic{ PayloadTyp: 97, RTPMa: "rtx/90000", FMT: map[string]string{ @@ -675,12 +675,12 @@ func TestMediasFindFormat(t *testing.T) { md := &Media{ Type: TypeVideo, - Formats: []formats.Format{ - &formats.VP8{ + Formats: []format.Format{ + &format.VP8{ PayloadTyp: 96, }, tr, - &formats.VP9{ + &format.VP9{ PayloadTyp: 98, }, }, @@ -689,8 +689,8 @@ func TestMediasFindFormat(t *testing.T) { ms := Medias{ { Type: TypeAudio, - Formats: []formats.Format{ - &formats.Opus{ + Formats: []format.Format{ + &format.Opus{ PayloadTyp: 111, IsStereo: true, }, @@ -699,7 +699,7 @@ func TestMediasFindFormat(t *testing.T) { md, } - var forma *formats.Generic + var forma *format.Generic me := ms.FindFormat(&forma) require.Equal(t, md, me) require.Equal(t, tr, forma) diff --git a/server_play_test.go b/server_play_test.go index be00f2b1..ddbda355 100644 --- a/server_play_test.go +++ b/server_play_test.go @@ -18,7 +18,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/base" "github.com/bluenviron/gortsplib/v4/pkg/conn" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/sdp" @@ -1877,7 +1877,7 @@ func TestServerPlayAdditionalInfos(t *testing.T) { return &ri, ssrcs } - forma := &formats.Generic{ + forma := &format.Generic{ PayloadTyp: 96, RTPMa: "private/90000", } @@ -1914,11 +1914,11 @@ func TestServerPlayAdditionalInfos(t *testing.T) { stream = NewServerStream(s, media.Medias{ &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, }) defer stream.Close() @@ -1994,7 +1994,7 @@ func TestServerPlayAdditionalInfos(t *testing.T) { } func TestServerPlayNoInterleavedIDs(t *testing.T) { - forma := &formats.Generic{ + forma := &format.Generic{ PayloadTyp: 96, RTPMa: "private/90000", } @@ -2031,11 +2031,11 @@ func TestServerPlayNoInterleavedIDs(t *testing.T) { stream = NewServerStream(s, media.Medias{ &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, }) defer stream.Close() diff --git a/server_record_test.go b/server_record_test.go index c5b06211..6163d621 100644 --- a/server_record_test.go +++ b/server_record_test.go @@ -15,7 +15,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/base" "github.com/bluenviron/gortsplib/v4/pkg/conn" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/media" "github.com/bluenviron/gortsplib/v4/pkg/sdp" @@ -431,7 +431,7 @@ func TestServerRecordErrorRecordPartialMedias(t *testing.T) { defer nconn.Close() conn := conn.NewConn(nconn) - forma := &formats.Generic{ + forma := &format.Generic{ PayloadTyp: 96, RTPMa: "private/90000", } @@ -441,11 +441,11 @@ func TestServerRecordErrorRecordPartialMedias(t *testing.T) { medias := media.Medias{ &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, &media.Media{ Type: "application", - Formats: []formats.Format{forma}, + Formats: []format.Format{forma}, }, } resetMediaControls(medias) @@ -586,7 +586,7 @@ func TestServerRecord(t *testing.T) { medias := media.Medias{ &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, SPS: []byte{0x01, 0x02, 0x03, 0x04}, PPS: []byte{0x01, 0x02, 0x03, 0x04}, @@ -595,7 +595,7 @@ func TestServerRecord(t *testing.T) { }, &media.Media{ Type: media.TypeVideo, - Formats: []formats.Format{&formats.H264{ + Formats: []format.Format{&format.H264{ PayloadTyp: 96, SPS: []byte{0x01, 0x02, 0x03, 0x04}, PPS: []byte{0x01, 0x02, 0x03, 0x04}, @@ -1270,7 +1270,7 @@ func TestServerRecordDecodeErrors(t *testing.T) { medias := media.Medias{&media.Media{ Type: media.TypeApplication, - Formats: []formats.Format{&formats.Generic{ + Formats: []format.Format{&format.Generic{ PayloadTyp: 97, RTPMa: "private/90000", }}, diff --git a/server_session.go b/server_session.go index 19c6051f..d9e1e693 100644 --- a/server_session.go +++ b/server_session.go @@ -14,7 +14,7 @@ import ( "github.com/pion/rtp" "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/headers" "github.com/bluenviron/gortsplib/v4/pkg/liberrors" "github.com/bluenviron/gortsplib/v4/pkg/media" @@ -1140,7 +1140,7 @@ func (ss *ServerSession) OnPacketRTCPAny(cb OnPacketRTCPAnyFunc) { } // OnPacketRTP sets the callback that is called when a RTP packet is read. -func (ss *ServerSession) OnPacketRTP(medi *media.Media, forma formats.Format, cb OnPacketRTPFunc) { +func (ss *ServerSession) OnPacketRTP(medi *media.Media, forma format.Format, cb OnPacketRTPFunc) { sm := ss.setuppedMedias[medi] st := sm.formats[forma.PayloadType()] st.onPacketRTP = cb diff --git a/server_session_format.go b/server_session_format.go index d76c8ca5..6872cf4c 100644 --- a/server_session_format.go +++ b/server_session_format.go @@ -7,7 +7,7 @@ import ( "github.com/pion/rtcp" "github.com/pion/rtp" - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/rtcpreceiver" "github.com/bluenviron/gortsplib/v4/pkg/rtplossdetector" "github.com/bluenviron/gortsplib/v4/pkg/rtpreorderer" @@ -15,14 +15,14 @@ import ( type serverSessionFormat struct { sm *serverSessionMedia - format formats.Format + format format.Format udpReorderer *rtpreorderer.Reorderer tcpLossDetector *rtplossdetector.LossDetector udpRTCPReceiver *rtcpreceiver.RTCPReceiver onPacketRTP OnPacketRTPFunc } -func newServerSessionFormat(sm *serverSessionMedia, forma formats.Format) *serverSessionFormat { +func newServerSessionFormat(sm *serverSessionMedia, forma format.Format) *serverSessionFormat { return &serverSessionFormat{ sm: sm, format: forma, diff --git a/server_stream_format.go b/server_stream_format.go index 8b654589..d6d45726 100644 --- a/server_stream_format.go +++ b/server_stream_format.go @@ -1,11 +1,11 @@ package gortsplib import ( - "github.com/bluenviron/gortsplib/v4/pkg/formats" + "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/bluenviron/gortsplib/v4/pkg/rtcpsender" ) type serverStreamFormat struct { - format formats.Format + format format.Format rtcpSender *rtcpsender.RTCPSender }