Bug 142940

Summary: [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch.
none
Updated patch. sam: review+

Description Eric Carlson 2015-03-21 16:19:54 PDT
Make it work for WebKit 1 clients.
Comment 1 Eric Carlson 2015-03-21 16:21:37 PDT
<rdar://problem/20157973>
Comment 2 Eric Carlson 2015-03-21 16:50:56 PDT
Created attachment 249178 [details]
Proposed patch.
Comment 3 Eric Carlson 2015-03-21 19:53:51 PDT
Created attachment 249187 [details]
Updated patch.
Comment 4 Sam Weinig 2015-03-22 10:44:05 PDT
Comment on attachment 249187 [details]
Updated patch.

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

> Source/WebKit/mac/WebView/WebViewData.h:152
> +#if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
> +class WebMediaPlaybackTargetPicker : public WebCore::MediaPlaybackTargetPicker::Client {
> +public:
> +    static std::unique_ptr<WebMediaPlaybackTargetPicker> create(WebCore::Page&);
> +
> +    explicit WebMediaPlaybackTargetPicker(WebCore::Page&);
> +    virtual ~WebMediaPlaybackTargetPicker() { }
> +
> +    void showPlaybackTargetPicker(const WebCore::FloatRect&, bool /* hasVideo */);
> +    void startingMonitoringPlaybackTargets();
> +    void stopMonitoringPlaybackTargets();
> +
> +    // WebCore::MediaPlaybackTargetPicker::Client
> +    virtual void didChoosePlaybackTarget(const WebCore::MediaPlaybackTarget&) override;
> +    virtual void externalOutputDeviceAvailableDidChange(bool) override;
> +
> +    void invalidate();
> +
> +private:
> +    WebCore::MediaPlaybackTargetPicker& targetPicker();
> +
> +    WebCore::Page* m_page;
> +    std::unique_ptr<WebCore::MediaPlaybackTargetPicker> m_targetPicker;
> +};
> +#endif

I would put this in its own file.

> Source/WebKit/mac/WebView/WebViewData.mm:86
> +std::unique_ptr<WebMediaPlaybackTargetPicker> WebMediaPlaybackTargetPicker::create(WebCore::Page& page)
> +{
> +    return std::make_unique<WebMediaPlaybackTargetPicker>(page);
> +}
> +

This (and the rest of the class, should go in its own file.
Comment 5 Eric Carlson 2015-03-22 18:13:03 PDT
(In reply to comment #4)
> Comment on attachment 249187 [details]
> Updated patch.
> 
> This (and the rest of the class, should go in its own file.

Done, thanks!
Comment 6 Eric Carlson 2015-03-22 18:13:27 PDT
Committed r181838 - https://trac.webkit.org/r181838
Comment 7 Alexey Proskuryakov 2015-03-22 23:59:22 PDT
Build fix in http://trac.webkit.org/r181846