I am working on an iOS application with screen sharing feature using Broadcast Upload extension. I am able to send video packets using UDP connection for screen share in foreground mode but when app goes to background mode no video packets are being delivered to media server. Although audio packets are getting delivered. I have turned on the Audio Airplay and Voip background modes.
Also frames are being added to the capturer using below code.
RTCCVPixelBuffer *rtcPixelBuffer = [[RTCCVPixelBuffer alloc]
initWithPixelBuffer:pixelBuffer];
int64_t timeStampNs =
CMTimeGetSeconds(CMSampleBufferGetPresentationTimeStamp(sampleBuffer))
* NSEC_PER_SEC;
RTCVideoFrame *videoFrame = [[RTCVideoFrame alloc]
initWithBuffer:rtcPixelBuffer rotation:RTCVideoRotation_0
timeStampNs:timeStampNs];
//NSLog(@"videoframe %@",videoFrame.buffer.description);
[_videoSource capturer:_capturer didCaptureVideoFrame:videoFrame];
I can see the above frames being added to capturer even in background mode but not able to see anything on server.
Note - All the code for sending data to server is written in containing app and not in extension .