Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 11158678aa4ef3d613394dfc01f9cccec6687104
      
https://github.com/WebKit/WebKit/commit/11158678aa4ef3d613394dfc01f9cccec6687104
  Author: Youenn Fablet <[email protected]>
  Date:   2024-07-25 (Thu, 25 Jul 2024)

  Changed paths:
    M Source/WebCore/platform/mediastream/RealtimeVideoCaptureSource.cpp
    M Source/WebCore/platform/mediastream/RealtimeVideoCaptureSource.h
    M Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp

  Log Message:
  -----------
  startApplyingConstraints is called twice when applying constraints with size 
changes
rdar://132339561
https://bugs.webkit.org/show_bug.cgi?id=277068

Reviewed by Eric Carlson.

startApplyingConstraints was called first in 
RealtimeMediaSource::applyConstraints and then in 
RealtimeVideoCaptureSource::setSizeFrameRateAndZoom.
Although it was paired with two calls to endApplyingConstraints, the 
implementation of 
AVVideoCaptureSource::startApplyingConstraints/endApplyingConstraints
is not handling nested calls like this.
This was triggering unbalanced AVVideoCaptureSource session 
beginConfiguration/commitConfiguration calls, which caused zoom/torch values to 
not always be applied properly.
This also fixes the exception that is sometimes raised when calling 
AVVideoCaptureSource::stopSession().

To fix this, we update RealtimeVideoCaptureSource::setSizeFrameRateAndZoom to 
not call directly startApplyingConstraints/endApplyingConstraints.
This is ok since it is only called from RealtimeMediaSource::applyConstraints 
which already does these calls.
This change is covered in 
MockRealtimeVideoSource::startApplyingConstraints/endApplyingConstraints by 
adding debug ASSERTS which are exercised by current layout tests.

The other call site of setFrameRateAndZoomWithPreset is for handling preset 
changes for photo.
Here we need to keep the calls to 
startApplyingConstraints/endApplyingConstraints, like done today.

* Source/WebCore/platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::setSizeFrameRateAndZoom):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeFrameRateAndZoom): 
Deleted.
* Source/WebCore/platform/mediastream/RealtimeVideoCaptureSource.h:
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startApplyingConstraints):
(WebCore::MockRealtimeVideoSource::endApplyingConstraints):

Canonical link: https://commits.webkit.org/281349@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to