Get test_app running without crashing
This commit is contained in:
parent
8c1c98a0bf
commit
c73e2c2d0f
4 changed files with 50 additions and 49 deletions
|
@ -100,15 +100,7 @@ public func LKRoomVideoTracksForRemoteParticipant(room: UnsafeRawPointer, partic
|
|||
|
||||
for (_, participant) in room.remoteParticipants {
|
||||
if participant.identity == participantId as String {
|
||||
var tracks = [UnsafeMutableRawPointer]()
|
||||
for publication in participant.videoTracks {
|
||||
let track = publication.track as? RemoteVideoTrack
|
||||
if track != nil {
|
||||
tracks.append(Unmanaged.passRetained(track!).toOpaque())
|
||||
}
|
||||
|
||||
}
|
||||
return tracks as CFArray?
|
||||
return participant.videoTracks.compactMap { $0.track as? RemoteVideoTrack } as CFArray?
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,11 +132,10 @@ public func LKRemoteVideoTrackGetSid(track: UnsafeRawPointer) -> CFString {
|
|||
return track.sid! as CFString
|
||||
}
|
||||
|
||||
@_cdecl("LKDisplaySource")
|
||||
public func LKDisplaySource(data: UnsafeRawPointer, callback: @escaping @convention(c) (UnsafeRawPointer, UnsafeRawPointer?, CFString?) -> Void) {
|
||||
@_cdecl("LKDisplaySources")
|
||||
public func LKDisplaySources(data: UnsafeRawPointer, callback: @escaping @convention(c) (UnsafeRawPointer, CFArray?, CFString?) -> Void) {
|
||||
MacOSScreenCapturer.sources(for: .display, includeCurrentApplication: false, preferredMethod: .legacy).then { displaySources in
|
||||
let displaySource = displaySources.first.map { Unmanaged.passRetained($0).toOpaque() }
|
||||
callback(data, displaySource, nil)
|
||||
callback(data, displaySources as CFArray, nil)
|
||||
}.catch { error in
|
||||
callback(data, nil, error.localizedDescription as CFString)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue