pushExternalVideoFrame returns false although the setExternalVideoSource is set to true.
Normal AgoraCameraSourcePush method does works, but when I switch to my custom push, it fails.
What could be causing this?
Is there any way that I can see a log?
func updateClientRole(_ role: AgoraClientRole) {
print("updateClientRole,", role.title)
self.role = role
if role == .broadcaster {
makeConfig(mirror: false)
agoraKit.enableLocalVideo(true)
agoraKit.enableLocalAudio(true)
agoraKit.enableAudioVolumeIndication(250, smooth: 3, report_vad: true)
agoraKit.setAudioProfile(.speechStandard, scenario: .communication)
agoraKit.setExternalVideoSource(true, useTexture: true, pushMode: true)
// this works
localVideoView = CustomVideoSourcePreview(frame: view.frame)
videosView.appendBackgroundViewContainer(uid: myUID, itsTeacher: self.amTeacher).addSubview(localVideoView!)
customCamera = AgoraCameraSourcePush(delegate: self, videoView: localVideoView!)
self.customCamera?.startCapture(ofCamera: .front)
self.localVideoView?.bindFrameToSuperviewBounds()
// this does not work
let myVideoView = videosView.appendBackgroundViewContainer(uid: myUID, itsTeacher: self.amTeacher)
avatarView = MyAvatarView(to: myVideoView)
avatarView?.delegate = self
}
func myVideoCapture(_ capture: AgoraCameraSourcePush?, didOutputSampleBuffer pixelBuffer: CVPixelBuffer, rotation: Int, timeStamp: CMTime) {
let videoFrame = AgoraVideoFrame()
videoFrame.format = 12
videoFrame.textureBuf = pixelBuffer
videoFrame.time = timeStamp
videoFrame.rotation = Int32(rotation)
let success = agoraKit?.pushExternalVideoFrame(videoFrame)
print("myVideoCapture.success",success) -> this print "myVideoCapture.success Optional(false)"
}
pushExternalVideoFrame returns false although the setExternalVideoSource is set to true.
Normal AgoraCameraSourcePush method does works, but when I switch to my custom push, it fails. What could be causing this? Is there any way that I can see a log?