From 5fff055f351f44cd6508f41d8e83d30b037bd5ae Mon Sep 17 00:00:00 2001 From: shogo4405 Date: Mon, 9 Oct 2023 22:03:16 +0900 Subject: [PATCH] Remove HLSService feature. --- Examples/iOS/NetStreamSwitcher.swift | 17 -- Examples/iOSSwiftUI/Model/ViewModel.swift | 2 +- Examples/macOS/Base.lproj/Main.storyboard | 11 +- .../macOS/CameraPublishViewController.swift | 16 -- HaishinKit.xcodeproj/project.pbxproj | 32 --- README.md | 23 -- Sources/HTTP/HLSService.swift | 91 ------ Sources/HTTP/HTTPRequest.swift | 82 ------ Sources/HTTP/HTTPResponse.swift | 83 ------ Sources/HTTP/HTTPService.swift | 270 ------------------ Sources/HTTP/HTTPStream.swift | 72 ----- Sources/HTTP/M3U.swift | 37 --- Sources/MPEG/TSWriter.swift | 123 -------- Tests/Media/IOAudioRingBufferTests.swift | 3 +- 14 files changed, 8 insertions(+), 854 deletions(-) delete mode 100644 Sources/HTTP/HLSService.swift delete mode 100644 Sources/HTTP/HTTPRequest.swift delete mode 100644 Sources/HTTP/HTTPResponse.swift delete mode 100644 Sources/HTTP/HTTPService.swift delete mode 100644 Sources/HTTP/HTTPStream.swift delete mode 100644 Sources/HTTP/M3U.swift diff --git a/Examples/iOS/NetStreamSwitcher.swift b/Examples/iOS/NetStreamSwitcher.swift index 6222d4cb3..0e7c7fb11 100644 --- a/Examples/iOS/NetStreamSwitcher.swift +++ b/Examples/iOS/NetStreamSwitcher.swift @@ -8,7 +8,6 @@ final class NetStreamSwitcher { enum Mode { case rtmp case srt - case http func makeStream(_ swithcer: NetStreamSwitcher) -> NetStream { switch self { @@ -20,20 +19,12 @@ final class NetStreamSwitcher { let connection = SRTConnection() swithcer.connection = connection return SRTStream(connection: connection) - case .http: - let service = HLSService(domain: "localhost", type: "_http._tcp", name: "HaishinKit", port: 8080) - swithcer.connection = service - return HTTPStream() } } } var uri = "" { didSet { - if uri.contains("http://") { - mode = .http - return - } if uri.contains("srt://") { mode = .srt return @@ -65,12 +56,6 @@ final class NetStreamSwitcher { } connection.open(URL(string: uri)) stream.publish("") - case .http: - guard let connection = connection as? HLSService, let stream = stream as? HTTPStream else { - return - } - connection.addHTTPStream(stream) - connection.startRunning() } } @@ -86,8 +71,6 @@ final class NetStreamSwitcher { case .srt: (stream as? SRTStream)?.close() (connection as? SRTConnection)?.close() - case .http: - break } } diff --git a/Examples/iOSSwiftUI/Model/ViewModel.swift b/Examples/iOSSwiftUI/Model/ViewModel.swift index a19c6d564..b76d9cd45 100644 --- a/Examples/iOSSwiftUI/Model/ViewModel.swift +++ b/Examples/iOSSwiftUI/Model/ViewModel.swift @@ -192,7 +192,7 @@ final class ViewModel: ObservableObject { } func changeVideoRate(level: CGFloat) { - rtmpStream.videoSettings.bitRate = UInt32(level * 1000) + rtmpStream.videoSettings.bitRate = Int(level * 1000) } func changeAudioRate(level: CGFloat) { diff --git a/Examples/macOS/Base.lproj/Main.storyboard b/Examples/macOS/Base.lproj/Main.storyboard index b06abb588..392e77308 100644 --- a/Examples/macOS/Base.lproj/Main.storyboard +++ b/Examples/macOS/Base.lproj/Main.storyboard @@ -79,7 +79,7 @@ - + @@ -87,7 +87,6 @@ - @@ -223,13 +222,13 @@ - + - + - + @@ -280,7 +279,7 @@