mirror of
https://github.com/HaishinKit/HaishinKit.swift.git
synced 2026-05-07 20:12:28 +00:00
22 lines
719 B
Swift
22 lines
719 B
Swift
import AVFoundation
|
|
import Foundation
|
|
import Testing
|
|
|
|
@testable import RTMPHaishinKit
|
|
|
|
@Suite struct RTMPVideoFourCCTests {
|
|
@Test func main() {
|
|
#expect("av01" == str4(n: Int(RTMPVideoFourCC.av1.rawValue)))
|
|
#expect("hvc1" == str4(n: Int(RTMPVideoFourCC.hevc.rawValue)))
|
|
#expect("vp09" == str4(n: Int(RTMPVideoFourCC.vp9.rawValue)))
|
|
}
|
|
|
|
func str4(n: Int) -> String {
|
|
var result = String(UnicodeScalar((n >> 24) & 255)?.description ?? "")
|
|
result.append(UnicodeScalar((n >> 16) & 255)?.description ?? "")
|
|
result.append(UnicodeScalar((n >> 8) & 255)?.description ?? "")
|
|
result.append(UnicodeScalar(n & 255)?.description ?? "")
|
|
return result
|
|
}
|
|
}
|