Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke delegate the stream(_ stream: NetStream, didOutput video: CMSa… #1232

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Examples/iOS/PlaybackViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class PlaybackViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
rtmpStream = RTMPStream(connection: rtmpConnection)
rtmpStream.delegate = self
}

override func viewWillAppear(_ animated: Bool) {
Expand Down Expand Up @@ -119,3 +120,31 @@ extension PlaybackViewController: AVPictureInPictureSampleBufferPlaybackDelegate
completionHandler()
}
}

extension PlaybackViewController: NetStreamDelegate {
// MARK: NetStreamDelegate
func stream(_ stream: NetStream, didOutput audio: AVAudioBuffer, presentationTimeStamp: CMTime) {
}

func stream(_ stream: NetStream, didOutput video: CMSampleBuffer) {
}

func stream(_ stream: NetStream, sessionWasInterrupted session: AVCaptureSession, reason: AVCaptureSession.InterruptionReason) {
}

func stream(_ stream: NetStream, sessionInterruptionEnded session: AVCaptureSession, reason: AVCaptureSession.InterruptionReason) {
}

func stream(_ stream: NetStream, videoCodecErrorOccurred error: VideoCodec.Error) {
}

func stream(_ stream: NetStream, audioCodecErrorOccurred error: HaishinKit.AudioCodec.Error) {
}

func streamWillDropFrame(_ stream: NetStream) -> Bool {
return false
}

func streamDidOpen(_ stream: NetStream) {
}
}
1 change: 1 addition & 0 deletions Sources/Media/IOMixer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ extension IOMixer: IOUnitDecoding {
extension IOMixer: MediaLinkDelegate {
// MARK: MediaLinkDelegate
func mediaLink(_ mediaLink: MediaLink, dequeue sampleBuffer: CMSampleBuffer) {
delegate?.mixer(self, didOutput: sampleBuffer)
drawable?.enqueue(sampleBuffer)
}

Expand Down