Changeset 158599 in webkit


Ignore:
Timestamp:
Nov 4, 2013 2:53:32 PM (11 years ago)
Author:
jer.noble@apple.com
Message:

[PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
https://bugs.webkit.org/show_bug.cgi?id=123621

Reviewed by Eric Carlson.

Source/WebCore:

Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
in iOS (which requries fixing a few compile errors resulting from classes and methods which
are not available on iOS.

  • WebCore.exp.in: Export wkAVAssetResolvedURL.
  • css/StyleResolver.cpp:

(WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon

new isVideoPluginProxyEnabled() setting.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::parseAttribute): Ditto.

  • html/HTMLMediaElement.h:
  • html/HTMLVideoElement.cpp:

(WebCore::HTMLVideoElement::createRenderer): Ditto.
(WebCore::HTMLVideoElement::attach): Ditto.
(WebCore::HTMLVideoElement::parseAttribute): Ditto.
(HTMLVideoElement::setDisplayMode): Ditto.

  • html/HTMLVideoElement.h:
  • page/Settings.cpp:

(WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.

  • page/Settings.h:

(WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.

  • platform/graphics/MediaPlayer.cpp:

(WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add

MediaPlayerPriateAVFoundationObjC.

  • platform/graphics/MediaPlayerPrivate.h:

(WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
(WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new

HAS_ and USE_ macros instead of MAC_OS_MIN_VERNSION_REQUIRED.

(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead

of CGColorGetConstantColor.

(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel

format constant instead of QuickDraw constant.

(WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary

CGImage on iOS.

  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
  • platform/ios/WebCoreSystemInterfaceIOS.mm:
  • platform/mac/WebCoreSystemInterface.h:

Source/WebKit/mac:

Add a new isVideoPluginProxyEnabled setting.

  • WebView/WebPreferenceKeysPrivate.h:
  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]): Set isVideoPluginProxyEnabled preference.
(-[WebPreferences isVideoPluginProxyEnabled]): Pass through to Settings.

  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]): Set isVideoPluginProxyEnabled preference.

Source/WebKit2:

Add WebKit2 functions for setting then new isVideoPluginProxyEnabled preference.

  • Shared/WebPreferencesStore.h:
  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetVideoPluginProxyEnabled):
(WKPreferencesGetVideoPluginProxyEnabled):

  • UIProcess/API/C/WKPreferences.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Source/WTF:

Enable WTF_USE_AVFOUNDATION and add some HAVE_AVFOUNDATION_* defines
to replace the existing MAC_OS_X_VERSION_MIN_REQUIRED macros in
MediaPlayerPrivateAVFoundationObjC.mm.

  • wtf/Platform.h:
Location:
trunk/Source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r158520 r158599  
     12013-11-01  Jer Noble  <jer.noble@apple.com>
     2
     3        [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=123621
     5
     6        Reviewed by Eric Carlson.
     7
     8        Enable WTF_USE_AVFOUNDATION and add some HAVE_AVFOUNDATION_* defines
     9        to replace the existing __MAC_OS_X_VERSION_MIN_REQUIRED macros in
     10        MediaPlayerPrivateAVFoundationObjC.mm.
     11
     12        * wtf/Platform.h:
     13
    1142013-11-02  Patrick Gansterer  <paroga@webkit.org>
    215
  • trunk/Source/WTF/wtf/Platform.h

    r158445 r158599  
    966966#endif
    967967
    968 #if PLATFORM(MAC) && !PLATFORM(IOS)
     968#if PLATFORM(IOS) || PLATFORM(MAC)
    969969#define WTF_USE_AVFOUNDATION 1
    970970#endif
    971971
    972 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
     972#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
    973973#define WTF_USE_COREMEDIA 1
    974 #endif
    975 
    976 #if (PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     974#define HAVE_AVFOUNDATION_VIDEO_OUTPUT 1
     975#endif
     976
     977#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) || (OS(WINDOWS) && USE(CG)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
    977978#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
    978979#endif
    979980
    980 #if (PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     981#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || (((PLATFORM(MAC) && !PLATFORM(IOS)) || (OS(WINDOWS) && USE(CG))) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
    981982#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
    982 #endif
    983 
    984 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000) || ((PLATFORM(MAC) || (OS(WINDOWS) && USE(CG))) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
    985983#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
     984#endif
     985
     986#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000) || ((PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090)
     987#define HAVE_AVFOUNDATION_LOADER_DELEGATE 1
     988#endif
     989
     990#if (PLATFORM(MAC) && !PLATFORM(IOS)) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     991#define WTF_USE_VIDEOTOOLBOX 1
    986992#endif
    987993
  • trunk/Source/WebCore/ChangeLog

    r158598 r158599  
     12013-11-01  Jer Noble  <jer.noble@apple.com>
     2
     3        [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=123621
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
     9        in iOS (which requries fixing a few compile errors resulting from classes and methods which
     10        are not available on iOS.
     11
     12        * WebCore.exp.in: Export wkAVAssetResolvedURL.
     13        * css/StyleResolver.cpp:
     14        (WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon
     15            new isVideoPluginProxyEnabled() setting.
     16        * html/HTMLMediaElement.cpp:
     17        (WebCore::HTMLMediaElement::parseAttribute): Ditto.
     18        * html/HTMLMediaElement.h:
     19        * html/HTMLVideoElement.cpp:
     20        (WebCore::HTMLVideoElement::createRenderer): Ditto.
     21        (WebCore::HTMLVideoElement::attach): Ditto.
     22        (WebCore::HTMLVideoElement::parseAttribute): Ditto.
     23        (HTMLVideoElement::setDisplayMode): Ditto.
     24        * html/HTMLVideoElement.h:
     25        * page/Settings.cpp:
     26        (WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.
     27        * page/Settings.h:
     28        (WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.
     29        * platform/graphics/MediaPlayer.cpp:
     30        (WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add
     31            MediaPlayerPriateAVFoundationObjC.
     32        * platform/graphics/MediaPlayerPrivate.h:
     33        (WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
     34        (WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.
     35        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
     36        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     37        (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new
     38            HAS_ and USE_ macros instead of __MAC_OS_MIN_VERNSION_REQUIRED.
     39        (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
     40        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
     41        (WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
     42        (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
     43        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
     44        (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
     45        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead
     46            of CGColorGetConstantColor.
     47        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel
     48            format constant instead of QuickDraw constant.
     49        (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
     50        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary
     51            CGImage on iOS.
     52        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
     53        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
     54        * platform/ios/WebCoreSystemInterfaceIOS.mm:
     55        * platform/mac/WebCoreSystemInterface.h:
     56
    1572013-11-04  Andreas Kling  <akling@apple.com>
    258
  • trunk/Source/WebCore/WebCore.exp.in

    r158587 r158599  
    27912791__ZN7WebCore16HTMLMediaElement19deliverNotificationE32MediaPlayerProxyNotificationType
    27922792__ZN7WebCore16HTMLMediaElement19setMediaPlayerProxyEP19WebMediaPlayerProxy
     2793__ZN7WebCore8Settings24gVideoPluginProxyEnabledE
     2794__ZN7WebCore8Settings26setVideoPluginProxyEnabledEb
    27932795__ZN7WebCore9HTMLNames8audioTagE
    27942796#endif
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r158389 r158599  
    188188#endif
    189189
     190#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     191#include "HTMLMediaElement.h"
     192#endif
     193
    190194namespace WebCore {
    191195
     
    672676    // Turn off style sharing for elements that can gain layers for reasons outside of the style system.
    673677    // See comments in RenderObject::setStyle().
    674     if (element->hasTagName(iframeTag) || element->hasTagName(frameTag) || element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag) || element->hasTagName(canvasTag)
     678    if (element->hasTagName(iframeTag) || element->hasTagName(frameTag) || element->hasTagName(embedTag) || element->hasTagName(objectTag) || element->hasTagName(appletTag) || element->hasTagName(canvasTag))
     679        return false;
     680
    675681#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    676         // With proxying, the media elements are backed by a RenderEmbeddedObject.
    677         || element->hasTagName(videoTag) || isHTMLAudioElement(element)
    678 #endif
    679         )
    680         return false;
     682    // With proxying, the media elements are backed by a RenderEmbeddedObject.
     683    if ((element->hasTagName(videoTag) || element->hasTagName(audioTag)) && toMediaElement(element)->shouldUseVideoPluginProxy())
     684        return false;
     685#endif
     686
    681687#endif
    682688
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r158527 r158599  
    548548
    549549#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    550     document().updateStyleIfNeeded();
    551     createMediaPlayerProxy();
     550    if (shouldUseVideoPluginProxy()) {
     551        document().updateStyleIfNeeded();
     552        createMediaPlayerProxy();
     553    }
    552554#endif
    553555   
     
    564566{
    565567#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    566     UNUSED_PARAM(style);
    567     return true;
    568 #else
     568    if (shouldUseVideoPluginProxy())
     569        return true;
     570#endif
    569571    return controls() && HTMLElement::rendererIsNeeded(style);
    570 #endif
    571572}
    572573
     
    574575{
    575576#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    576     // Setup the renderer if we already have a proxy widget.
    577     RenderEmbeddedObject* mediaRenderer = new RenderEmbeddedObject(*this, std::move(style));
    578     if (m_proxyWidget) {
    579         mediaRenderer->setWidget(m_proxyWidget);
    580 
    581         if (Frame* frame = document().frame())
    582             frame->loader().client().showMediaPlayerProxyPlugin(m_proxyWidget.get());
    583     }
    584     return mediaRenderer;
    585 #else
     577    if (shouldUseVideoPluginProxy()) {
     578        // Setup the renderer if we already have a proxy widget.
     579        RenderEmbeddedObject* mediaRenderer = new RenderEmbeddedObject(*this, std::move(style));
     580        if (m_proxyWidget) {
     581            mediaRenderer->setWidget(m_proxyWidget);
     582
     583            if (Frame* frame = document().frame())
     584                frame->loader().client().showMediaPlayerProxyPlugin(m_proxyWidget.get());
     585        }
     586        return mediaRenderer;
     587    }
     588#endif
    586589    return new RenderMedia(*this, std::move(style));
    587 #endif
    588590}
    589591
     
    654656
    655657#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    656     m_needWidgetUpdate = true;
     658    if (shouldUseVideoPluginProxy())
     659        m_needWidgetUpdate = true;
    657660#endif
    658661}
     
    682685    if ((actionType & LoadMediaResource) && !(m_pendingActionFlags & LoadMediaResource)) {
    683686#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    684         createMediaPlayerProxy();
    685 #endif
    686        
     687        if (shouldUseVideoPluginProxy())
     688            createMediaPlayerProxy();
     689#endif
     690
    687691        prepareForLoad();
    688692        setFlags(m_pendingActionFlags, LoadMediaResource);
     
    843847#endif
    844848
    845 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     849#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     850    if (shouldUseVideoPluginProxy())
     851        if (m_player)
     852            m_player->cancelLoad();
     853        else
     854            createMediaPlayerProxy();
     855    } else
     856#endif
    846857    createMediaPlayer();
    847 #else
    848     if (m_player)
    849         m_player->cancelLoad();
    850     else
    851         createMediaPlayerProxy();
    852 #endif
    853858
    854859    // 4 - If the media element's networkState is not set to NETWORK_EMPTY, then run these substeps
     
    10211026    }
    10221027
    1023 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    1024     // Recreate the media player for the new url
    1025     createMediaPlayer();
    1026 #endif
     1028#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     1029    if (!shouldUseVideoPluginProxy())
     1030#endif
     1031        // Recreate the media player for the new url
     1032        createMediaPlayer();
    10271033
    10281034    m_loadState = LoadingFromSourceElement;
     
    41644170#endif
    41654171
    4166 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    4167 
    41684172#if ENABLE(MEDIA_SOURCE)
    41694173    closeMediaSource();
     
    41714175
    41724176    m_player.clear();
    4173 #endif
    41744177    stopPeriodicTimers();
    41754178    m_loadTimer.stop();
     
    42884291{
    42894292#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    4290     auto renderer = this->renderer();
    4291     if (!renderer || !renderer->isWidget())
    4292         return;
    4293 
    4294     if (Widget* widget = toRenderWidget(renderer)->widget())
    4295         widget->handleEvent(event);
    4296 #else
     4293    if (shouldUseVideoPluginProxy()) {
     4294        auto renderer = this->renderer();
     4295        if (!renderer || !renderer->isWidget())
     4296            return;
     4297
     4298        if (Widget* widget = toRenderWidget(renderer)->widget())
     4299            widget->handleEvent(event);
     4300        return;
     4301    }
     4302#endif
    42974303    HTMLElement::defaultEventHandler(event);
    4298 #endif
    42994304}
    43004305
     
    43024307{
    43034308#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    4304     return true;
    4305 #else
     4309    if (shouldUseVideoPluginProxy())
     4310        return true;
     4311#endif
    43064312    return HTMLElement::willRespondToMouseClickEvents();
    4307 #endif
    43084313}
    43094314
     
    47254730void HTMLMediaElement::configureMediaControls()
    47264731{
     4732#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     4733    if (shouldUseVideoPluginProxy()) {
     4734        if (m_player)
     4735            m_player->setControls(controls());
     4736
     4737        if (!hasMediaControls() && inDocument())
     4738            createMediaControls();
     4739        return;
     4740    }
     4741#endif
     4742
    47274743#if ENABLE(MEDIA_CONTROLS_SCRIPT)
    47284744    if (!controls() || !inDocument())
     
    47314747    ensureUserAgentShadowRoot();
    47324748    return;
    4733 #elif !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     4749#endif
     4750
    47344751    if (!controls() || !inDocument()) {
    47354752        if (hasMediaControls())
     
    47424759
    47434760    mediaControls()->show();
    4744 #else
    4745     if (m_player)
    4746         m_player->setControls(controls());
    4747 
    4748     if (!hasMediaControls() && inDocument())
    4749         createMediaControls();
    4750 #endif
    47514761}
    47524762
     
    51865196}
    51875197
     5198#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     5199bool HTMLMediaElement::shouldUseVideoPluginProxy() const
     5200{
     5201    return document()->settings() && document()->settings()->isVideoPluginProxyEnabled();
     5202}
     5203#endif
     5204
    51885205#if ENABLE(MEDIA_CONTROLS_SCRIPT)
    51895206DOMWrapperWorld& HTMLMediaElement::ensureIsolatedWorld()
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r158527 r158599  
    384384    void enteredOrExitedFullscreen() { configureMediaControls(); }
    385385
     386#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     387    bool shouldUseVideoPluginProxy() const;
     388#endif
     389
    386390protected:
    387391    HTMLMediaElement(const QualifiedName&, Document&, bool);
     
    428432#endif
    429433
     434    virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
     435
    430436private:
    431437    void createMediaPlayer();
     
    438444    virtual bool isMouseFocusable() const OVERRIDE;
    439445    virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE;
    440     virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
    441446    virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE;
    442447    virtual InsertionNotificationRequest insertedInto(ContainerNode&) OVERRIDE;
  • trunk/Source/WebCore/html/HTMLVideoElement.cpp

    r158097 r158599  
    6969}
    7070
    71 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    7271RenderElement* HTMLVideoElement::createRenderer(PassRef<RenderStyle> style)
    7372{
     73#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     74    if (shouldUseVideoPluginProxy())
     75        return HTMLMediaElement::createRenderer(arena, style);
     76#endif
    7477    return new RenderVideo(*this, std::move(style));
    7578}
    76 #endif
    7779
    7880void HTMLVideoElement::didAttachRenderers()
     
    8082    HTMLMediaElement::didAttachRenderers();
    8183
    82 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    83     updateDisplayState();
    84     if (shouldDisplayPosterImage()) {
    85         if (!m_imageLoader)
    86             m_imageLoader = adoptPtr(new HTMLImageLoader(this));
    87         m_imageLoader->updateFromElement();
    88         if (renderer())
    89             toRenderImage(renderer())->imageResource()->setCachedImage(m_imageLoader->image());
     84#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     85    if (!shouldUseVideoPluginProxy()) {
     86#endif
     87        updateDisplayState();
     88        if (shouldDisplayPosterImage()) {
     89            if (!m_imageLoader)
     90                m_imageLoader = adoptPtr(new HTMLImageLoader(this));
     91            m_imageLoader->updateFromElement();
     92            if (renderer())
     93                toRenderImage(renderer())->imageResource()->setCachedImage(m_imageLoader->image());
     94        }
     95#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    9096    }
    9197#endif
     
    115121        HTMLMediaElement::setDisplayMode(Unknown);
    116122        updateDisplayState();
    117 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     123#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     124        if (shouldUseVideoPluginProxy())
     125            return;
     126#endif
    118127        if (shouldDisplayPosterImage()) {
    119128            if (!m_imageLoader)
     
    124133                toRenderImage(renderer())->imageResource()->setCachedImage(0);
    125134        }
    126 #endif
    127135    } else
    128136        HTMLMediaElement::parseAttribute(name, value);
     
    221229    }
    222230
    223 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     231#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     232    if (shouldUseVideoPluginProxy())
     233        return;
     234#endif
    224235    if (renderer() && displayMode() != oldMode)
    225236        renderer()->updateFromElement();
    226 #endif
    227237}
    228238
  • trunk/Source/WebCore/html/HTMLVideoElement.h

    r158097 r158599  
    7676
    7777    virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE;
    78 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    7978    virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
    80 #endif
    8179    virtual void didAttachRenderers() OVERRIDE;
    8280    virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
  • trunk/Source/WebCore/page/Settings.cpp

    r158326 r158599  
    8282#endif
    8383
     84#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     85bool Settings::gVideoPluginProxyEnabled = true;
     86#endif
     87
    8488bool Settings::gMockScrollbarsEnabled = false;
    8589bool Settings::gUsesOverlayScrollbars = false;
     
    580584#endif
    581585
     586#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     587void Settings::setVideoPluginProxyEnabled(bool enabled)
     588{
     589    if (gVideoPluginProxyEnabled == enabled)
     590        return;
     591
     592    gVideoPluginProxyEnabled = enabled;
     593    HTMLMediaElement::resetMediaEngines();
     594}
     595#endif
     596
    582597void Settings::setScrollingPerformanceLoggingEnabled(bool enabled)
    583598{
  • trunk/Source/WebCore/page/Settings.h

    r157455 r158599  
    268268    static void setLowPowerVideoAudioBufferSizeEnabled(bool);
    269269
     270#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     271    static void setVideoPluginProxyEnabled(bool flag);
     272    static bool isVideoPluginProxyEnabled() { return gVideoPluginProxyEnabled; }
     273#endif
     274
    270275private:
    271276    explicit Settings(Page*);
     
    354359
    355360    static bool gLowPowerVideoAudioBufferSizeEnabled;
     361
     362#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     363    static bool gVideoPluginProxyEnabled;
     364#endif
    356365};
    357366
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r158291 r158599  
    205205        enginesQueried = true;
    206206
     207#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     208    if (Settings::isVideoPluginProxyEnabled())
     209        MediaPlayerPrivateIOS::registerMediaEngine(addMediaEngine);
     210#endif
     211
    207212#if USE(AVFOUNDATION)
    208213        if (Settings::isAVFoundationEnabled()) {
    209 #if PLATFORM(MAC)
     214#if PLATFORM(MAC) || PLATFORM(IOS)
    210215            MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
    211216#elif PLATFORM(WIN)
  • trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h

    r156049 r158599  
    130130
    131131#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    132     virtual void deliverNotification(MediaPlayerProxyNotificationType) = 0;
    133     virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) = 0;
     132    virtual void deliverNotification(MediaPlayerProxyNotificationType) { }
     133    virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) { }
    134134    virtual void setControls(bool) { }
    135135#endif
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h

    r157834 r158599  
    4747typedef struct objc_object* id;
    4848
    49 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     49#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    5050OBJC_CLASS WebCoreAVFLoaderDelegate;
    5151OBJC_CLASS AVAssetResourceLoadingRequest;
     
    7878#endif
    7979   
    80 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     80#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    8181    bool shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest*);
    8282    void didCancelLoadingRequest(AVAssetResourceLoadingRequest*);
     
    157157    void paintWithImageGenerator(GraphicsContext*, const IntRect&);
    158158
    159 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     159#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    160160    void createVideoOutput();
    161161    void destroyVideoOutput();
     
    201201
    202202    RetainPtr<AVAssetImageGenerator> m_imageGenerator;
    203 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     203#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    204204    RetainPtr<AVPlayerItemVideoOutput> m_videoOutput;
    205205    RetainPtr<CVPixelBufferRef> m_lastImage;
    206206#endif
    207207
    208 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     208#if USE(VIDEOTOOLBOX)
    209209    RetainPtr<VTPixelTransferSessionRef> m_pixelTransferSession;
    210 
     210#endif
     211
     212#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    211213    friend class WebCoreAVFResourceLoader;
    212214    HashMap<RetainPtr<AVAssetResourceLoadingRequest>, RefPtr<WebCoreAVFResourceLoader>> m_resourceLoaderMap;
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r158597 r158599  
    6262#import <AVFoundation/AVFoundation.h>
    6363#import <CoreMedia/CoreMedia.h>
    64 
    65 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     64#import <QuartzCore/CoreImage.h>
     65
     66#if USE(VIDEOTOOLBOX)
    6667#import <CoreVideo/CoreVideo.h>
    6768#import <VideoToolbox/VideoToolbox.h>
     
    7071SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
    7172SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
    72 
    73 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     73SOFT_LINK_FRAMEWORK_OPTIONAL(CoreImage)
    7474SOFT_LINK_FRAMEWORK_OPTIONAL(CoreVideo)
     75
     76#if USE(VIDEOTOOLBOX)
    7577SOFT_LINK_FRAMEWORK_OPTIONAL(VideoToolbox)
    7678#endif
     
    8183SOFT_LINK(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
    8284
    83 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
    8485SOFT_LINK(CoreVideo, CVPixelBufferGetWidth, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
    8586SOFT_LINK(CoreVideo, CVPixelBufferGetHeight, size_t, (CVPixelBufferRef pixelBuffer), (pixelBuffer))
     87#if USE(VIDEOTOOLBOX)
    8688SOFT_LINK(VideoToolbox, VTPixelTransferSessionCreate, OSStatus, (CFAllocatorRef allocator, VTPixelTransferSessionRef *pixelTransferSessionOut), (allocator, pixelTransferSessionOut))
    8789SOFT_LINK(VideoToolbox, VTPixelTransferSessionTransferImage, OSStatus, (VTPixelTransferSessionRef session, CVPixelBufferRef sourceBuffer, CVPixelBufferRef destinationBuffer), (session, sourceBuffer, destinationBuffer))
     
    9496SOFT_LINK_CLASS(AVFoundation, AVURLAsset)
    9597SOFT_LINK_CLASS(AVFoundation, AVAssetImageGenerator)
     98SOFT_LINK_CLASS(CoreImage, CIContext)
     99SOFT_LINK_CLASS(CoreImage, CIImage)
    96100
    97101SOFT_LINK_POINTER(AVFoundation, AVMediaCharacteristicVisual, NSString *)
     
    105109SOFT_LINK_POINTER(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
    106110SOFT_LINK_POINTER(AVFoundation, AVLayerVideoGravityResize, NSString *)
     111SOFT_LINK_POINTER(CoreVideo, kCVPixelBufferPixelFormatTypeKey, NSString *)
    107112
    108113SOFT_LINK_CONSTANT(CoreMedia, kCMTimeZero, CMTime)
     
    125130#define AVLayerVideoGravityResizeAspect getAVLayerVideoGravityResizeAspect()
    126131#define AVLayerVideoGravityResize getAVLayerVideoGravityResize()
     132#define kCVPixelBufferPixelFormatTypeKey getkCVPixelBufferPixelFormatTypeKey()
    127133
    128134#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
     
    180186@end
    181187
    182 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     188#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    183189@interface WebCoreAVFLoaderDelegate : NSObject<AVAssetResourceLoaderDelegate> {
    184190    MediaPlayerPrivateAVFoundationObjC* m_callback;
     
    211217#endif
    212218
    213 #if ENABLE(ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA_V2)
     219#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    214220static dispatch_queue_t globalLoaderDelegateQueue()
    215221{
     
    239245    , m_videoFrameHasDrawn(false)
    240246    , m_haveCheckedPlayability(false)
    241 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     247#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    242248    , m_loaderDelegate(adoptNS([[WebCoreAVFLoaderDelegate alloc] initWithCallback:this]))
    243249#endif
     
    254260    playerToPrivateMap().remove(player());
    255261#endif
    256 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     262#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    257263    [m_loaderDelegate.get() setCallback:0];
    258264    [[m_avAsset.get() resourceLoader] setDelegate:nil queue:0];
     
    309315bool MediaPlayerPrivateAVFoundationObjC::hasContextRenderer() const
    310316{
    311 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     317#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    312318    if (m_videoOutput)
    313319        return true;
     
    318324void MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer()
    319325{
    320 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     326#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    321327    createVideoOutput();
    322328#else
     
    344350void MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer()
    345351{
    346 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     352#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    347353    destroyVideoOutput();
    348354#endif
     
    368374        m_videoLayer = adoptNS([[AVPlayerLayer alloc] init]);
    369375        [m_videoLayer.get() setPlayer:m_avPlayer.get()];
    370         [m_videoLayer.get() setBackgroundColor:CGColorGetConstantColor(kCGColorBlack)];
     376        [m_videoLayer.get() setBackgroundColor:cachedCGColor(Color::black, ColorSpaceDeviceRGB)];
    371377#ifndef NDEBUG
    372378        [m_videoLayer.get() setName:@"Video layer"];
     
    428434    m_avAsset = adoptNS([[AVURLAsset alloc] initWithURL:cocoaURL options:options.get()]);
    429435
    430 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     436#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    431437    [[m_avAsset.get() resourceLoader] setDelegate:m_loaderDelegate.get() queue:globalLoaderDelegateQueue()];
    432438#endif
     
    794800    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    795801
    796 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     802#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    797803    if (videoOutputHasAvailableFrame())
    798804        paintWithVideoOutput(context, rect);
     
    922928}
    923929
    924 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     930#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    925931bool MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource(AVAssetResourceLoadingRequest* avRequest)
    926932{
     
    11781184}
    11791185
    1180 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     1186#if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
    11811187void MediaPlayerPrivateAVFoundationObjC::createVideoOutput()
    11821188{
     
    11861192        return;
    11871193
    1188 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     1194#if USE(VIDEOTOOLBOX)
    11891195    NSDictionary* attributes = @{ (NSString*)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_422YpCbCr8) };
    11901196#else
    1191     NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:k32BGRAPixelFormat], kCVPixelBufferPixelFormatTypeKey,
     1197    NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA], kCVPixelBufferPixelFormatTypeKey,
    11921198                                nil];
    11931199#endif
     
    12311237        return 0;
    12321238
    1233 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     1239#if USE(VIDEOTOOLBOX)
    12341240    // Create a VTPixelTransferSession, if necessary, as we cannot guarantee timely delivery of ARGB pixels.
    12351241    if (!m_pixelTransferSession) {
     
    12401246
    12411247    CVPixelBufferRef outputBuffer;
    1242     CVPixelBufferCreate(kCFAllocatorDefault, CVPixelBufferGetWidth(buffer.get()), CVPixelBufferGetHeight(buffer.get()), k32BGRAPixelFormat, 0, &outputBuffer);
     1248    CVPixelBufferCreate(kCFAllocatorDefault, CVPixelBufferGetWidth(buffer.get()), CVPixelBufferGetHeight(buffer.get()), kCVPixelFormatType_32BGRA, 0, &outputBuffer);
    12431249    VTPixelTransferSessionTransferImage(m_pixelTransferSession.get(), buffer.get(), outputBuffer);
    12441250    buffer = adoptCF(outputBuffer);
     
    12811287        context->translate(rect.x(), rect.y() + rect.height());
    12821288        context->scale(FloatSize(1.0f, -1.0f));
    1283         RetainPtr<CIImage> image = adoptNS([[CIImage alloc] initWithCVImageBuffer:m_lastImage.get() options:@{ kCIImageColorSpace: (id)deviceRGBColorSpaceRef() }]);
     1289
     1290        CGRect outputRect = { CGPointZero, rect.size() };
     1291        CGRect imageRect = CGRectMake(0, 0, CVPixelBufferGetWidth(m_lastImage.get()), CVPixelBufferGetHeight(m_lastImage.get()));
     1292#if PLATFORM(IOS)
     1293        // ciContext does not use a RetainPtr for results of contextWithCGContext:, as the returned value
     1294        // is autoreleased, and there is no non-autoreleased version of that function.
     1295        CIContext* ciContext = [getCIContextClass() contextWithOptions:nil];
     1296        RetainPtr<CIImage> image = adoptNS([[getCIImageClass() alloc] initWithCVPixelBuffer:m_lastImage.get()]);
     1297        RetainPtr<CGImage> cgImage = adoptCF([ciContext createCGImage:image.get() fromRect:imageRect]);
     1298        context->drawNativeImage(cgImage.get(), FloatSize(imageRect.size), ColorSpaceDeviceRGB, FloatRect(outputRect), FloatRect(imageRect), 1);
     1299#else
    12841300
    12851301        // ciContext does not use a RetainPtr for results of contextWithCGContext:, as the returned value
    12861302        // is autoreleased, and there is no non-autoreleased version of that function.
    12871303        CIContext* ciContext = [CIContext contextWithCGContext:context->platformContext() options:nil];
    1288         CGRect outputRect = { CGPointZero, rect.size() };
    1289         CGRect imageRect = CGRectMake(0, 0, CVPixelBufferGetWidth(m_lastImage.get()), CVPixelBufferGetHeight(m_lastImage.get()));
     1304        RetainPtr<CIImage> image = adoptNS([[CIImage alloc] initWithCVImageBuffer:m_lastImage.get() options:@{ kCIImageColorSpace: (id)deviceRGBColorSpaceRef() }]);
    12901305        [ciContext drawImage:image.get() inRect:outputRect fromRect:imageRect];
     1306#endif
    12911307
    12921308        // If we have created an AVAssetImageGenerator in the past due to m_videoOutput not having an available
     
    17771793@end
    17781794
    1779 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     1795#if HAVE(AVFOUNDATION_LOADER_DELEGATE)
    17801796@implementation WebCoreAVFLoaderDelegate
    17811797
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h

    r153706 r158599  
    2727#define WebCoreAVFResourceLoader_h
    2828
    29 #if ENABLE(VIDEO) && USE(AVFOUNDATION) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     29#if ENABLE(VIDEO) && USE(AVFOUNDATION) && HAVE(AVFOUNDATION_LOADER_DELEGATE)
    3030
    3131#include "CachedRawResourceClient.h"
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm

    r156550 r158599  
    2727#import "WebCoreAVFResourceLoader.h"
    2828
    29 #if ENABLE(VIDEO) && USE(AVFOUNDATION) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     29#if ENABLE(VIDEO) && USE(AVFOUNDATION) && HAVE(AVFOUNDATION_LOADER_DELEGATE)
    3030
    3131#import "CachedRawResource.h"
  • trunk/Source/WebKit/mac/ChangeLog

    r158454 r158599  
     12013-11-01  Jer Noble  <jer.noble@apple.com>
     2
     3        [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=123621
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add a new isVideoPluginProxyEnabled setting.
     9
     10        * WebView/WebPreferenceKeysPrivate.h:
     11        * WebView/WebPreferences.mm:
     12        (+[WebPreferences initialize]): Set isVideoPluginProxyEnabled preference.
     13        (-[WebPreferences isVideoPluginProxyEnabled]): Pass through to Settings.
     14        * WebView/WebPreferencesPrivate.h:
     15        * WebView/WebView.mm:
     16        (-[WebView _preferencesChanged:]): Set isVideoPluginProxyEnabled preference.
     17
    1182013-11-01  Andy Estes  <aestes@apple.com>
    219
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r157843 r158599  
    114114#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
    115115#define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
     116#define WebKitVideoPluginProxyEnabledKey @"WebKitVideoPluginProxyEnabled"
    116117#define WebKitHixie76WebSocketProtocolEnabledKey @"WebKitHixie76WebSocketProtocolEnabled"
    117118#define WebKitMediaPlaybackRequiresUserGesturePreferenceKey @"WebKitMediaPlaybackRequiresUserGesture"
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r157843 r158599  
    426426        [NSNumber numberWithBool:NO], WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
    427427        [NSNumber numberWithBool:NO], WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
     428#if !PLATFORM(IOS)
     429        [NSNumber numberWithBool:NO],   WebKitVideoPluginProxyEnabledKey,
     430#endif
    428431        nil];
    429432
     
    16681671}
    16691672
     1673- (void)setVideoPluginProxyEnabled:(BOOL)flag
     1674{
     1675    [self _setBoolValue:flag forKey:WebKitVideoPluginProxyEnabledKey];
     1676}
     1677
     1678- (BOOL)isVideoPluginProxyEnabled
     1679{
     1680    return [self _boolValueForKey:WebKitVideoPluginProxyEnabledKey];
     1681}
     1682
    16701683- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag
    16711684{
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r157843 r158599  
    290290- (BOOL)isQTKitEnabled;
    291291
     292// VideoPluginProxy support is dependent on WebCore/WebKit being
     293// compiled with ENABLE_PLUGIN_PROXY_FOR_VIDEO.
     294- (void)setVideoPluginProxyEnabled:(BOOL)flag;
     295- (BOOL)isVideoPluginProxyEnabled;
     296
    292297// WebSocket support depends on ENABLE(WEB_SOCKETS).
    293298- (void)setHixie76WebSocketProtocolEnabled:(BOOL)flag;
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r158330 r158599  
    17201720    settings.setLowPowerVideoAudioBufferSizeEnabled([preferences lowPowerVideoAudioBufferSizeEnabled]);
    17211721
     1722#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     1723    settings->setVideoPluginProxyEnabled([preferences isVideoPluginProxyEnabled]);
     1724#endif
     1725
    17221726    switch ([preferences storageBlockingPolicy]) {
    17231727    case WebAllowAllStorage:
  • trunk/Source/WebKit2/ChangeLog

    r158595 r158599  
     12013-11-01  Jer Noble  <jer.noble@apple.com>
     2
     3        [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
     4        https://bugs.webkit.org/show_bug.cgi?id=123621
     5
     6        Reviewed by Eric Carlson.
     7
     8        Add WebKit2 functions for setting then new isVideoPluginProxyEnabled preference.
     9
     10        * Shared/WebPreferencesStore.h:
     11        * UIProcess/API/C/WKPreferences.cpp:
     12        (WKPreferencesSetVideoPluginProxyEnabled):
     13        (WKPreferencesGetVideoPluginProxyEnabled):
     14        * UIProcess/API/C/WKPreferences.h:
     15        * WebProcess/WebPage/WebPage.cpp:
     16        (WebKit::WebPage::updatePreferences):
     17
    1182013-11-04  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.h

    r158360 r158599  
    6363#define DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED false
    6464#define DEFAULT_PDFPLUGIN_ENABLED false
     65#endif
     66
     67#if PLATFORM(IOS)
     68#define DEFAULT_VIDEO_PLUGIN_PROXY_ENABLED true
     69#else
     70#define DEFAULT_VIDEO_PLUGIN_PROXY_ENABLED false
    6571#endif
    6672
     
    169175    macro(SimpleLineLayoutDebugBordersEnabled, simpleLineLayoutDebugBordersEnabled, Bool, bool, false) \
    170176    macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
     177    macro(VideoPluginProxyEnabled, isVideoPluginProxyEnabled, Bool, bool, DEFAULT_VIDEO_PLUGIN_PROXY_ENABLED) \
    171178    \
    172179
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r158360 r158599  
    12061206    return toImpl(preferencesRef)->mediaStreamEnabled();
    12071207}
     1208
     1209void WKPreferencesSetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef, bool enabled)
     1210{
     1211    toImpl(preferencesRef)->setVideoPluginProxyEnabled(enabled);
     1212}
     1213
     1214bool WKPreferencesGetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef)
     1215{
     1216    return toImpl(preferencesRef)->isVideoPluginProxyEnabled();
     1217}
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.h

    r158360 r158599  
    245245WK_EXPORT bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef);
    246246
     247// Defaults to true.
     248WK_EXPORT void WKPreferencesSetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef, bool enabled);
     249WK_EXPORT bool WKPreferencesGetVideoPluginProxyEnabled(WKPreferencesRef preferencesRef);
     250
    247251#ifdef __cplusplus
    248252}
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r158451 r158599  
    24242424#endif
    24252425
     2426#if USE(PLUGIN_PROXY_FOR_VIDEO)
     2427    settings->setVideoPluginProxyEnabled(store.getBoolValueForKey(WebPreferencesKey::isVideoPluginProxyEnabledKey()));
     2428#endif
     2429
    24262430#if ENABLE(WEB_AUDIO)
    24272431    settings.setWebAudioEnabled(store.getBoolValueForKey(WebPreferencesKey::webAudioEnabledKey()));
Note: See TracChangeset for help on using the changeset viewer.