Files
MatchLiveTv/native/ios/MatchLiveTv/Streaming/BroadcastModels.swift
T
eminuxandCursor 061b7fad8b Merge branch 'feature/adaptive-bitrate' into collaudo
Integra bitrate adattivo e telemetria, con il mute audio come icona nella toolbar della regia.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-13 20:16:26 +02:00

34 lines
934 B
Swift

import Foundation
/// Profilo RTMP allineato a MediaMTX slate + YoutubeRelay (copy A/V).
/// Audio: AAC 48 kHz mono 128 kbps.
struct BroadcastConfig: Sendable {
let rtmpUrl: String
var width: Int = 1280
var height: Int = 720
var videoBitrate: Int = 2_500_000
var minVideoBitrate: Int = 800_000
var audioBitrate: Int = 128_000
var fps: Int = 30
var rotation: Int = 0
var portrait: Bool = false
var maxReconnectAttempts: Int = 10
var reconnectDelayMs: Int = 5_000
static let audioSampleRateHz: Float64 = 48_000
static let audioChannels: UInt32 = 1
}
enum BroadcastPhase: String, Sendable {
case idle, preview, connecting, live, paused, reconnecting, error
}
struct BroadcastMetrics: Sendable {
var phase: BroadcastPhase = .idle
var bitrateKbps: Int = 0
var fps: Int = 0
var connected: Bool = false
var lastError: String?
var audioMuted: Bool = false
}