Skip to content

Commit

Permalink
Bug 1621500 - Null out _owner in RTCVideoCaptureIosObjC; r=ng
Browse files Browse the repository at this point in the history
We're seeing what looks like occasional late callbacks in
VideoCaptureImpl::DeliverCapturedFrame on OS X. When we call stopCapture, it in
turns calls directOutputToNil which should cause any newly capture frames to be
dropped. It is not clear from the existing code or the documentation what would
happen to any frames which are already enqueued. It looks like it is possible
for frames to be delivered on the old queue, which would explain late callbacks.

Differential Revision: https://phabricator.services.mozilla.com/D67486

--HG--
extra : moz-landing-system : lando
  • Loading branch information
dminor committed Mar 19, 2020
1 parent 04f7ed2 commit 294882d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ - (BOOL)stopCapture {
_orientationHasChanged = NO;
[self waitForCaptureChangeToFinish];
[self directOutputToNil];
_owner = NULL;

if (!_captureSession) {
return NO;
Expand Down Expand Up @@ -325,7 +326,9 @@ - (void)captureOutput:(AVCaptureOutput*)captureOutput
tempCaptureCapability.maxFPS = _capability.maxFPS;
tempCaptureCapability.videoType = VideoType::kUYVY;

_owner->IncomingFrame(baseAddress, frameSize, tempCaptureCapability, 0);
if (_owner) {
_owner->IncomingFrame(baseAddress, frameSize, tempCaptureCapability, 0);
}

CVPixelBufferUnlockBaseAddress(videoFrame, kFlags);
}
Expand Down

0 comments on commit 294882d

Please sign in to comment.