WebKit Bugzilla
Attachment 360929 Details for
Bug 194181
: Make sure to remove the device observer in AVVideoCaptureSource
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194181-20190201173640.patch (text/plain), 3.24 KB, created by
youenn fablet
on 2019-02-01 17:36:40 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-02-01 17:36:40 PST
Size:
3.24 KB
patch
obsolete
>Subversion Revision: 240633 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d5dccab78b26343d9023863149f34dffca6e4769..22e327f8df3261b82c378438c843a6aaa25e3786 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-02-01 Youenn Fablet <youenn@apple.com> >+ >+ Make sure to remove the device observer in AVVideoCaptureSource >+ https://bugs.webkit.org/show_bug.cgi?id=194181 >+ <rdar://problem/47739247> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make sure to remove the device observer when the observer is destroyed. >+ To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor. >+ >+ Covered by manual test. >+ >+ * platform/mediastream/mac/AVVideoCaptureSource.mm: >+ (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): >+ (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): >+ (WebCore::AVVideoCaptureSource::setupSession): >+ > 2019-01-30 Babak Shafiei <bshafiei@apple.com> > > Cherry-pick r240633. rdar://problem/47682687 >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index 16bb821539f05cda2b495d98244b76909fd1a8e6..ccca66fe2a75492223cf11e4e1d9a37d86f8b9a8 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -181,6 +181,8 @@ AVVideoCaptureSource::AVVideoCaptureSource(AVCaptureDeviceTypedef* device, Strin > static_assert(static_cast<int>(InterruptionReason::VideoInUse) == AVCaptureSessionInterruptionReasonVideoDeviceInUseByAnotherClient, "InterruptionReason::VideoInUse is not AVCaptureSessionInterruptionReasonVideoDeviceInUseByAnotherClient as expected"); > static_assert(static_cast<int>(InterruptionReason::AudioInUse) == AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient, "InterruptionReason::AudioInUse is not AVCaptureSessionInterruptionReasonAudioDeviceInUseByAnotherClient as expected"); > #endif >+ >+ [m_device.get() addObserver:m_objcObserver.get() forKeyPath:@"suspended" options:NSKeyValueObservingOptionNew context:(void *)nil]; > } > > AVVideoCaptureSource::~AVVideoCaptureSource() >@@ -189,12 +191,12 @@ AVVideoCaptureSource::~AVVideoCaptureSource() > RealtimeMediaSourceCenter::singleton().videoCaptureFactory().unsetActiveSource(*this); > #endif > [m_objcObserver disconnect]; >+ [m_device removeObserver:m_objcObserver.get() forKeyPath:@"suspended"]; > > if (!m_session) > return; > > [m_session removeObserver:m_objcObserver.get() forKeyPath:@"running"]; >- [m_device removeObserver:m_objcObserver.get() forKeyPath:@"suspended"]; > if ([m_session isRunning]) > [m_session stopRunning]; > } >@@ -411,7 +413,6 @@ bool AVVideoCaptureSource::setupSession() > > m_session = adoptNS([allocAVCaptureSessionInstance() init]); > [m_session addObserver:m_objcObserver.get() forKeyPath:@"running" options:NSKeyValueObservingOptionNew context:(void *)nil]; >- [m_device addObserver:m_objcObserver.get() forKeyPath:@"suspended" options:NSKeyValueObservingOptionNew context:(void *)nil]; > > [m_session beginConfiguration]; > bool success = setupCaptureSession();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194181
:
360929
|
360934
|
361066