swiftlint
This commit is contained in:
parent
fe889a056c
commit
98a6cfbb11
|
@ -173,15 +173,15 @@ final class LiveViewController: UIViewController {
|
|||
|
||||
@IBAction func onEffectValueChanged(_ segment: UISegmentedControl) {
|
||||
if let currentEffect: VisualEffect = currentEffect {
|
||||
let _ = rtmpStream.unregisterEffect(video: currentEffect)
|
||||
_ = rtmpStream.unregisterEffect(video: currentEffect)
|
||||
}
|
||||
switch segment.selectedSegmentIndex {
|
||||
case 1:
|
||||
currentEffect = MonochromeEffect()
|
||||
let _ = rtmpStream.registerEffect(video: currentEffect!)
|
||||
_ = rtmpStream.registerEffect(video: currentEffect!)
|
||||
case 2:
|
||||
currentEffect = PronamaEffect()
|
||||
let _ = rtmpStream.registerEffect(video: currentEffect!)
|
||||
_ = rtmpStream.registerEffect(video: currentEffect!)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
struct Preference {
|
||||
static var defaultInstance: Preference = Preference()
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ extension VideoIOComponent {
|
|||
func attachScreen(_ screen: AVCaptureScreenInput?) {
|
||||
mixer?.session.beginConfiguration()
|
||||
output = nil
|
||||
guard let _ = screen else {
|
||||
guard screen != nil else {
|
||||
input = nil
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
protocol DataConvertible {
|
||||
var data: Data { get set }
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public enum FLVAACPacketType: UInt8 {
|
||||
case seq = 0
|
||||
case raw = 1
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public enum FLVAVCPacketType: UInt8 {
|
||||
case seq = 0
|
||||
case nal = 1
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public enum FLVFrameType: UInt8 {
|
||||
case key = 1
|
||||
case inter = 2
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public enum FLVTagType: UInt8 {
|
||||
case audio = 8
|
||||
case video = 9
|
||||
|
|
|
@ -398,7 +398,7 @@ final class MP4VisualSampleEntryBox: MP4ContainerBox {
|
|||
frameCount = try buffer.readUInt16()
|
||||
compressorname = try buffer.readUTF8Bytes(32)
|
||||
depth = try buffer.readUInt16()
|
||||
let _ = try buffer.readUInt16()
|
||||
_ = try buffer.readUInt16()
|
||||
buffer.clear()
|
||||
|
||||
var offset: UInt32 = UInt32(MP4VisualSampleEntryBox.dataSize)
|
||||
|
|
|
@ -31,7 +31,7 @@ public class MP4Sampler {
|
|||
let reader: MP4Reader = MP4Reader(url: url)
|
||||
|
||||
do {
|
||||
let _ = try reader.load()
|
||||
_ = try reader.load()
|
||||
} catch {
|
||||
logger.warn("")
|
||||
return
|
||||
|
|
|
@ -66,7 +66,7 @@ class TSReader {
|
|||
packetizedElementaryStreams[packet.PID] = PacketizedElementaryStream(packet.payload)
|
||||
return
|
||||
}
|
||||
let _ = packetizedElementaryStreams[packet.PID]?.append(packet.payload)
|
||||
_ = packetizedElementaryStreams[packet.PID]?.append(packet.payload)
|
||||
}
|
||||
|
||||
func close() {
|
||||
|
|
|
@ -76,7 +76,7 @@ class TSWriter {
|
|||
}
|
||||
|
||||
var packets: [TSPacket] = split(PID, PES: PES, timestamp: decodeTimeStamp)
|
||||
let _ = rotateFileHandle(decodeTimeStamp)
|
||||
_ = rotateFileHandle(decodeTimeStamp)
|
||||
|
||||
if streamID == 192 {
|
||||
packets[0].adaptationField?.randomAccessIndicator = true
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import Foundation
|
||||
import AVFoundation
|
||||
|
||||
|
||||
#if os(iOS) || os(macOS)
|
||||
extension AVCaptureSession.Preset {
|
||||
static var `default`: AVCaptureSession.Preset = .medium
|
||||
|
|
|
@ -173,7 +173,7 @@ extension DefaultAVMixerRecorderDelegate: AVMixerRecorderDelegate {
|
|||
guard clockReference == mediaType && rotateTime.value < withPresentationTimeStamp.value else {
|
||||
return
|
||||
}
|
||||
if let _ = recorder.writer {
|
||||
if recorder.writer != nil {
|
||||
recorder.finishWriting()
|
||||
}
|
||||
recorder.writer = createWriter(recorder.fileName)
|
||||
|
|
|
@ -168,7 +168,7 @@ class AudioStreamPlayback {
|
|||
}
|
||||
|
||||
func initializeForAudioQueue() {
|
||||
guard let _ = formatDescription, self.queue == nil else {
|
||||
guard formatDescription != nil && self.queue == nil else {
|
||||
return
|
||||
}
|
||||
var queue: AudioQueueRef? = nil
|
||||
|
@ -184,7 +184,7 @@ class AudioStreamPlayback {
|
|||
&queue)
|
||||
}
|
||||
if let cookie: [UInt8] = getMagicCookieForFileStream() {
|
||||
let _ = setMagicCookieForQueue(cookie)
|
||||
_ = setMagicCookieForQueue(cookie)
|
||||
}
|
||||
soundTransform.setParameter(queue!)
|
||||
for _ in 0..<numberOfBuffers {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public enum ScalingMode: String {
|
||||
case normal = "Normal"
|
||||
case letterbox = "Letterbox"
|
||||
|
|
|
@ -333,7 +333,7 @@ final class VideoIOComponent: IOComponent {
|
|||
defer {
|
||||
objc_sync_exit(effects)
|
||||
}
|
||||
if let _ = effects.index(of: effect) {
|
||||
if effects.contains(effect) {
|
||||
return false
|
||||
}
|
||||
effects.append(effect)
|
||||
|
|
|
@ -84,7 +84,6 @@ extension ASArray: Equatable {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// MARK: -
|
||||
/**
|
||||
ActionScript 1.0 and 2.0 and flash.xml.XMLDocument in ActionScript 3.0
|
||||
|
|
|
@ -349,7 +349,7 @@ final class RTMPCommandMessage: RTMPMessage {
|
|||
case "close":
|
||||
connection.close()
|
||||
default:
|
||||
connection.dispatch(Event.RTMP_STATUS, bubbles: false, data: arguments.first)
|
||||
connection.dispatch(Event.RTMP_STATUS, bubbles: false, data: arguments.first ?? nil)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
public protocol RTMPStreamQoSDelegate: class {
|
||||
func didPublishInsufficientBW(_ stream: RTMPStream, withConnection: RTMPConnection)
|
||||
func clear()
|
||||
|
|
|
@ -271,8 +271,7 @@ final class RTMPTSocket: NSObject, RTMPSocketCompatible {
|
|||
return data.count
|
||||
}
|
||||
|
||||
private func doRequest(_ pathComponent: String, _
|
||||
data: Data, _ completionHandler: @escaping ((Data?, URLResponse?, Error?) -> Void)) {
|
||||
private func doRequest(_ pathComponent: String, _ data: Data, _ completionHandler: @escaping ((Data?, URLResponse?, Error?) -> Void)) {
|
||||
isRequesting = true
|
||||
lastRequestPathComponent = pathComponent
|
||||
lastRequestData = data
|
||||
|
|
|
@ -11,7 +11,6 @@ extension AVFrameRateRange {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#if os(iOS) || os(macOS)
|
||||
|
||||
extension AVCaptureDevice {
|
||||
|
|
|
@ -54,7 +54,7 @@ extension TimerDriver: Running {
|
|||
|
||||
final public func startRunning() {
|
||||
DispatchQueue.global(qos: .userInteractive).async {
|
||||
if let _ = self.runloop {
|
||||
guard self.runloop != nil else {
|
||||
return
|
||||
}
|
||||
self.timer = Timer(
|
||||
|
|
Loading…
Reference in New Issue