将 otg_swift OTG 引擎迁入 Core/CameraOTG,并接入旅拍有线传图与历史导入。

恢复 USB 相机连接、边拍边传、三品牌驱动与 SwiftUI 历史导入页,通过适配层对接现有本地上传与 OSS 管道。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-06 11:22:07 +08:00
parent d7fec35715
commit be9c844bd3
50 changed files with 5721 additions and 20 deletions

View File

@ -0,0 +1,43 @@
import Foundation
///
struct SavedOTGPhoto: Equatable {
let assetID: String
let relativeLocalPath: String
let filename: String
let capturedAt: Date
}
/// 线 start ConnectionManager
struct OTGLiveTransferContext: Equatable {
let albumId: Int
let accountKey: String
weak var photoSink: OTGPhotoSink?
static func == (lhs: OTGLiveTransferContext, rhs: OTGLiveTransferContext) -> Bool {
lhs.albumId == rhs.albumId && lhs.accountKey == rhs.accountKey
}
}
/// OTG LiveCapture
@MainActor
protocol OTGPhotoSink: AnyObject {
///
func saveLiveShot(
data: Data,
filename: String,
capturedAt: Date,
cameraObjectID: String
) async throws -> SavedOTGPhoto
///
func saveDownloadedFile(
at url: URL,
filename: String,
capturedAt: Date,
cameraObjectID: String
) async throws -> SavedOTGPhoto
/// ID
func existingCameraObjectIDs() async -> Set<String>
}