mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Resolution switching support
This commit is contained in:
29
Model/Stream.swift
Normal file
29
Model/Stream.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
import AVFoundation
|
||||
import Foundation
|
||||
|
||||
// swiftlint:disable:next final_class
|
||||
class Stream: Equatable {
|
||||
var audioAsset: AVURLAsset
|
||||
var videoAsset: AVURLAsset
|
||||
|
||||
var resolution: StreamResolution
|
||||
var type: StreamType
|
||||
|
||||
var encoding: String
|
||||
|
||||
init(audioAsset: AVURLAsset, videoAsset: AVURLAsset, resolution: StreamResolution, type: StreamType, encoding: String) {
|
||||
self.audioAsset = audioAsset
|
||||
self.videoAsset = videoAsset
|
||||
self.resolution = resolution
|
||||
self.type = type
|
||||
self.encoding = encoding
|
||||
}
|
||||
|
||||
var description: String {
|
||||
"\(resolution.height)p"
|
||||
}
|
||||
|
||||
static func == (lhs: Stream, rhs: Stream) -> Bool {
|
||||
lhs.resolution == rhs.resolution && lhs.type == rhs.type
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user