Bug 200774 - [Cocoa] Adopt -preventDisplaySleepForVideoPlayback
Summary: [Cocoa] Adopt -preventDisplaySleepForVideoPlayback
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks: 200790
  Show dependency treegraph
 
Reported: 2019-08-15 10:36 PDT by Jer Noble
Modified: 2019-08-19 19:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.96 KB, patch)
2019-08-15 10:37 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (3.76 KB, patch)
2019-08-19 17:39 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 2019-08-15 10:36:09 PDT
[Cocoa] Adopt -preventDisplaySleepForVideoPlayback
Comment 1 Jer Noble 2019-08-15 10:36:57 PDT
<rdar://problem/54321071>
Comment 2 Jer Noble 2019-08-15 10:37:25 PDT
Created attachment 376391 [details]
Patch
Comment 3 WebKit Commit Bot 2019-08-15 14:39:38 PDT
Comment on attachment 376391 [details]
Patch

Clearing flags on attachment: 376391

Committed r248747: <https://trac.webkit.org/changeset/248747>
Comment 4 WebKit Commit Bot 2019-08-15 14:39:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2019-08-15 14:44:10 PDT
Comment on attachment 376391 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:70
> +@interface AVSampleBufferDisplayLayer (WebCorePrivate)
> +@property (assign, nonatomic) BOOL preventDisplaySleepForVideoPlayback;
> +@end

I’d like us to make it a habit to put these kinds of things into SPI headers whenever possible.
Comment 6 Jer Noble 2019-08-15 14:52:44 PDT
(In reply to Darin Adler from comment #5)
> Comment on attachment 376391 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=376391&action=review
> 
> > Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:70
> > +@interface AVSampleBufferDisplayLayer (WebCorePrivate)
> > +@property (assign, nonatomic) BOOL preventDisplaySleepForVideoPlayback;
> > +@end
> 
> I’d like us to make it a habit to put these kinds of things into SPI headers
> whenever possible.

Understood. The SPI declarations for AVSampleBufferDisplayLayer in AVFoundationSPI.h are ... complicated, and I was trying to make the simplest patch possible to avoid any merge problems.
Comment 7 Darin Adler 2019-08-15 14:57:33 PDT
(In reply to Jer Noble from comment #6)
> Understood. The SPI declarations for AVSampleBufferDisplayLayer in
> AVFoundationSPI.h are ... complicated, and I was trying to make the simplest
> patch possible to avoid any merge problems.

Fine with me for the short term. Not the right thing for the longer term, I think.
Comment 8 Jer Noble 2019-08-15 15:10:34 PDT
(In reply to Darin Adler from comment #7)
> Fine with me for the short term. Not the right thing for the longer term, I
> think.

Filed bug# 200790 to track cleaning this all up.
Comment 9 Jer Noble 2019-08-19 17:37:40 PDT
Darin was correct, I was wrong, and because I tried to do the most expedient fix instead of the most correct fix, a misspelling ("preventDisplaySleep" vs. "prevent_s_DisplaySleep") got into the build, negating the benefit of this patch. Fixing.
Comment 10 Jer Noble 2019-08-19 17:39:10 PDT
Reopening to attach new patch.
Comment 11 Jer Noble 2019-08-19 17:39:11 PDT
Created attachment 376725 [details]
Patch
Comment 12 EWS Watchlist 2019-08-19 17:41:10 PDT
Attachment 376725 [details] did not pass style-queue:


ERROR: Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h:310:  Misplaced OS version check. Please use a named macro in wtf/Platform.h, wtf/FeatureDefines.h, or an appropriate internal file.  [build/version_check] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 WebKit Commit Bot 2019-08-19 19:16:49 PDT
Comment on attachment 376725 [details]
Patch

Clearing flags on attachment: 376725

Committed r248886: <https://trac.webkit.org/changeset/248886>
Comment 14 WebKit Commit Bot 2019-08-19 19:16:50 PDT
All reviewed patches have been landed.  Closing bug.