yumoqing 71d321b056 refactor: 跨平台架构 (macOS+iOS)
- StreamRecorderKit: 跨平台库
  - StreamRecorderEngine: 协议+类型
  - HLSVariantResolver: HLS master 解析
  - FFmpegRecorder: macOS (Process+ffmpeg)
  - AVFoundationRecorder: iOS (AVAssetReader+Writer)
  - RecorderFactory: 平台工厂
- StreamRecorder: CLI 入口
- 15秒录制测试通过
2026-06-28 17:49:12 +08:00

29 lines
725 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Foundation
///
public struct RecorderFactory {
///
/// - Returns: macOS FFmpegRecorderiOS AVFoundationRecorder
public static func createRecorder() -> StreamRecorderEngine {
#if os(macOS)
return FFmpegRecorder()
#elseif os(iOS)
return AVFoundationRecorder()
#else
fatalError("不支持的平台")
#endif
}
///
public static var platformInfo: String {
#if os(macOS)
return "macOS (FFmpeg)"
#elseif os(iOS)
return "iOS (AVFoundation)"
#else
return "Unknown"
#endif
}
}