Skip to content

Commit

Permalink
Merge pull request #46 from videovillage/master
Browse files Browse the repository at this point in the history
expose AVFieldOrder from codec parameters
  • Loading branch information
gregcotten authored Sep 30, 2020
2 parents 8ebc966 + 96dc22d commit 3fe7e92
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/SwiftFFmpeg/AVCodecParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ extension AVCodecParameters {
get { Int(native.pointee.video_delay) }
set { native.pointee.video_delay = Int32(newValue) }
}

/// The field order of the video frame.
public var fieldOrder: AVFieldOrder {
get { native.pointee.field_order }
set { native.pointee.field_order = newValue }
}

/// The color range of the video frame.
public var colorRange: AVColorRange {
Expand Down
20 changes: 20 additions & 0 deletions Sources/SwiftFFmpeg/VideoUtil.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,23 @@ extension AVPixelFormat: CustomStringConvertible {
name
}
}

public typealias AVFieldOrder = CFFmpeg.AVFieldOrder

extension CFFmpeg.AVFieldOrder {
public static let UNKNOWN = AV_FIELD_UNKNOWN

public static let PROGRESSIVE = AV_FIELD_PROGRESSIVE

/// Top coded_first, top displayed first
public static let TT = AV_FIELD_TT

/// Bottom coded first, bottom displayed first
public static let BB = AV_FIELD_BB

/// Top coded first, bottom displayed first
public static let TB = AV_FIELD_TB

/// Bottom coded first, top displayed first
public static let BT = AV_FIELD_BT
}

0 comments on commit 3fe7e92

Please sign in to comment.