Skip to content

Commit

Permalink
Merge pull request #205 from dolbyio-samples/bugfix/parsing-audio-stats
Browse files Browse the repository at this point in the history
Bugfix/parsing audio stats
  • Loading branch information
aravind-raveendran authored Aug 19, 2024
2 parents 5e3756f + a231f6b commit 27044ad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class MillicastLogHandler: NSObject {
override init() {
super.init()
MCLogger.setDelegate(self)
MCLogger.setLogLevelWithSdk(.DEBUG, webrtc: .OFF, websocket: .OFF)
MCLogger.setLogLevelWithSdk(.debug, webrtc: .off, websocket: .off)
}

func setLogFilePath(filePath: String?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public actor SubscriptionManager {

@Published public var state: State = .disconnected
@Published public var streamStatistics: StreamStatistics?
@Published public var websocketState: MCConnectionState = .IDLE
@Published public var websocketState: MCConnectionState = .idle

private let subscriber = MCSubscriber()
private var sourceBuilder = SourceBuilder()
Expand Down Expand Up @@ -131,9 +131,9 @@ extension SubscriptionManager {
let taskPeerConnectionStateObservation = Task {
for await state in subscriber.peerConnectionState() {
Self.logger.debug("👨‍🔧 Peer connection state changed to \(state.rawValue)")
if state == .CONNECTING {
if state == .connecting {
setReconnectingPeerConnection(true)
} else if state == .CONNECTED && isReconnectingPeerConnection && !sourceBuilder.sources.isEmpty {
} else if state == .connected && isReconnectingPeerConnection && !sourceBuilder.sources.isEmpty {
Self.logger.debug("👨‍🔧 Peer connection restored")
updateState(to: .subscribed(sources: sourceBuilder.sources))
setReconnectingPeerConnection(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private extension StatsInfoViewModel {
return []
}

let audioStatsInboundRtp = streamStatistics.inboundAudioStatistics(matching: mid)
let audioStatsInboundRtp = streamStatistics.audioStatsInboundRtpList.first

var result = [StatsItem]()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private extension StreamViewModel {
await self.subscriptionManager.$websocketState
.sink { websocketState in
switch websocketState {
case .CONNECTED:
case .connected:
self.isWebsocketConnected = true
default:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/millicast/millicast-sdk-swift-package",
"state" : {
"revision" : "320331b070210fd41818e2e9459c2631991b6c16",
"version" : "2.0.0-beta.5"
"revision" : "650bda49e494524b53531dedbd29b60a13477418",
"version" : "2.0.0-beta.6"
}
}
],
Expand Down

0 comments on commit 27044ad

Please sign in to comment.