Skip to content

Commit

Permalink
rename SampleBufferVideoRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshihorie committed Nov 14, 2023
1 parent 29d61f1 commit cc6e480
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Foundation

@_implementationOnly import WebRTC

class InternalSampleBufferVideoRenderer: NativeView, Loggable {
class SampleBufferVideoRenderer: NativeView, Loggable {
public let sampleBufferDisplayLayer: AVSampleBufferDisplayLayer

override init(frame: CGRect) {
Expand Down Expand Up @@ -47,7 +47,7 @@ class InternalSampleBufferVideoRenderer: NativeView, Loggable {
}
}

extension InternalSampleBufferVideoRenderer: LKRTCVideoRenderer {
extension SampleBufferVideoRenderer: LKRTCVideoRenderer {
func setSize(_: CGSize) {
//
}
Expand All @@ -73,13 +73,13 @@ extension InternalSampleBufferVideoRenderer: LKRTCVideoRenderer {
return
}

DispatchQueue.main.async {
self.sampleBufferDisplayLayer.enqueue(sampleBuffer)
Task { @MainActor in
sampleBufferDisplayLayer.enqueue(sampleBuffer)
}
}
}

extension InternalSampleBufferVideoRenderer: Mirrorable {
extension SampleBufferVideoRenderer: Mirrorable {
func set(mirrored: Bool) {
sampleBufferDisplayLayer.transform = mirrored ? VideoView.mirrorTransform : CATransform3DIdentity
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/LiveKit/Views/VideoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public class VideoView: NativeView, Loggable {
/// This is only available when the renderer is using AVSampleBufferDisplayLayer.
/// Recommended to be accessed from main thread.
public var avSampleBufferDisplayLayer: AVSampleBufferDisplayLayer? {
guard let nr = nativeRenderer as? InternalSampleBufferVideoRenderer else { return nil }
guard let nr = nativeRenderer as? SampleBufferVideoRenderer else { return nil }
return nr.sampleBufferDisplayLayer
}

Expand Down Expand Up @@ -620,7 +620,7 @@ extension VideoView {
static func createNativeRendererView(for renderMode: VideoView.RenderMode) -> NativeRendererView {
if case .sampleBuffer = renderMode {
logger.log("Using AVSampleBufferDisplayLayer for VideoView's Renderer", type: VideoView.self)
return InternalSampleBufferVideoRenderer()
return SampleBufferVideoRenderer()
} else {
logger.log("Using RTCMTLVideoView for VideoView's Renderer", type: VideoView.self)
let result = LKRTCMTLVideoView()
Expand Down

0 comments on commit cc6e480

Please sign in to comment.