From 99bc327d6791f33641097657d0b9e829dc45b762 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Thu, 26 Oct 2023 21:46:18 +0200 Subject: [PATCH] move protocol-related code into internal/protocols (#2572) --- internal/core/api.go | 2 +- internal/core/api_test.go | 4 ++-- internal/core/hls_http_server.go | 2 +- internal/core/metrics.go | 2 +- internal/core/metrics_test.go | 2 +- internal/core/path_test.go | 4 ++-- internal/core/pprof.go | 2 +- internal/core/rtmp_conn.go | 2 +- internal/core/rtmp_server_test.go | 2 +- internal/core/rtmp_source.go | 2 +- internal/core/rtmp_source_test.go | 2 +- internal/core/webrtc_http_server.go | 4 ++-- internal/core/webrtc_manager.go | 2 +- internal/core/webrtc_manager_test.go | 2 +- internal/core/webrtc_session.go | 2 +- internal/core/webrtc_source.go | 2 +- internal/core/webrtc_source_test.go | 2 +- internal/{ => protocols}/httpserv/handler_exit_on_panic.go | 0 .../{ => protocols}/httpserv/handler_filter_requests.go | 0 internal/{ => protocols}/httpserv/handler_logger.go | 0 internal/{ => protocols}/httpserv/handler_server_header.go | 0 internal/{ => protocols}/httpserv/wrapped_server.go | 0 internal/{ => protocols}/httpserv/wrapped_server_test.go | 0 internal/{ => protocols}/rtmp/bytecounter/reader.go | 0 internal/{ => protocols}/rtmp/bytecounter/reader_test.go | 0 internal/{ => protocols}/rtmp/bytecounter/readwriter.go | 0 internal/{ => protocols}/rtmp/bytecounter/writer.go | 0 internal/{ => protocols}/rtmp/bytecounter/writer_test.go | 0 internal/{ => protocols}/rtmp/chunk/chunk.go | 0 internal/{ => protocols}/rtmp/chunk/chunk0.go | 0 internal/{ => protocols}/rtmp/chunk/chunk0_test.go | 0 internal/{ => protocols}/rtmp/chunk/chunk1.go | 0 internal/{ => protocols}/rtmp/chunk/chunk1_test.go | 0 internal/{ => protocols}/rtmp/chunk/chunk2.go | 0 internal/{ => protocols}/rtmp/chunk/chunk2_test.go | 0 internal/{ => protocols}/rtmp/chunk/chunk3.go | 0 internal/{ => protocols}/rtmp/chunk/chunk3_test.go | 0 internal/{ => protocols}/rtmp/conn.go | 6 +++--- internal/{ => protocols}/rtmp/conn_test.go | 6 +++--- internal/{ => protocols}/rtmp/h264conf/h264conf.go | 0 internal/{ => protocols}/rtmp/h264conf/h264conf_test.go | 0 internal/{ => protocols}/rtmp/handshake/c0s0.go | 0 internal/{ => protocols}/rtmp/handshake/c0s0_test.go | 0 internal/{ => protocols}/rtmp/handshake/c1s1.go | 0 internal/{ => protocols}/rtmp/handshake/c1s1_test.go | 0 internal/{ => protocols}/rtmp/handshake/c2s2.go | 0 internal/{ => protocols}/rtmp/handshake/c2s2_test.go | 0 internal/{ => protocols}/rtmp/handshake/dh.go | 0 internal/{ => protocols}/rtmp/handshake/handshake.go | 0 internal/{ => protocols}/rtmp/handshake/handshake_test.go | 0 internal/{ => protocols}/rtmp/message/acknowledge.go | 2 +- internal/{ => protocols}/rtmp/message/audio.go | 2 +- internal/{ => protocols}/rtmp/message/command_amf0.go | 2 +- internal/{ => protocols}/rtmp/message/data_amf0.go | 2 +- .../{ => protocols}/rtmp/message/extended_coded_frames.go | 2 +- internal/{ => protocols}/rtmp/message/extended_frames_x.go | 2 +- internal/{ => protocols}/rtmp/message/extended_metadata.go | 2 +- .../rtmp/message/extended_mpeg2ts_sequence_start.go | 2 +- .../{ => protocols}/rtmp/message/extended_sequence_end.go | 2 +- .../{ => protocols}/rtmp/message/extended_sequence_start.go | 2 +- internal/{ => protocols}/rtmp/message/message.go | 2 +- internal/{ => protocols}/rtmp/message/reader.go | 4 ++-- internal/{ => protocols}/rtmp/message/reader_test.go | 2 +- internal/{ => protocols}/rtmp/message/readwriter.go | 2 +- internal/{ => protocols}/rtmp/message/readwriter_test.go | 2 +- internal/{ => protocols}/rtmp/message/set_chunk_size.go | 2 +- internal/{ => protocols}/rtmp/message/set_peer_bandwidth.go | 2 +- .../{ => protocols}/rtmp/message/set_window_ack_size.go | 2 +- .../rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd | 0 .../rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 | 0 .../rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa | 0 .../rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 | 0 .../rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 | 0 .../rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 | 0 .../rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f | 0 .../rtmp/message/user_control_ping_request.go | 2 +- .../rtmp/message/user_control_ping_response.go | 2 +- .../rtmp/message/user_control_set_buffer_length.go | 2 +- .../rtmp/message/user_control_stream_begin.go | 2 +- .../{ => protocols}/rtmp/message/user_control_stream_dry.go | 2 +- .../{ => protocols}/rtmp/message/user_control_stream_eof.go | 2 +- .../rtmp/message/user_control_stream_is_recorded.go | 2 +- internal/{ => protocols}/rtmp/message/video.go | 2 +- internal/{ => protocols}/rtmp/message/writer.go | 4 ++-- internal/{ => protocols}/rtmp/message/writer_test.go | 2 +- internal/{ => protocols}/rtmp/rawmessage/message.go | 0 internal/{ => protocols}/rtmp/rawmessage/reader.go | 4 ++-- internal/{ => protocols}/rtmp/rawmessage/reader_test.go | 4 ++-- .../rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba | 0 .../rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 | 0 .../rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc | 0 .../rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df | 0 .../rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 | 0 internal/{ => protocols}/rtmp/rawmessage/writer.go | 4 ++-- internal/{ => protocols}/rtmp/rawmessage/writer_test.go | 4 ++-- internal/{ => protocols}/rtmp/rc4_readwriter.go | 0 internal/{ => protocols}/rtmp/reader.go | 4 ++-- internal/{ => protocols}/rtmp/reader_test.go | 6 +++--- internal/{ => protocols}/rtmp/writer.go | 4 ++-- internal/{ => protocols}/rtmp/writer_test.go | 4 ++-- internal/{ => protocols}/webrtc/api.go | 0 internal/{ => protocols}/webrtc/ice_fragment.go | 0 internal/{ => protocols}/webrtc/ice_fragment_test.go | 0 internal/{ => protocols}/webrtc/incoming_track.go | 0 internal/{ => protocols}/webrtc/link_header.go | 0 internal/{ => protocols}/webrtc/link_header_test.go | 0 internal/{ => protocols}/webrtc/outgoing_track.go | 0 internal/{ => protocols}/webrtc/peer_connection.go | 0 internal/{ => protocols}/webrtc/track_count.go | 0 internal/{ => protocols}/webrtc/webrtc.go | 0 internal/{ => protocols}/webrtc/whip_client.go | 0 internal/{ => protocols}/webrtc/whip_delete_session.go | 0 internal/{ => protocols}/webrtc/whip_options_ice_servers.go | 0 internal/{ => protocols}/webrtc/whip_patch_candidate.go | 0 internal/{ => protocols}/webrtc/whip_post_offer.go | 0 internal/{ => protocols}/websocket/serverconn.go | 0 internal/{ => protocols}/websocket/serverconn_test.go | 0 126 files changed, 73 insertions(+), 73 deletions(-) rename internal/{ => protocols}/httpserv/handler_exit_on_panic.go (100%) rename internal/{ => protocols}/httpserv/handler_filter_requests.go (100%) rename internal/{ => protocols}/httpserv/handler_logger.go (100%) rename internal/{ => protocols}/httpserv/handler_server_header.go (100%) rename internal/{ => protocols}/httpserv/wrapped_server.go (100%) rename internal/{ => protocols}/httpserv/wrapped_server_test.go (100%) rename internal/{ => protocols}/rtmp/bytecounter/reader.go (100%) rename internal/{ => protocols}/rtmp/bytecounter/reader_test.go (100%) rename internal/{ => protocols}/rtmp/bytecounter/readwriter.go (100%) rename internal/{ => protocols}/rtmp/bytecounter/writer.go (100%) rename internal/{ => protocols}/rtmp/bytecounter/writer_test.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk0.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk0_test.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk1.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk1_test.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk2.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk2_test.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk3.go (100%) rename internal/{ => protocols}/rtmp/chunk/chunk3_test.go (100%) rename internal/{ => protocols}/rtmp/conn.go (98%) rename internal/{ => protocols}/rtmp/conn_test.go (98%) rename internal/{ => protocols}/rtmp/h264conf/h264conf.go (100%) rename internal/{ => protocols}/rtmp/h264conf/h264conf_test.go (100%) rename internal/{ => protocols}/rtmp/handshake/c0s0.go (100%) rename internal/{ => protocols}/rtmp/handshake/c0s0_test.go (100%) rename internal/{ => protocols}/rtmp/handshake/c1s1.go (100%) rename internal/{ => protocols}/rtmp/handshake/c1s1_test.go (100%) rename internal/{ => protocols}/rtmp/handshake/c2s2.go (100%) rename internal/{ => protocols}/rtmp/handshake/c2s2_test.go (100%) rename internal/{ => protocols}/rtmp/handshake/dh.go (100%) rename internal/{ => protocols}/rtmp/handshake/handshake.go (100%) rename internal/{ => protocols}/rtmp/handshake/handshake_test.go (100%) rename internal/{ => protocols}/rtmp/message/acknowledge.go (92%) rename internal/{ => protocols}/rtmp/message/audio.go (97%) rename internal/{ => protocols}/rtmp/message/command_amf0.go (94%) rename internal/{ => protocols}/rtmp/message/data_amf0.go (92%) rename internal/{ => protocols}/rtmp/message/extended_coded_frames.go (96%) rename internal/{ => protocols}/rtmp/message/extended_frames_x.go (94%) rename internal/{ => protocols}/rtmp/message/extended_metadata.go (89%) rename internal/{ => protocols}/rtmp/message/extended_mpeg2ts_sequence_start.go (90%) rename internal/{ => protocols}/rtmp/message/extended_sequence_end.go (89%) rename internal/{ => protocols}/rtmp/message/extended_sequence_start.go (94%) rename internal/{ => protocols}/rtmp/message/message.go (96%) rename internal/{ => protocols}/rtmp/message/reader.go (95%) rename internal/{ => protocols}/rtmp/message/reader_test.go (98%) rename internal/{ => protocols}/rtmp/message/readwriter.go (93%) rename internal/{ => protocols}/rtmp/message/readwriter_test.go (95%) rename internal/{ => protocols}/rtmp/message/set_chunk_size.go (92%) rename internal/{ => protocols}/rtmp/message/set_peer_bandwidth.go (93%) rename internal/{ => protocols}/rtmp/message/set_window_ack_size.go (93%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 (100%) rename internal/{ => protocols}/rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f (100%) rename internal/{ => protocols}/rtmp/message/user_control_ping_request.go (93%) rename internal/{ => protocols}/rtmp/message/user_control_ping_response.go (93%) rename internal/{ => protocols}/rtmp/message/user_control_set_buffer_length.go (95%) rename internal/{ => protocols}/rtmp/message/user_control_stream_begin.go (93%) rename internal/{ => protocols}/rtmp/message/user_control_stream_dry.go (93%) rename internal/{ => protocols}/rtmp/message/user_control_stream_eof.go (93%) rename internal/{ => protocols}/rtmp/message/user_control_stream_is_recorded.go (94%) rename internal/{ => protocols}/rtmp/message/video.go (96%) rename internal/{ => protocols}/rtmp/message/writer.go (85%) rename internal/{ => protocols}/rtmp/message/writer_test.go (84%) rename internal/{ => protocols}/rtmp/rawmessage/message.go (100%) rename internal/{ => protocols}/rtmp/rawmessage/reader.go (98%) rename internal/{ => protocols}/rtmp/rawmessage/reader_test.go (97%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df (100%) rename internal/{ => protocols}/rtmp/rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 (100%) rename internal/{ => protocols}/rtmp/rawmessage/writer.go (97%) rename internal/{ => protocols}/rtmp/rawmessage/writer_test.go (91%) rename internal/{ => protocols}/rtmp/rc4_readwriter.go (100%) rename internal/{ => protocols}/rtmp/reader.go (99%) rename internal/{ => protocols}/rtmp/reader_test.go (98%) rename internal/{ => protocols}/rtmp/writer.go (97%) rename internal/{ => protocols}/rtmp/writer_test.go (94%) rename internal/{ => protocols}/webrtc/api.go (100%) rename internal/{ => protocols}/webrtc/ice_fragment.go (100%) rename internal/{ => protocols}/webrtc/ice_fragment_test.go (100%) rename internal/{ => protocols}/webrtc/incoming_track.go (100%) rename internal/{ => protocols}/webrtc/link_header.go (100%) rename internal/{ => protocols}/webrtc/link_header_test.go (100%) rename internal/{ => protocols}/webrtc/outgoing_track.go (100%) rename internal/{ => protocols}/webrtc/peer_connection.go (100%) rename internal/{ => protocols}/webrtc/track_count.go (100%) rename internal/{ => protocols}/webrtc/webrtc.go (100%) rename internal/{ => protocols}/webrtc/whip_client.go (100%) rename internal/{ => protocols}/webrtc/whip_delete_session.go (100%) rename internal/{ => protocols}/webrtc/whip_options_ice_servers.go (100%) rename internal/{ => protocols}/webrtc/whip_patch_candidate.go (100%) rename internal/{ => protocols}/webrtc/whip_post_offer.go (100%) rename internal/{ => protocols}/websocket/serverconn.go (100%) rename internal/{ => protocols}/websocket/serverconn_test.go (100%) diff --git a/internal/core/api.go b/internal/core/api.go index 783206b6..c31cd600 100644 --- a/internal/core/api.go +++ b/internal/core/api.go @@ -15,8 +15,8 @@ import ( "github.com/google/uuid" "github.com/bluenviron/mediamtx/internal/conf" - "github.com/bluenviron/mediamtx/internal/httpserv" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/httpserv" ) var errAPINotFound = errors.New("not found") diff --git a/internal/core/api_test.go b/internal/core/api_test.go index d04f5f79..5ddff802 100644 --- a/internal/core/api_test.go +++ b/internal/core/api_test.go @@ -25,8 +25,8 @@ import ( "github.com/pion/rtp" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) var testFormatH264 = &format.H264{ diff --git a/internal/core/hls_http_server.go b/internal/core/hls_http_server.go index caab95fd..e273ab54 100644 --- a/internal/core/hls_http_server.go +++ b/internal/core/hls_http_server.go @@ -12,8 +12,8 @@ import ( "github.com/gin-gonic/gin" "github.com/bluenviron/mediamtx/internal/conf" - "github.com/bluenviron/mediamtx/internal/httpserv" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/httpserv" ) const ( diff --git a/internal/core/metrics.go b/internal/core/metrics.go index 8763c345..6a3c57e3 100644 --- a/internal/core/metrics.go +++ b/internal/core/metrics.go @@ -10,8 +10,8 @@ import ( "github.com/gin-gonic/gin" "github.com/bluenviron/mediamtx/internal/conf" - "github.com/bluenviron/mediamtx/internal/httpserv" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/httpserv" ) func metric(key string, tags string, value int64) string { diff --git a/internal/core/metrics_test.go b/internal/core/metrics_test.go index d09bd85e..0b7a123f 100644 --- a/internal/core/metrics_test.go +++ b/internal/core/metrics_test.go @@ -14,7 +14,7 @@ import ( "github.com/bluenviron/gortsplib/v4/pkg/format" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" ) func TestMetrics(t *testing.T) { diff --git a/internal/core/path_test.go b/internal/core/path_test.go index bf47415a..6366379c 100644 --- a/internal/core/path_test.go +++ b/internal/core/path_test.go @@ -24,8 +24,8 @@ import ( "github.com/pion/rtp" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) var runOnDemandSampleScript = ` diff --git a/internal/core/pprof.go b/internal/core/pprof.go index 9eb87656..3ae13e74 100644 --- a/internal/core/pprof.go +++ b/internal/core/pprof.go @@ -8,8 +8,8 @@ import ( _ "net/http/pprof" "github.com/bluenviron/mediamtx/internal/conf" - "github.com/bluenviron/mediamtx/internal/httpserv" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/httpserv" ) type pprofParent interface { diff --git a/internal/core/rtmp_conn.go b/internal/core/rtmp_conn.go index dbc4b232..e69eb828 100644 --- a/internal/core/rtmp_conn.go +++ b/internal/core/rtmp_conn.go @@ -21,7 +21,7 @@ import ( "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/externalcmd" "github.com/bluenviron/mediamtx/internal/logger" - "github.com/bluenviron/mediamtx/internal/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/unit" ) diff --git a/internal/core/rtmp_server_test.go b/internal/core/rtmp_server_test.go index 04a07cd2..f7c81a7b 100644 --- a/internal/core/rtmp_server_test.go +++ b/internal/core/rtmp_server_test.go @@ -12,7 +12,7 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" ) func TestRTMPServer(t *testing.T) { diff --git a/internal/core/rtmp_source.go b/internal/core/rtmp_source.go index 1c244a64..907eda49 100644 --- a/internal/core/rtmp_source.go +++ b/internal/core/rtmp_source.go @@ -13,7 +13,7 @@ import ( "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/logger" - "github.com/bluenviron/mediamtx/internal/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/unit" ) diff --git a/internal/core/rtmp_source_test.go b/internal/core/rtmp_source_test.go index 480eaf8e..a52f1408 100644 --- a/internal/core/rtmp_source_test.go +++ b/internal/core/rtmp_source_test.go @@ -13,7 +13,7 @@ import ( "github.com/pion/rtp" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp" ) func TestRTMPSource(t *testing.T) { diff --git a/internal/core/webrtc_http_server.go b/internal/core/webrtc_http_server.go index 7d25af9a..a08cb0c9 100644 --- a/internal/core/webrtc_http_server.go +++ b/internal/core/webrtc_http_server.go @@ -16,9 +16,9 @@ import ( pwebrtc "github.com/pion/webrtc/v3" "github.com/bluenviron/mediamtx/internal/conf" - "github.com/bluenviron/mediamtx/internal/httpserv" "github.com/bluenviron/mediamtx/internal/logger" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/httpserv" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) //go:embed webrtc_publish_index.html diff --git a/internal/core/webrtc_manager.go b/internal/core/webrtc_manager.go index 20635366..676f16ad 100644 --- a/internal/core/webrtc_manager.go +++ b/internal/core/webrtc_manager.go @@ -21,7 +21,7 @@ import ( "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/externalcmd" "github.com/bluenviron/mediamtx/internal/logger" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) const ( diff --git a/internal/core/webrtc_manager_test.go b/internal/core/webrtc_manager_test.go index ae3c321a..19ad95f2 100644 --- a/internal/core/webrtc_manager_test.go +++ b/internal/core/webrtc_manager_test.go @@ -16,7 +16,7 @@ import ( pwebrtc "github.com/pion/webrtc/v3" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) func TestWebRTCRead(t *testing.T) { diff --git a/internal/core/webrtc_session.go b/internal/core/webrtc_session.go index 305215c9..aab6ade6 100644 --- a/internal/core/webrtc_session.go +++ b/internal/core/webrtc_session.go @@ -25,9 +25,9 @@ import ( "github.com/bluenviron/mediamtx/internal/asyncwriter" "github.com/bluenviron/mediamtx/internal/externalcmd" "github.com/bluenviron/mediamtx/internal/logger" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/unit" - "github.com/bluenviron/mediamtx/internal/webrtc" ) type webrtcTrackWrapper struct { diff --git a/internal/core/webrtc_source.go b/internal/core/webrtc_source.go index 2c22980a..3008d468 100644 --- a/internal/core/webrtc_source.go +++ b/internal/core/webrtc_source.go @@ -12,7 +12,7 @@ import ( "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/logger" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) type webRTCSourceParent interface { diff --git a/internal/core/webrtc_source_test.go b/internal/core/webrtc_source_test.go index 106c6897..71b697b6 100644 --- a/internal/core/webrtc_source_test.go +++ b/internal/core/webrtc_source_test.go @@ -13,7 +13,7 @@ import ( "github.com/pion/rtp" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/webrtc" + "github.com/bluenviron/mediamtx/internal/protocols/webrtc" ) func TestWebRTCSource(t *testing.T) { diff --git a/internal/httpserv/handler_exit_on_panic.go b/internal/protocols/httpserv/handler_exit_on_panic.go similarity index 100% rename from internal/httpserv/handler_exit_on_panic.go rename to internal/protocols/httpserv/handler_exit_on_panic.go diff --git a/internal/httpserv/handler_filter_requests.go b/internal/protocols/httpserv/handler_filter_requests.go similarity index 100% rename from internal/httpserv/handler_filter_requests.go rename to internal/protocols/httpserv/handler_filter_requests.go diff --git a/internal/httpserv/handler_logger.go b/internal/protocols/httpserv/handler_logger.go similarity index 100% rename from internal/httpserv/handler_logger.go rename to internal/protocols/httpserv/handler_logger.go diff --git a/internal/httpserv/handler_server_header.go b/internal/protocols/httpserv/handler_server_header.go similarity index 100% rename from internal/httpserv/handler_server_header.go rename to internal/protocols/httpserv/handler_server_header.go diff --git a/internal/httpserv/wrapped_server.go b/internal/protocols/httpserv/wrapped_server.go similarity index 100% rename from internal/httpserv/wrapped_server.go rename to internal/protocols/httpserv/wrapped_server.go diff --git a/internal/httpserv/wrapped_server_test.go b/internal/protocols/httpserv/wrapped_server_test.go similarity index 100% rename from internal/httpserv/wrapped_server_test.go rename to internal/protocols/httpserv/wrapped_server_test.go diff --git a/internal/rtmp/bytecounter/reader.go b/internal/protocols/rtmp/bytecounter/reader.go similarity index 100% rename from internal/rtmp/bytecounter/reader.go rename to internal/protocols/rtmp/bytecounter/reader.go diff --git a/internal/rtmp/bytecounter/reader_test.go b/internal/protocols/rtmp/bytecounter/reader_test.go similarity index 100% rename from internal/rtmp/bytecounter/reader_test.go rename to internal/protocols/rtmp/bytecounter/reader_test.go diff --git a/internal/rtmp/bytecounter/readwriter.go b/internal/protocols/rtmp/bytecounter/readwriter.go similarity index 100% rename from internal/rtmp/bytecounter/readwriter.go rename to internal/protocols/rtmp/bytecounter/readwriter.go diff --git a/internal/rtmp/bytecounter/writer.go b/internal/protocols/rtmp/bytecounter/writer.go similarity index 100% rename from internal/rtmp/bytecounter/writer.go rename to internal/protocols/rtmp/bytecounter/writer.go diff --git a/internal/rtmp/bytecounter/writer_test.go b/internal/protocols/rtmp/bytecounter/writer_test.go similarity index 100% rename from internal/rtmp/bytecounter/writer_test.go rename to internal/protocols/rtmp/bytecounter/writer_test.go diff --git a/internal/rtmp/chunk/chunk.go b/internal/protocols/rtmp/chunk/chunk.go similarity index 100% rename from internal/rtmp/chunk/chunk.go rename to internal/protocols/rtmp/chunk/chunk.go diff --git a/internal/rtmp/chunk/chunk0.go b/internal/protocols/rtmp/chunk/chunk0.go similarity index 100% rename from internal/rtmp/chunk/chunk0.go rename to internal/protocols/rtmp/chunk/chunk0.go diff --git a/internal/rtmp/chunk/chunk0_test.go b/internal/protocols/rtmp/chunk/chunk0_test.go similarity index 100% rename from internal/rtmp/chunk/chunk0_test.go rename to internal/protocols/rtmp/chunk/chunk0_test.go diff --git a/internal/rtmp/chunk/chunk1.go b/internal/protocols/rtmp/chunk/chunk1.go similarity index 100% rename from internal/rtmp/chunk/chunk1.go rename to internal/protocols/rtmp/chunk/chunk1.go diff --git a/internal/rtmp/chunk/chunk1_test.go b/internal/protocols/rtmp/chunk/chunk1_test.go similarity index 100% rename from internal/rtmp/chunk/chunk1_test.go rename to internal/protocols/rtmp/chunk/chunk1_test.go diff --git a/internal/rtmp/chunk/chunk2.go b/internal/protocols/rtmp/chunk/chunk2.go similarity index 100% rename from internal/rtmp/chunk/chunk2.go rename to internal/protocols/rtmp/chunk/chunk2.go diff --git a/internal/rtmp/chunk/chunk2_test.go b/internal/protocols/rtmp/chunk/chunk2_test.go similarity index 100% rename from internal/rtmp/chunk/chunk2_test.go rename to internal/protocols/rtmp/chunk/chunk2_test.go diff --git a/internal/rtmp/chunk/chunk3.go b/internal/protocols/rtmp/chunk/chunk3.go similarity index 100% rename from internal/rtmp/chunk/chunk3.go rename to internal/protocols/rtmp/chunk/chunk3.go diff --git a/internal/rtmp/chunk/chunk3_test.go b/internal/protocols/rtmp/chunk/chunk3_test.go similarity index 100% rename from internal/rtmp/chunk/chunk3_test.go rename to internal/protocols/rtmp/chunk/chunk3_test.go diff --git a/internal/rtmp/conn.go b/internal/protocols/rtmp/conn.go similarity index 98% rename from internal/rtmp/conn.go rename to internal/protocols/rtmp/conn.go index 08bb74a6..f81fd0a8 100644 --- a/internal/rtmp/conn.go +++ b/internal/protocols/rtmp/conn.go @@ -9,9 +9,9 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/handshake" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/handshake" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) func resultIsOK1(res *message.CommandAMF0) bool { diff --git a/internal/rtmp/conn_test.go b/internal/protocols/rtmp/conn_test.go similarity index 98% rename from internal/rtmp/conn_test.go rename to internal/protocols/rtmp/conn_test.go index 929385b7..4eb067b9 100644 --- a/internal/rtmp/conn_test.go +++ b/internal/protocols/rtmp/conn_test.go @@ -9,9 +9,9 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/handshake" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/handshake" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) func TestNewClientConn(t *testing.T) { diff --git a/internal/rtmp/h264conf/h264conf.go b/internal/protocols/rtmp/h264conf/h264conf.go similarity index 100% rename from internal/rtmp/h264conf/h264conf.go rename to internal/protocols/rtmp/h264conf/h264conf.go diff --git a/internal/rtmp/h264conf/h264conf_test.go b/internal/protocols/rtmp/h264conf/h264conf_test.go similarity index 100% rename from internal/rtmp/h264conf/h264conf_test.go rename to internal/protocols/rtmp/h264conf/h264conf_test.go diff --git a/internal/rtmp/handshake/c0s0.go b/internal/protocols/rtmp/handshake/c0s0.go similarity index 100% rename from internal/rtmp/handshake/c0s0.go rename to internal/protocols/rtmp/handshake/c0s0.go diff --git a/internal/rtmp/handshake/c0s0_test.go b/internal/protocols/rtmp/handshake/c0s0_test.go similarity index 100% rename from internal/rtmp/handshake/c0s0_test.go rename to internal/protocols/rtmp/handshake/c0s0_test.go diff --git a/internal/rtmp/handshake/c1s1.go b/internal/protocols/rtmp/handshake/c1s1.go similarity index 100% rename from internal/rtmp/handshake/c1s1.go rename to internal/protocols/rtmp/handshake/c1s1.go diff --git a/internal/rtmp/handshake/c1s1_test.go b/internal/protocols/rtmp/handshake/c1s1_test.go similarity index 100% rename from internal/rtmp/handshake/c1s1_test.go rename to internal/protocols/rtmp/handshake/c1s1_test.go diff --git a/internal/rtmp/handshake/c2s2.go b/internal/protocols/rtmp/handshake/c2s2.go similarity index 100% rename from internal/rtmp/handshake/c2s2.go rename to internal/protocols/rtmp/handshake/c2s2.go diff --git a/internal/rtmp/handshake/c2s2_test.go b/internal/protocols/rtmp/handshake/c2s2_test.go similarity index 100% rename from internal/rtmp/handshake/c2s2_test.go rename to internal/protocols/rtmp/handshake/c2s2_test.go diff --git a/internal/rtmp/handshake/dh.go b/internal/protocols/rtmp/handshake/dh.go similarity index 100% rename from internal/rtmp/handshake/dh.go rename to internal/protocols/rtmp/handshake/dh.go diff --git a/internal/rtmp/handshake/handshake.go b/internal/protocols/rtmp/handshake/handshake.go similarity index 100% rename from internal/rtmp/handshake/handshake.go rename to internal/protocols/rtmp/handshake/handshake.go diff --git a/internal/rtmp/handshake/handshake_test.go b/internal/protocols/rtmp/handshake/handshake_test.go similarity index 100% rename from internal/rtmp/handshake/handshake_test.go rename to internal/protocols/rtmp/handshake/handshake_test.go diff --git a/internal/rtmp/message/acknowledge.go b/internal/protocols/rtmp/message/acknowledge.go similarity index 92% rename from internal/rtmp/message/acknowledge.go rename to internal/protocols/rtmp/message/acknowledge.go index 3df1755e..a40f9539 100644 --- a/internal/rtmp/message/acknowledge.go +++ b/internal/protocols/rtmp/message/acknowledge.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // Acknowledge is an acknowledgement message. diff --git a/internal/rtmp/message/audio.go b/internal/protocols/rtmp/message/audio.go similarity index 97% rename from internal/rtmp/message/audio.go rename to internal/protocols/rtmp/message/audio.go index 59725e02..074f8e05 100644 --- a/internal/rtmp/message/audio.go +++ b/internal/protocols/rtmp/message/audio.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) const ( diff --git a/internal/rtmp/message/command_amf0.go b/internal/protocols/rtmp/message/command_amf0.go similarity index 94% rename from internal/rtmp/message/command_amf0.go rename to internal/protocols/rtmp/message/command_amf0.go index 73fb809c..c49dbd3d 100644 --- a/internal/rtmp/message/command_amf0.go +++ b/internal/protocols/rtmp/message/command_amf0.go @@ -5,7 +5,7 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // CommandAMF0 is a AMF0 command message. diff --git a/internal/rtmp/message/data_amf0.go b/internal/protocols/rtmp/message/data_amf0.go similarity index 92% rename from internal/rtmp/message/data_amf0.go rename to internal/protocols/rtmp/message/data_amf0.go index 37708370..b5d30419 100644 --- a/internal/rtmp/message/data_amf0.go +++ b/internal/protocols/rtmp/message/data_amf0.go @@ -3,7 +3,7 @@ package message import ( "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // DataAMF0 is a AMF0 data message. diff --git a/internal/rtmp/message/extended_coded_frames.go b/internal/protocols/rtmp/message/extended_coded_frames.go similarity index 96% rename from internal/rtmp/message/extended_coded_frames.go rename to internal/protocols/rtmp/message/extended_coded_frames.go index c25118c3..79cc6f4d 100644 --- a/internal/rtmp/message/extended_coded_frames.go +++ b/internal/protocols/rtmp/message/extended_coded_frames.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedCodedFrames is a CodedFrames extended message. diff --git a/internal/rtmp/message/extended_frames_x.go b/internal/protocols/rtmp/message/extended_frames_x.go similarity index 94% rename from internal/rtmp/message/extended_frames_x.go rename to internal/protocols/rtmp/message/extended_frames_x.go index 53c823bf..b9b709cd 100644 --- a/internal/rtmp/message/extended_frames_x.go +++ b/internal/protocols/rtmp/message/extended_frames_x.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedFramesX is a FramesX extended message. diff --git a/internal/rtmp/message/extended_metadata.go b/internal/protocols/rtmp/message/extended_metadata.go similarity index 89% rename from internal/rtmp/message/extended_metadata.go rename to internal/protocols/rtmp/message/extended_metadata.go index 2a35cf79..e2d0bb5a 100644 --- a/internal/rtmp/message/extended_metadata.go +++ b/internal/protocols/rtmp/message/extended_metadata.go @@ -3,7 +3,7 @@ package message import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedMetadata is a metadata extended message. diff --git a/internal/rtmp/message/extended_mpeg2ts_sequence_start.go b/internal/protocols/rtmp/message/extended_mpeg2ts_sequence_start.go similarity index 90% rename from internal/rtmp/message/extended_mpeg2ts_sequence_start.go rename to internal/protocols/rtmp/message/extended_mpeg2ts_sequence_start.go index d0546f23..04e7d848 100644 --- a/internal/rtmp/message/extended_mpeg2ts_sequence_start.go +++ b/internal/protocols/rtmp/message/extended_mpeg2ts_sequence_start.go @@ -3,7 +3,7 @@ package message import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedMPEG2TSSequenceStart is a MPEG2-TS sequence start extended message. diff --git a/internal/rtmp/message/extended_sequence_end.go b/internal/protocols/rtmp/message/extended_sequence_end.go similarity index 89% rename from internal/rtmp/message/extended_sequence_end.go rename to internal/protocols/rtmp/message/extended_sequence_end.go index c36997ba..8a2d6321 100644 --- a/internal/rtmp/message/extended_sequence_end.go +++ b/internal/protocols/rtmp/message/extended_sequence_end.go @@ -3,7 +3,7 @@ package message import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedSequenceEnd is a sequence end extended message. diff --git a/internal/rtmp/message/extended_sequence_start.go b/internal/protocols/rtmp/message/extended_sequence_start.go similarity index 94% rename from internal/rtmp/message/extended_sequence_start.go rename to internal/protocols/rtmp/message/extended_sequence_start.go index 87c62b83..35faa9cc 100644 --- a/internal/rtmp/message/extended_sequence_start.go +++ b/internal/protocols/rtmp/message/extended_sequence_start.go @@ -3,7 +3,7 @@ package message import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // ExtendedSequenceStart is a sequence start extended message. diff --git a/internal/rtmp/message/message.go b/internal/protocols/rtmp/message/message.go similarity index 96% rename from internal/rtmp/message/message.go rename to internal/protocols/rtmp/message/message.go index 92df1f09..3f82fe75 100644 --- a/internal/rtmp/message/message.go +++ b/internal/protocols/rtmp/message/message.go @@ -2,7 +2,7 @@ package message import ( - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) const ( diff --git a/internal/rtmp/message/reader.go b/internal/protocols/rtmp/message/reader.go similarity index 95% rename from internal/rtmp/message/reader.go rename to internal/protocols/rtmp/message/reader.go index 731655d5..7b5654f8 100644 --- a/internal/rtmp/message/reader.go +++ b/internal/protocols/rtmp/message/reader.go @@ -4,8 +4,8 @@ import ( "fmt" "io" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) func allocateMessage(raw *rawmessage.Message) (Message, error) { diff --git a/internal/rtmp/message/reader_test.go b/internal/protocols/rtmp/message/reader_test.go similarity index 98% rename from internal/rtmp/message/reader_test.go rename to internal/protocols/rtmp/message/reader_test.go index cb71ecd7..1add82a8 100644 --- a/internal/rtmp/message/reader_test.go +++ b/internal/protocols/rtmp/message/reader_test.go @@ -8,7 +8,7 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" ) var readWriterCases = []struct { diff --git a/internal/rtmp/message/readwriter.go b/internal/protocols/rtmp/message/readwriter.go similarity index 93% rename from internal/rtmp/message/readwriter.go rename to internal/protocols/rtmp/message/readwriter.go index e0755c63..fe568807 100644 --- a/internal/rtmp/message/readwriter.go +++ b/internal/protocols/rtmp/message/readwriter.go @@ -3,7 +3,7 @@ package message import ( "io" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" ) // ReadWriter is a message reader/writer. diff --git a/internal/rtmp/message/readwriter_test.go b/internal/protocols/rtmp/message/readwriter_test.go similarity index 95% rename from internal/rtmp/message/readwriter_test.go rename to internal/protocols/rtmp/message/readwriter_test.go index 54327c8c..696ed3e2 100644 --- a/internal/rtmp/message/readwriter_test.go +++ b/internal/protocols/rtmp/message/readwriter_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" ) type duplexRW struct { diff --git a/internal/rtmp/message/set_chunk_size.go b/internal/protocols/rtmp/message/set_chunk_size.go similarity index 92% rename from internal/rtmp/message/set_chunk_size.go rename to internal/protocols/rtmp/message/set_chunk_size.go index 2b7f88fd..6eb9251a 100644 --- a/internal/rtmp/message/set_chunk_size.go +++ b/internal/protocols/rtmp/message/set_chunk_size.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // SetChunkSize is a set chunk size message. diff --git a/internal/rtmp/message/set_peer_bandwidth.go b/internal/protocols/rtmp/message/set_peer_bandwidth.go similarity index 93% rename from internal/rtmp/message/set_peer_bandwidth.go rename to internal/protocols/rtmp/message/set_peer_bandwidth.go index c1731540..3f739412 100644 --- a/internal/rtmp/message/set_peer_bandwidth.go +++ b/internal/protocols/rtmp/message/set_peer_bandwidth.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // SetPeerBandwidth is a set peer bandwidth message. diff --git a/internal/rtmp/message/set_window_ack_size.go b/internal/protocols/rtmp/message/set_window_ack_size.go similarity index 93% rename from internal/rtmp/message/set_window_ack_size.go rename to internal/protocols/rtmp/message/set_window_ack_size.go index 566bbb70..6cbaa314 100644 --- a/internal/rtmp/message/set_window_ack_size.go +++ b/internal/protocols/rtmp/message/set_window_ack_size.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // SetWindowAckSize is a set window acknowledgement message. diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/05d2521061b772dd diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/06f5bdb4e0ba6885 diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/2fb5da434799f2aa diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/420fac969d79c3d0 diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/6b1d357b508b38a4 diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/b18a01392c7c91e9 diff --git a/internal/rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f b/internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f similarity index 100% rename from internal/rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f rename to internal/protocols/rtmp/message/testdata/fuzz/FuzzReader/f244ff2f55d1103f diff --git a/internal/rtmp/message/user_control_ping_request.go b/internal/protocols/rtmp/message/user_control_ping_request.go similarity index 93% rename from internal/rtmp/message/user_control_ping_request.go rename to internal/protocols/rtmp/message/user_control_ping_request.go index db69bb77..c5056d29 100644 --- a/internal/rtmp/message/user_control_ping_request.go +++ b/internal/protocols/rtmp/message/user_control_ping_request.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlPingRequest is a user control message. diff --git a/internal/rtmp/message/user_control_ping_response.go b/internal/protocols/rtmp/message/user_control_ping_response.go similarity index 93% rename from internal/rtmp/message/user_control_ping_response.go rename to internal/protocols/rtmp/message/user_control_ping_response.go index 288b555e..dbcaebd5 100644 --- a/internal/rtmp/message/user_control_ping_response.go +++ b/internal/protocols/rtmp/message/user_control_ping_response.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlPingResponse is a user control message. diff --git a/internal/rtmp/message/user_control_set_buffer_length.go b/internal/protocols/rtmp/message/user_control_set_buffer_length.go similarity index 95% rename from internal/rtmp/message/user_control_set_buffer_length.go rename to internal/protocols/rtmp/message/user_control_set_buffer_length.go index ce7d4793..c9fabece 100644 --- a/internal/rtmp/message/user_control_set_buffer_length.go +++ b/internal/protocols/rtmp/message/user_control_set_buffer_length.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlSetBufferLength is a user control message. diff --git a/internal/rtmp/message/user_control_stream_begin.go b/internal/protocols/rtmp/message/user_control_stream_begin.go similarity index 93% rename from internal/rtmp/message/user_control_stream_begin.go rename to internal/protocols/rtmp/message/user_control_stream_begin.go index 14672b72..ef08d7be 100644 --- a/internal/rtmp/message/user_control_stream_begin.go +++ b/internal/protocols/rtmp/message/user_control_stream_begin.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlStreamBegin is a user control message. diff --git a/internal/rtmp/message/user_control_stream_dry.go b/internal/protocols/rtmp/message/user_control_stream_dry.go similarity index 93% rename from internal/rtmp/message/user_control_stream_dry.go rename to internal/protocols/rtmp/message/user_control_stream_dry.go index a5460423..f9feaaaf 100644 --- a/internal/rtmp/message/user_control_stream_dry.go +++ b/internal/protocols/rtmp/message/user_control_stream_dry.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlStreamDry is a user control message. diff --git a/internal/rtmp/message/user_control_stream_eof.go b/internal/protocols/rtmp/message/user_control_stream_eof.go similarity index 93% rename from internal/rtmp/message/user_control_stream_eof.go rename to internal/protocols/rtmp/message/user_control_stream_eof.go index a2cd9857..83dd2c94 100644 --- a/internal/rtmp/message/user_control_stream_eof.go +++ b/internal/protocols/rtmp/message/user_control_stream_eof.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlStreamEOF is a user control message. diff --git a/internal/rtmp/message/user_control_stream_is_recorded.go b/internal/protocols/rtmp/message/user_control_stream_is_recorded.go similarity index 94% rename from internal/rtmp/message/user_control_stream_is_recorded.go rename to internal/protocols/rtmp/message/user_control_stream_is_recorded.go index 9a605b37..b63d4e53 100644 --- a/internal/rtmp/message/user_control_stream_is_recorded.go +++ b/internal/protocols/rtmp/message/user_control_stream_is_recorded.go @@ -3,7 +3,7 @@ package message //nolint:dupl import ( "fmt" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // UserControlStreamIsRecorded is a user control message. diff --git a/internal/rtmp/message/video.go b/internal/protocols/rtmp/message/video.go similarity index 96% rename from internal/rtmp/message/video.go rename to internal/protocols/rtmp/message/video.go index 8401a5a4..239bbff7 100644 --- a/internal/rtmp/message/video.go +++ b/internal/protocols/rtmp/message/video.go @@ -6,7 +6,7 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) const ( diff --git a/internal/rtmp/message/writer.go b/internal/protocols/rtmp/message/writer.go similarity index 85% rename from internal/rtmp/message/writer.go rename to internal/protocols/rtmp/message/writer.go index a0ad2fdf..fc8e0c8e 100644 --- a/internal/rtmp/message/writer.go +++ b/internal/protocols/rtmp/message/writer.go @@ -3,8 +3,8 @@ package message import ( "io" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/rawmessage" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/rawmessage" ) // Writer is a message writer. diff --git a/internal/rtmp/message/writer_test.go b/internal/protocols/rtmp/message/writer_test.go similarity index 84% rename from internal/rtmp/message/writer_test.go rename to internal/protocols/rtmp/message/writer_test.go index 178a5b64..d4eb2395 100644 --- a/internal/rtmp/message/writer_test.go +++ b/internal/protocols/rtmp/message/writer_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" ) func TestWriter(t *testing.T) { diff --git a/internal/rtmp/rawmessage/message.go b/internal/protocols/rtmp/rawmessage/message.go similarity index 100% rename from internal/rtmp/rawmessage/message.go rename to internal/protocols/rtmp/rawmessage/message.go diff --git a/internal/rtmp/rawmessage/reader.go b/internal/protocols/rtmp/rawmessage/reader.go similarity index 98% rename from internal/rtmp/rawmessage/reader.go rename to internal/protocols/rtmp/rawmessage/reader.go index d4e691ad..63513687 100644 --- a/internal/rtmp/rawmessage/reader.go +++ b/internal/protocols/rtmp/rawmessage/reader.go @@ -7,8 +7,8 @@ import ( "io" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/chunk" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/chunk" ) var errMoreChunksNeeded = errors.New("more chunks are needed") diff --git a/internal/rtmp/rawmessage/reader_test.go b/internal/protocols/rtmp/rawmessage/reader_test.go similarity index 97% rename from internal/rtmp/rawmessage/reader_test.go rename to internal/protocols/rtmp/rawmessage/reader_test.go index 35f6dd13..43ac2f51 100644 --- a/internal/rtmp/rawmessage/reader_test.go +++ b/internal/protocols/rtmp/rawmessage/reader_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/chunk" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/chunk" ) var cases = []struct { diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/19981bffc2abbaf1 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2470f01dca6d27ef diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/2c0aa0d43cf2378b diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/3225fb43d226570f diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/582528ddfad69eb5 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/649388b35b8d7d24 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/899c4ec5c6184841 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/a2d2a54b9b1b0098 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/ab461fd3f1e0b76d diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/cf0f70a31328c9ba diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzDecoder/f5aad145f6286289 diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/2a3abe67115a80dc diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/321edca93ba341df diff --git a/internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 b/internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 similarity index 100% rename from internal/rtmp/rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 rename to internal/protocols/rtmp/rawmessage/testdata/fuzz/FuzzReader/7f07c167964a9467 diff --git a/internal/rtmp/rawmessage/writer.go b/internal/protocols/rtmp/rawmessage/writer.go similarity index 97% rename from internal/rtmp/rawmessage/writer.go rename to internal/protocols/rtmp/rawmessage/writer.go index 790b3c72..62ad748c 100644 --- a/internal/rtmp/rawmessage/writer.go +++ b/internal/protocols/rtmp/rawmessage/writer.go @@ -6,8 +6,8 @@ import ( "io" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/chunk" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/chunk" ) type writerChunkStream struct { diff --git a/internal/rtmp/rawmessage/writer_test.go b/internal/protocols/rtmp/rawmessage/writer_test.go similarity index 91% rename from internal/rtmp/rawmessage/writer_test.go rename to internal/protocols/rtmp/rawmessage/writer_test.go index 7987ff99..ce1ebfb6 100644 --- a/internal/rtmp/rawmessage/writer_test.go +++ b/internal/protocols/rtmp/rawmessage/writer_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/chunk" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/chunk" "github.com/stretchr/testify/require" ) diff --git a/internal/rtmp/rc4_readwriter.go b/internal/protocols/rtmp/rc4_readwriter.go similarity index 100% rename from internal/rtmp/rc4_readwriter.go rename to internal/protocols/rtmp/rc4_readwriter.go diff --git a/internal/rtmp/reader.go b/internal/protocols/rtmp/reader.go similarity index 99% rename from internal/rtmp/reader.go rename to internal/protocols/rtmp/reader.go index 3353811a..d6d3d746 100644 --- a/internal/rtmp/reader.go +++ b/internal/protocols/rtmp/reader.go @@ -13,8 +13,8 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/h264conf" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/h264conf" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) // OnDataAV1Func is the prototype of the callback passed to OnDataAV1(). diff --git a/internal/rtmp/reader_test.go b/internal/protocols/rtmp/reader_test.go similarity index 98% rename from internal/rtmp/reader_test.go rename to internal/protocols/rtmp/reader_test.go index cae91092..029bde28 100644 --- a/internal/rtmp/reader_test.go +++ b/internal/protocols/rtmp/reader_test.go @@ -13,9 +13,9 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/h264conf" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/h264conf" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) func TestReadTracks(t *testing.T) { diff --git a/internal/rtmp/writer.go b/internal/protocols/rtmp/writer.go similarity index 97% rename from internal/rtmp/writer.go rename to internal/protocols/rtmp/writer.go index ded99415..fbb69909 100644 --- a/internal/rtmp/writer.go +++ b/internal/protocols/rtmp/writer.go @@ -9,8 +9,8 @@ import ( "github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio" "github.com/notedit/rtmp/format/flv/flvio" - "github.com/bluenviron/mediamtx/internal/rtmp/h264conf" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/h264conf" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) func mpeg1AudioRate(sr int) uint8 { diff --git a/internal/rtmp/writer_test.go b/internal/protocols/rtmp/writer_test.go similarity index 94% rename from internal/rtmp/writer_test.go rename to internal/protocols/rtmp/writer_test.go index 26c6eed2..9f3e532c 100644 --- a/internal/rtmp/writer_test.go +++ b/internal/protocols/rtmp/writer_test.go @@ -9,8 +9,8 @@ import ( "github.com/notedit/rtmp/format/flv/flvio" "github.com/stretchr/testify/require" - "github.com/bluenviron/mediamtx/internal/rtmp/bytecounter" - "github.com/bluenviron/mediamtx/internal/rtmp/message" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/bytecounter" + "github.com/bluenviron/mediamtx/internal/protocols/rtmp/message" ) func TestWriteTracks(t *testing.T) { diff --git a/internal/webrtc/api.go b/internal/protocols/webrtc/api.go similarity index 100% rename from internal/webrtc/api.go rename to internal/protocols/webrtc/api.go diff --git a/internal/webrtc/ice_fragment.go b/internal/protocols/webrtc/ice_fragment.go similarity index 100% rename from internal/webrtc/ice_fragment.go rename to internal/protocols/webrtc/ice_fragment.go diff --git a/internal/webrtc/ice_fragment_test.go b/internal/protocols/webrtc/ice_fragment_test.go similarity index 100% rename from internal/webrtc/ice_fragment_test.go rename to internal/protocols/webrtc/ice_fragment_test.go diff --git a/internal/webrtc/incoming_track.go b/internal/protocols/webrtc/incoming_track.go similarity index 100% rename from internal/webrtc/incoming_track.go rename to internal/protocols/webrtc/incoming_track.go diff --git a/internal/webrtc/link_header.go b/internal/protocols/webrtc/link_header.go similarity index 100% rename from internal/webrtc/link_header.go rename to internal/protocols/webrtc/link_header.go diff --git a/internal/webrtc/link_header_test.go b/internal/protocols/webrtc/link_header_test.go similarity index 100% rename from internal/webrtc/link_header_test.go rename to internal/protocols/webrtc/link_header_test.go diff --git a/internal/webrtc/outgoing_track.go b/internal/protocols/webrtc/outgoing_track.go similarity index 100% rename from internal/webrtc/outgoing_track.go rename to internal/protocols/webrtc/outgoing_track.go diff --git a/internal/webrtc/peer_connection.go b/internal/protocols/webrtc/peer_connection.go similarity index 100% rename from internal/webrtc/peer_connection.go rename to internal/protocols/webrtc/peer_connection.go diff --git a/internal/webrtc/track_count.go b/internal/protocols/webrtc/track_count.go similarity index 100% rename from internal/webrtc/track_count.go rename to internal/protocols/webrtc/track_count.go diff --git a/internal/webrtc/webrtc.go b/internal/protocols/webrtc/webrtc.go similarity index 100% rename from internal/webrtc/webrtc.go rename to internal/protocols/webrtc/webrtc.go diff --git a/internal/webrtc/whip_client.go b/internal/protocols/webrtc/whip_client.go similarity index 100% rename from internal/webrtc/whip_client.go rename to internal/protocols/webrtc/whip_client.go diff --git a/internal/webrtc/whip_delete_session.go b/internal/protocols/webrtc/whip_delete_session.go similarity index 100% rename from internal/webrtc/whip_delete_session.go rename to internal/protocols/webrtc/whip_delete_session.go diff --git a/internal/webrtc/whip_options_ice_servers.go b/internal/protocols/webrtc/whip_options_ice_servers.go similarity index 100% rename from internal/webrtc/whip_options_ice_servers.go rename to internal/protocols/webrtc/whip_options_ice_servers.go diff --git a/internal/webrtc/whip_patch_candidate.go b/internal/protocols/webrtc/whip_patch_candidate.go similarity index 100% rename from internal/webrtc/whip_patch_candidate.go rename to internal/protocols/webrtc/whip_patch_candidate.go diff --git a/internal/webrtc/whip_post_offer.go b/internal/protocols/webrtc/whip_post_offer.go similarity index 100% rename from internal/webrtc/whip_post_offer.go rename to internal/protocols/webrtc/whip_post_offer.go diff --git a/internal/websocket/serverconn.go b/internal/protocols/websocket/serverconn.go similarity index 100% rename from internal/websocket/serverconn.go rename to internal/protocols/websocket/serverconn.go diff --git a/internal/websocket/serverconn_test.go b/internal/protocols/websocket/serverconn_test.go similarity index 100% rename from internal/websocket/serverconn_test.go rename to internal/protocols/websocket/serverconn_test.go