Changeset 271749 in webkit


Ignore:
Timestamp:
Jan 22, 2021 10:11:02 AM (18 months ago)
Author:
youenn@apple.com
Message:

Disable verification timer in case of capture suspension
https://bugs.webkit.org/show_bug.cgi?id=220859

Reviewed by Eric Carlson.

In case of suspension/unsuspension, make it as if the capture was interrupted.
Update updateVerifyCapturingTimer to stop timer it capture is interrupted.

Remove RealtimeMediaSource::m_interrupted which is unused and potentially confusing.
Manually tested.

  • platform/mediastream/RealtimeMediaSource.h:
  • platform/mediastream/mac/AVVideoCaptureSource.mm:

(WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer):
(WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r271745 r271749  
     12021-01-22  Youenn Fablet  <youenn@apple.com>
     2
     3        Disable verification timer in case of capture suspension
     4        https://bugs.webkit.org/show_bug.cgi?id=220859
     5
     6        Reviewed by Eric Carlson.
     7
     8        In case of suspension/unsuspension, make it as if the capture was interrupted.
     9        Update updateVerifyCapturingTimer to stop timer it capture is interrupted.
     10
     11        Remove RealtimeMediaSource::m_interrupted which is unused and potentially confusing.
     12        Manually tested.
     13
     14        * platform/mediastream/RealtimeMediaSource.h:
     15        * platform/mediastream/mac/AVVideoCaptureSource.mm:
     16        (WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer):
     17        (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
     18
    1192021-01-22  Ziran Sun  <zsun@igalia.com>
    220
  • trunk/Source/WebCore/platform/mediastream/RealtimeMediaSource.h

    r268521 r271749  
    132132    bool captureDidFail() const { return m_captureDidFailed; }
    133133
    134     virtual bool interrupted() const { return m_interrupted; }
     134    virtual bool interrupted() const { return false; }
    135135
    136136    const String& name() const { return m_name; }
     
    299299    bool m_echoCancellation { false };
    300300    bool m_isProducingData { false };
    301     bool m_interrupted { false };
    302301    bool m_captureDidFailed { false };
    303302    bool m_isEnded { false };
  • trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

    r264177 r271749  
    165165void AVVideoCaptureSource::updateVerifyCapturingTimer()
    166166{
    167     if (!m_isRunning) {
     167    if (!m_isRunning || m_interrupted) {
    168168        m_verifyCapturingTimer.stop();
    169169        return;
     
    571571{
    572572#if !PLATFORM(IOS_FAMILY)
    573     scheduleDeferredTask([this] {
    574         auto isSuspended = [m_device isSuspended];
    575         ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, !!isSuspended);
    576         if (isSuspended == muted())
    577             return;
    578 
    579         notifyMutedChange(isSuspended);
     573    scheduleDeferredTask([this, logIdentifier = LOGIDENTIFIER] {
     574        m_interrupted = [m_device isSuspended];
     575        ALWAYS_LOG_IF(loggerPtr(), logIdentifier, !!m_interrupted);
     576
     577        updateVerifyCapturingTimer();
     578
     579        if (m_interrupted != muted())
     580            notifyMutedChange(m_interrupted);
    580581    });
    581582#endif
Note: See TracChangeset for help on using the changeset viewer.