Skip to content

Commit

Permalink
remove custom rtc lib flag
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Aug 14, 2023
1 parent 4bb2f46 commit db7977d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
7 changes: 1 addition & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ let package = Package(
"WebRTC", "SwiftProtobuf", "Promises",
.product(name: "Logging", package: "swift-log"),
],
path: "Sources",
swiftSettings: [
// Compiler flags used to completely remove code for specific features to isolate issues.
// Not defining the flag will turn off the feature.
.define("LK_USE_LIVEKIT_WEBRTC_BUILD")
]
path: "Sources"
),
.testTarget(
name: "LiveKitTests",
Expand Down
13 changes: 0 additions & 13 deletions Sources/LiveKit/Core/Engine+WebRTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ internal extension Engine {

static private let encoderFactory: RTCVideoEncoderFactory = {
let encoderFactory = VideoEncoderFactory()
#if LK_USE_LIVEKIT_WEBRTC_BUILD
return VideoEncoderFactorySimulcast(primary: encoderFactory,
fallback: encoderFactory)

#else
return encoderFactory
#endif
}()

static private let decoderFactory = VideoDecoderFactory()
Expand All @@ -96,14 +92,9 @@ internal extension Engine {

logger.log("Initializing PeerConnectionFactory...", type: Engine.self)

#if LK_USE_LIVEKIT_WEBRTC_BUILD
return RTCPeerConnectionFactory(bypassVoiceProcessing: bypassVoiceProcessing,
encoderFactory: encoderFactory,
decoderFactory: decoderFactory)
#else
return RTCPeerConnectionFactory(encoderFactory: encoderFactory,
decoderFactory: decoderFactory)
#endif
}()

// forbid direct access
Expand All @@ -120,11 +111,7 @@ internal extension Engine {
}

static func createVideoSource(forScreenShare: Bool) -> RTCVideoSource {
#if LK_USE_LIVEKIT_WEBRTC_BUILD
DispatchQueue.webRTC.sync { peerConnectionFactory.videoSource(forScreenCast: forScreenShare) }
#else
DispatchQueue.webRTC.sync { peerConnectionFactory.videoSource() }
#endif
}

static func createVideoTrack(source: RTCVideoSource) -> RTCVideoTrack {
Expand Down

0 comments on commit db7977d

Please sign in to comment.