Hello, I’m trying to capture and rotate frames using didCaptureVideoFrame
.
I created new function named initWithVideoSource
in VideoCaptureController.m
and also I changed line 48 in WebRTCModule+RTCMediaStream.m
to
VideoCaptureController *videoCaptureController
= [[VideoCaptureController alloc] initWithVideoSource:videoSource
andConstraints:constraints[@"video"]];
I added these lines to VideoCaptureController.m
- (void)capturer:(RTCVideoCapturer*)capturer didCaptureVideoFrame:(RTCVideoFrame*)frame
{
RCTLog(@"[RTCVideoCapturer] didCaptureVideoFrame");
RTCVideoFrame* fixedFrame = [[RTCVideoFrame alloc] initWithBuffer:frame.buffer
rotation:0
timeStampNs:frame.timeStampNs];
[self.videoSource capturer:capturer didCaptureVideoFrame:fixedFrame];
}
didCaptureVideoFrame
not handling. I couldn’t understand how it works.
Can someone help me?