⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245478 in webkit


Ignore:
Timestamp:
May 17, 2019, 2:29:14 PM (7 years ago)
Author:
youenn@apple.com
Message:

Make AVVideoCaptureSource more robust to configuration failures
https://bugs.webkit.org/show_bug.cgi?id=197997
rdar://problem/50875662

Reviewed by Eric Carlson.

Covered by manual testing.

  • platform/mediastream/mac/AVVideoCaptureSource.mm:

(WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
Make sure to commit configuration once calling beginConfiguration.
In case of error in setting frame rate, log the error but continue capturing.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245475 r245478  
     12019-05-17  Youenn Fablet  <youenn@apple.com>
     2
     3        Make AVVideoCaptureSource more robust to configuration failures
     4        https://bugs.webkit.org/show_bug.cgi?id=197997
     5        rdar://problem/50875662
     6
     7        Reviewed by Eric Carlson.
     8
     9        Covered by manual testing.
     10
     11        * platform/mediastream/mac/AVVideoCaptureSource.mm:
     12        (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
     13        Make sure to commit configuration once calling beginConfiguration.
     14        In case of error in setting frame rate, log the error but continue capturing.
     15
    1162019-05-17  Rob Buis  <rbuis@igalia.com>
    217
  • trunk/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

    r245296 r245478  
    325325            auto* frameRateRange = frameDurationForFrameRate(m_currentFrameRate);
    326326            ASSERT(frameRateRange);
    327             if (!frameRateRange)
    328                 return;
    329 
    330             m_currentFrameRate = clampTo(m_currentFrameRate, frameRateRange.minFrameRate, frameRateRange.maxFrameRate);
    331 
    332             ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", m_currentFrameRate);
    333             [device() setActiveVideoMinFrameDuration: CMTimeMake(1, m_currentFrameRate)];
    334             [device() setActiveVideoMaxFrameDuration: CMTimeMake(1, m_currentFrameRate)];
     327            if (frameRateRange) {
     328                m_currentFrameRate = clampTo(m_currentFrameRate, frameRateRange.minFrameRate, frameRateRange.maxFrameRate);
     329
     330                ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", m_currentFrameRate);
     331                [device() setActiveVideoMinFrameDuration: CMTimeMake(1, m_currentFrameRate)];
     332                [device() setActiveVideoMaxFrameDuration: CMTimeMake(1, m_currentFrameRate)];
     333            } else
     334                ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "cannot find proper frame rate range for the selected preset\n");
    335335
    336336            [device() unlockForConfiguration];
     
    338338    } @catch(NSException *exception) {
    339339        ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "error configuring device ", [[exception name] UTF8String], ", reason : ", [[exception reason] UTF8String]);
    340         return;
     340        [device() unlockForConfiguration];
     341        ASSERT_NOT_REACHED();
    341342    }
    342343    [m_session commitConfiguration];
Note: See TracChangeset for help on using the changeset viewer.