文字っぽいの。

文字を書いています。写真も混ざります。

RPBroadcastSampleHandlerで得られるCMSampleBufferのorientationを取得する

コード

override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
    if let orientationAttachment = CMGetAttachment(sampleBuffer, key: RPVideoSampleOrientationKey as CFString, attachmentModeOut: nil) as? NSNumber {
        if let orientation = CGImagePropertyOrientation(rawValue: orientationAttachment.uint32Value) {
                // orientationを使った処理
        }
    }
}

補足情報