-
-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,423 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import HaishinKit | ||
import MoQTHaishinKit | ||
|
||
public actor MoxygenChatClient { | ||
public private(set) var isRunning: Bool = false | ||
private let uri: String | ||
private lazy var connection = MoQTConnection(.pubSub) | ||
|
||
public init(_ uri: String) { | ||
self.uri = uri | ||
} | ||
} | ||
|
||
extension MoxygenChatClient: AsyncRunner { | ||
public func startRunning() { | ||
Task { | ||
do { | ||
let setUp = try await connection.connect(uri) | ||
print(try await connection.annouce(["shogo4405/1000/0"], authInfo: "test")) | ||
print(try await connection.subscribeAnnouces(["shogo4405/1000/0"], authInfo: "test")) | ||
} catch { | ||
print(error) | ||
} | ||
} | ||
} | ||
|
||
public func stopRunning() { | ||
Task { | ||
await connection.close() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#import <Foundation/Foundation.h> | ||
FOUNDATION_EXPORT double MoQTHaishinKitVersionNumber; | ||
FOUNDATION_EXPORT const unsigned char MoQTHaishinKitVersionString[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# MoQTHaishinKit | ||
- This is a Swift implementation of MoQT, based on draft7. It is being developed for research and testing purposes. | ||
- The features for live streaming and viewing have not been implemented yet, so testing is not possible at this time. | ||
|
||
## Control Messages | ||
- [x] 6.2. CLIENT_SETUP | ||
- [x] 6.2. SERVER_SETUP | ||
- [ ] 6.3. GOAWAY | ||
- [x] 6.4. SUBSCRIBE | ||
- [x] 6.5. SUBSCRIBE_UPDATE | ||
- [ ] 6.6. UNSUBSCRIBE | ||
- [ ] 6.7. FETCH | ||
- [ ] 6.8. FETCH_CANCEL | ||
- [x] 6.9. ANNOUNCE_OK | ||
- [x] 6.10. ANNOUNCE_ERROR | ||
- [ ] 6.11. ANNOUNCE_CANCEL | ||
- [ ] 6.12. TRACK_STATUS_REQUEST | ||
- [ ] 6.13. SUBSCRIBE_ANNOUNCES | ||
- [ ] 6.14. UNSUBSCRIBE_ANNOUNCES | ||
- [x] 6.15. SUBSCRIBE_OK | ||
- [x] 6.16. SUBSCRIBE_ERROR | ||
- [ ] 6.17. FETCH_OK | ||
- [ ] 6.18. FETCH_ERROR | ||
- [ ] 6.19. SUBSCRIBE_DONE | ||
- [ ] 6.20. MAX_SUBSCRIBE_ID | ||
- [x] 6.21. ANNOUNCE | ||
- [ ] 6.22. UNANNOUNCE | ||
- [ ] 6.23. TRACK_STATUS | ||
- [x] 6.24. SUBSCRIBE_ANNOUNCES_OK | ||
- [x] 6.25. SUBSCRIBE_ANNOUNCES_ERROR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Logboard | ||
|
||
nonisolated(unsafe) let logger = LBLogger.with("com.haishinkit.SRTHaishinKit") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import CoreMedia | ||
import Foundation | ||
|
||
extension Data { | ||
var bytes: [UInt8] { | ||
withUnsafeBytes { | ||
guard let pointer = $0.baseAddress?.assumingMemoryBound(to: UInt8.self) else { | ||
return [] | ||
} | ||
return [UInt8](UnsafeBufferPointer(start: pointer, count: count)) | ||
} | ||
} | ||
} |
Oops, something went wrong.