@@ -460,15 +460,15 @@ public func ==(lhs: HLSCodecArray, rhs: HLSCodecArray) -> Bool {
460
460
public struct HLSVideoLayout : Equatable , FailableStringLiteralConvertible {
461
461
/// Each specifier controls one aspect of the entry. That is, the specifiers are disjoint and the values for a
462
462
/// specifier are mutually exclusive.
463
- public let layouts : [ VideoLayout ]
463
+ public let layouts : [ VideoLayoutIdentifier ]
464
464
/// The client SHOULD assume that the order of entries reflects the most common presentation in the content.
465
465
///
466
466
/// For example, if the content is predominantly stereoscopic, with some brief sections that are monoscopic then the
467
467
/// Multivariant Playlist SHOULD specify `REQ-VIDEO-LAYOUT="CH-STEREO,CH-MONO"`. On the other hand, if the content
468
468
/// is predominantly monoscopic then the Multivariant Playlist SHOULD specify `REQ-VIDEO-LAYOUT="CH-MONO,CH-STEREO"`.
469
- public let predominantLayout : VideoLayout
469
+ public let predominantLayout : VideoLayoutIdentifier
470
470
471
- public enum VideoLayout : String {
471
+ public enum VideoLayoutIdentifier : String {
472
472
/// Monoscopic.
473
473
///
474
474
/// Indicates that a single image is present.
@@ -488,9 +488,9 @@ public struct HLSVideoLayout: Equatable, FailableStringLiteralConvertible {
488
488
}
489
489
490
490
public init ? ( string: String ) {
491
- var layouts = [ VideoLayout ] ( )
491
+ var layouts = [ VideoLayoutIdentifier ] ( )
492
492
for str in string. split ( separator: " , " ) {
493
- if let layout = VideoLayout ( str: str) {
493
+ if let layout = VideoLayoutIdentifier ( str: str) {
494
494
layouts. append ( layout)
495
495
} else {
496
496
// Favor failing to parse the whole array if we find an unrecognized layout, so that we don't risk mis-
@@ -505,17 +505,13 @@ public struct HLSVideoLayout: Equatable, FailableStringLiteralConvertible {
505
505
self . layouts = layouts
506
506
}
507
507
508
- public init ? ( layouts: [ VideoLayout ] ) {
508
+ public init ? ( layouts: [ VideoLayoutIdentifier ] ) {
509
509
guard let predominantLayout = layouts. first else { return nil }
510
510
self . layouts = layouts
511
511
self . predominantLayout = predominantLayout
512
512
}
513
513
514
- public func containsStereo( ) -> Bool {
515
- layouts. contains ( . chStereo)
516
- }
517
-
518
- public func containsMono( ) -> Bool {
519
- layouts. contains ( . chMono)
514
+ public func contains( _ layout: VideoLayoutIdentifier ) -> Bool {
515
+ layouts. contains ( layout)
520
516
}
521
517
}
0 commit comments