Bug 173278 - Screen sleeps while doing WebRTC video
Summary: Screen sleeps while doing WebRTC video
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-12 15:20 PDT by Jer Noble
Modified: 2017-06-12 16:02 PDT (History)
4 users (show)

See Also:


Attachments
Patch (8.46 KB, patch)
2017-06-12 15:27 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (8.44 KB, patch)
2017-06-12 15:45 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2017-06-12 15:20:45 PDT
Screen sleeps while doing WebRTC video
Comment 1 Jer Noble 2017-06-12 15:25:14 PDT
<rdar://problem/32518760>
Comment 2 Radar WebKit Bug Importer 2017-06-12 15:25:39 PDT
<rdar://problem/32723876>
Comment 3 Jer Noble 2017-06-12 15:27:30 PDT
Created attachment 312710 [details]
Patch
Comment 4 Jon Lee 2017-06-12 15:31:08 PDT
<rdar://problem/32518760>
Comment 5 Eric Carlson 2017-06-12 15:34:05 PDT
Comment on attachment 312710 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=312710&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:6362
> +    if (m_mediaStreamSrcObject) {
> +        // Do not block system from sleeping if element is only rendering local (capture) sources.
> +        if (WTF::allOf(m_mediaStreamSrcObject->getTracks(), [] (RefPtr<MediaStreamTrack>& track) {
> +            return track && track->isCaptureTrack();
> +        }))
> +            return SleepType::None;
> +    }

Nit: This indentation is confusing, even though it is technically correct. It would be much easier to understand if the allOf was on a single line:

if (WTF::allOf(m_mediaStreamSrcObject->getTracks(), [] (RefPtr<MediaStreamTrack>& track) { return track && track->isCaptureTrack(); }))
    return SleepType::None;
Comment 6 Jer Noble 2017-06-12 15:45:54 PDT
Created attachment 312712 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2017-06-12 16:01:59 PDT
Comment on attachment 312712 [details]
Patch for landing

Clearing flags on attachment: 312712

Committed r218151: <http://trac.webkit.org/changeset/218151>
Comment 8 WebKit Commit Bot 2017-06-12 16:02:01 PDT
All reviewed patches have been landed.  Closing bug.