Changeset 87312 in webkit


Ignore:
Timestamp:
May 25, 2011 12:22:25 PM (13 years ago)
Author:
alexis.menard@openbossa.org
Message:

2011-05-25 Alexis Menard <alexis.menard@openbossa.org>

Reviewed by Eric Carlson.

[Qt] Enable usage of QuickTime mediaplayer for the Qt port on Mac.
https://bugs.webkit.org/show_bug.cgi?id=61279

Enable the QuickTime backend for the Qt port on Mac. The patch adds the bits in WebCore
to enable the QTKit backend of the Mac port. It can be enabled by passing DEFINES+=USE_QTKIT=1
when calling build-webkit.

  • WebCore.pri:
  • WebCore.pro:
  • features.pri:
  • platform/KURL.h:
  • platform/SharedBuffer.h:
  • platform/cf/KURLCFNet.cpp:
  • platform/cf/SharedBufferCF.cpp:
  • platform/graphics/FloatSize.h:
  • platform/graphics/IntRect.h:
  • platform/graphics/IntSize.h:
  • platform/graphics/MediaPlayer.cpp:
  • platform/graphics/cg/FloatSizeCG.cpp:
  • platform/graphics/cg/IntRectCG.cpp:
  • platform/graphics/mac/MediaPlayerPrivateQTKit.h:
  • platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::createQTMovieView): (WebCore::MediaPlayerPrivateQTKit::createQTVideoRenderer): (WebCore::MediaPlayerPrivateQTKit::createQTMovieLayer): (WebCore::MediaPlayerPrivateQTKit::preferredRenderingMode): (WebCore::MediaPlayerPrivateQTKit::paint): (-[WebCoreMovieObserver layerHostChanged:]):
  • platform/mac/KURLMac.mm:
  • platform/mac/SharedBufferMac.mm: (+[WebCoreSharedBufferData initialize]):
  • platform/mac/WebCoreObjCExtras.mm:
  • platform/qt/WebCoreSystemInterface.h: Added.
  • platform/qt/WebCoreSystemInterface.mm: Added.

2011-05-25 Alexis Menard <alexis.menard@openbossa.org>

Reviewed by Eric Carlson.

[Qt] Enable usage of QuickTime mediaplayer for the Qt port on Mac.
https://bugs.webkit.org/show_bug.cgi?id=61279

Enable the usage of QuickTime backend for the Qt port. It can be enabled by
passing DEFINES+=USE_QTKIT=1 when calling build-webkit.

  • Api/qwebpage.cpp: (QWebPagePrivate::QWebPagePrivate):
  • QtWebKit.pro:
  • WebCoreSupport/FullScreenVideoQt.cpp: (WebCore::FullScreenVideoQt::enterFullScreenForNode): (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback): (WebCore::FullScreenVideoQt::isValid):
  • WebCoreSupport/WebSystemInterface.h: Added.
  • WebCoreSupport/WebSystemInterface.mm: Added. (InitWebCoreSystemInterface):
Location:
trunk/Source
Files:
3 added
23 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87310 r87312  
     12011-05-25  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        [Qt] Enable usage of QuickTime mediaplayer for the Qt port on Mac.
     6        https://bugs.webkit.org/show_bug.cgi?id=61279
     7
     8        Enable the QuickTime backend for the Qt port on Mac. The patch adds the bits in WebCore
     9        to enable the QTKit backend of the Mac port. It can be enabled by passing DEFINES+=USE_QTKIT=1
     10        when calling build-webkit.
     11
     12        * WebCore.pri:
     13        * WebCore.pro:
     14        * features.pri:
     15        * platform/KURL.h:
     16        * platform/SharedBuffer.h:
     17        * platform/cf/KURLCFNet.cpp:
     18        * platform/cf/SharedBufferCF.cpp:
     19        * platform/graphics/FloatSize.h:
     20        * platform/graphics/IntRect.h:
     21        * platform/graphics/IntSize.h:
     22        * platform/graphics/MediaPlayer.cpp:
     23        * platform/graphics/cg/FloatSizeCG.cpp:
     24        * platform/graphics/cg/IntRectCG.cpp:
     25        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
     26        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
     27        (WebCore::MediaPlayerPrivateQTKit::createQTMovieView):
     28        (WebCore::MediaPlayerPrivateQTKit::createQTVideoRenderer):
     29        (WebCore::MediaPlayerPrivateQTKit::createQTMovieLayer):
     30        (WebCore::MediaPlayerPrivateQTKit::preferredRenderingMode):
     31        (WebCore::MediaPlayerPrivateQTKit::paint):
     32        (-[WebCoreMovieObserver layerHostChanged:]):
     33        * platform/mac/KURLMac.mm:
     34        * platform/mac/SharedBufferMac.mm:
     35        (+[WebCoreSharedBufferData initialize]):
     36        * platform/mac/WebCoreObjCExtras.mm:
     37        * platform/qt/WebCoreSystemInterface.h: Added.
     38        * platform/qt/WebCoreSystemInterface.mm: Added.
     39
    1402011-05-25  Rob Buis  <rbuis@rim.com>
    241
  • trunk/Source/WebCore/WebCore.pri

    r86949 r87312  
    244244
    245245contains(DEFINES, ENABLE_VIDEO=1) {
    246     contains(DEFINES, USE_GSTREAMER=1) {
     246    contains(DEFINES, USE_QTKIT=1) {
     247        DEFINES += WTF_USE_QTKIT=1
     248
     249        INCLUDEPATH += $$PWD/platform/graphics/mac
     250
     251        LIBS += -framework AppKit -framework AudioUnit \
     252                -framework AudioToolbox -framework CoreAudio \
     253                -framework QuartzCore -framework QTKit
     254
     255    } else:contains(DEFINES, USE_GSTREAMER=1) {
    247256        DEFINES += WTF_USE_GSTREAMER=1
    248257        DEFINES += ENABLE_GLIB_SUPPORT=1
  • trunk/Source/WebCore/WebCore.pro

    r87293 r87312  
    29612961    }
    29622962
    2963     contains(DEFINES, USE_GSTREAMER=1) {
     2963    contains(DEFINES, USE_QTKIT=1) {
     2964        HEADERS += \
     2965            platform/graphics/mac/MediaPlayerPrivateQTKit.h \
     2966            platform/mac/WebCoreObjCExtras.h \
     2967            platform/qt/WebCoreSystemInterface.h \
     2968            platform/mac/BlockExceptions.h \
     2969            platform/mac/WebCoreObjCExtras.h
     2970        SOURCES += \
     2971            platform/graphics/mac/MediaPlayerPrivateQTKit.mm \
     2972            platform/mac/SharedBufferMac.mm \
     2973            platform/mac/KURLMac.mm \
     2974            platform/text/mac/StringMac.mm \
     2975            platform/graphics/mac/FloatSizeMac.mm \
     2976            platform/graphics/mac/IntRectMac.mm \
     2977            platform/graphics/cg/IntRectCG.cpp \
     2978            platform/graphics/cg/FloatSizeCG.cpp \
     2979            platform/cf/SharedBufferCF.cpp \
     2980            platform/cf/KURLCFNet.cpp \
     2981            platform/qt/WebCoreSystemInterface.mm \
     2982            platform/mac/BlockExceptions.mm \
     2983            platform/mac/WebCoreObjCExtras.mm
     2984
     2985        DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     2986
     2987    } else: contains(DEFINES, USE_GSTREAMER=1) {
    29642988        HEADERS += \
    29652989            platform/graphics/gstreamer/GOwnPtrGStreamer.h \
  • trunk/Source/WebCore/features.pri

    r87274 r87312  
    165165    DEFINES += ENABLE_VIDEO=0
    166166
    167     contains(DEFINES, USE_GSTREAMER=1) {
     167    contains(DEFINES, USE_QTKIT=1) {
     168        DEFINES -= ENABLE_VIDEO=0
     169        DEFINES += ENABLE_VIDEO=1
     170        DEFINES -= WTF_USE_QT_MULTIMEDIA=1
     171        DEFINES += WTF_USE_QT_MULTIMEDIA=0
     172    } else: contains(DEFINES, USE_GSTREAMER=1) {
    168173        DEFINES -= ENABLE_VIDEO=0
    169174        DEFINES += ENABLE_VIDEO=1
  • trunk/Source/WebCore/platform/KURL.h

    r85056 r87312  
    3535#endif
    3636
    37 #if PLATFORM(MAC)
     37#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    3838#ifdef __OBJC__
    3939@class NSURL;
     
    203203#endif
    204204
    205 #if PLATFORM(MAC)
     205#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    206206    KURL(NSURL*);
    207207    operator NSURL*() const;
  • trunk/Source/WebCore/platform/SharedBuffer.h

    r81710 r87312  
    3737#endif
    3838
    39 #if PLATFORM(MAC)
     39#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    4040#ifdef __OBJC__
    4141@class NSData;
     
    6666    ~SharedBuffer();
    6767   
    68 #if PLATFORM(MAC)
     68#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    6969    NSData *createNSData();
    7070    static PassRefPtr<SharedBuffer> wrapNSData(NSData *data);
  • trunk/Source/WebCore/platform/cf/KURLCFNet.cpp

    r30333 r87312  
    7979}
    8080
     81#if !(PLATFORM(QT) && USE(QTKIT))
    8182String KURL::fileSystemPath() const
    8283{
     
    9293    return RetainPtr<CFStringRef>(AdoptCF, CFURLCopyFileSystemPath(cfURL.get(), pathStyle)).get();
    9394}
    94 
     95#endif
    9596}
  • trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp

    r81710 r87312  
    4141// Mac is a CF platform but has an even more efficient version of this method,
    4242// so only use this version for non-Mac
    43 #if !PLATFORM(MAC)
     43#if !PLATFORM(MAC) && !(PLATFORM(QT) && USE(QTKIT))
    4444CFDataRef SharedBuffer::createCFData()
    4545{
  • trunk/Source/WebCore/platform/graphics/FloatSize.h

    r87302 r87312  
    3636#endif
    3737
    38 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
     38#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(QT) && USE(QTKIT))
    3939#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
    4040typedef struct CGSize NSSize;
     
    9898
    9999#if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \
    100         || (PLATFORM(CHROMIUM) && OS(DARWIN))
     100        || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(QT) && USE(QTKIT))
    101101    explicit FloatSize(const NSSize &); // don't do this implicitly since it's lossy
    102102    operator NSSize() const;
  • trunk/Source/WebCore/platform/graphics/IntRect.h

    r87303 r87312  
    3434#endif
    3535
    36 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
     36#if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(QT) && USE(QTKIT))
    3737#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
    3838typedef struct CGRect NSRect;
     
    204204
    205205#if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \
    206         || (PLATFORM(CHROMIUM) && OS(DARWIN))
     206        || (PLATFORM(CHROMIUM) && OS(DARWIN))  || (PLATFORM(QT) && USE(QTKIT))
    207207    operator NSRect() const;
    208208#endif
     
    244244
    245245#if (PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)) \
    246         || (PLATFORM(CHROMIUM) && OS(DARWIN))
     246        || (PLATFORM(CHROMIUM) && OS(DARWIN)) || (PLATFORM(QT) && USE(QTKIT))
    247247IntRect enclosingIntRect(const NSRect&);
    248248#endif
  • trunk/Source/WebCore/platform/graphics/IntSize.h

    r84101 r87312  
    3131#endif
    3232
    33 #if PLATFORM(MAC)
     33#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    3434#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
    3535typedef struct CGSize NSSize;
     
    115115#endif
    116116
    117 #if PLATFORM(MAC) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
     117#if (PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))) && !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
    118118    explicit IntSize(const NSSize &); // don't do this implicitly since it's lossy
    119119    operator NSSize() const;
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r86501 r87312  
    4747#endif
    4848
    49 #if PLATFORM(MAC)
     49#if PLATFORM(MAC) || (PLATFORM(QT) && USE(QTKIT))
    5050#include "MediaPlayerPrivateQTKit.h"
    5151#if USE(AVFOUNDATION)
     
    6363#include "MediaPlayerPrivateQt.h"
    6464#define PlatformMediaEngineClassName MediaPlayerPrivateQt
    65 #elif !USE(GSTREAMER)
     65#elif !USE(GSTREAMER) && !USE(QTKIT)
    6666#include "MediaPlayerPrivatePhonon.h"
    6767#define PlatformMediaEngineClassName MediaPlayerPrivatePhonon
  • trunk/Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp

    r84101 r87312  
    2828#include "FloatSize.h"
    2929
    30 #if USE(CG) || USE(SKIA_ON_MAC_CHROME)
     30#if USE(CG) || USE(SKIA_ON_MAC_CHROME) || (PLATFORM(QT) && USE(QTKIT))
    3131
    3232#include <ApplicationServices/ApplicationServices.h>
  • trunk/Source/WebCore/platform/graphics/cg/IntRectCG.cpp

    r84101 r87312  
    2727#include "IntRect.h"
    2828
    29 #if USE(CG) || USE(SKIA_ON_MAC_CHROME)
     29#if USE(CG) || USE(SKIA_ON_MAC_CHROME) || (PLATFORM(QT) && USE(QTKIT))
    3030
    3131#include <ApplicationServices/ApplicationServices.h>
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h

    r86588 r87312  
    4242@class WebCoreMovieObserver;
    4343#else
     44class NSDictionary;
     45class NSMutableDictionary;
    4446class QTMovie;
    4547class QTMovieView;
     
    8688
    8789    PlatformMedia platformMedia() const;
    88 #if USE(ACCELERATED_COMPOSITING)
     90#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    8991    PlatformLayer* platformLayer() const;
    9092#endif
     
    138140
    139141
    140 #if USE(ACCELERATED_COMPOSITING)
     142#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    141143    bool supportsAcceleratedRendering() const;
    142144    void acceleratedRenderingStateChanged();
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

    r86591 r87312  
    3939#import "Frame.h"
    4040#import "FrameView.h"
     41#import "HostWindow.h"
    4142#import "GraphicsContext.h"
    4243#import "KURL.h"
     
    5960#import "RenderStyle.h"
    6061#endif
    61 
    6262
    6363SOFT_LINK_FRAMEWORK(QTKit)
     
    456456    m_qtMovieView.adoptNS([[QTMovieView alloc] init]);
    457457    setSize(m_player->size());
    458     NSView* parentView = m_player->frameView()->documentView();
     458    NSView* parentView = 0;
     459#if PLATFORM(MAC)
     460    parentView = m_player->frameView()->documentView();
    459461    [parentView addSubview:m_qtMovieView.get()];
     462#endif
    460463    [m_qtMovieView.get() setDelegate:m_objcObserver.get()];
    461464    [m_objcObserver.get() setView:m_qtMovieView.get()];
     
    494497   
    495498    // associate our movie with our instance of QTVideoRendererWebKitOnly
    496     [(id<WebKitVideoRenderingDetails>)m_qtVideoRenderer.get() setMovie:m_qtMovie.get()];   
     499    [(id<WebKitVideoRenderingDetails>)m_qtVideoRenderer.get() setMovie:m_qtMovie.get()];
    497500
    498501    if (rendererMode == QTVideoRendererModeListensForNewImages) {
     
    523526void MediaPlayerPrivateQTKit::createQTMovieLayer()
    524527{
    525 #if USE(ACCELERATED_COMPOSITING)
     528#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    526529    if (!m_qtMovie)
    527530        return;
     
    574577        return MediaRenderingNone;
    575578
    576 #if USE(ACCELERATED_COMPOSITING)
     579#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    577580    if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player))
    578581        return MediaRenderingMovieLayer;
     
    700703}
    701704
    702 #if USE(ACCELERATED_COMPOSITING)
     705#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    703706PlatformLayer* MediaPlayerPrivateQTKit::platformLayer() const
    704707{
     
    12131216}
    12141217
    1215 #if USE(ACCELERATED_COMPOSITING)
     1218#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    12161219#if defined(BUILDING_ON_SNOW_LEOPARD)
    12171220static bool layerIsDescendentOf(PlatformLayer* child, PlatformLayer* descendent)
     
    13281331    [m_objcObserver.get() setDelayCallbacks:YES];
    13291332    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     1333    NSGraphicsContext* newContext;
     1334    FloatSize scaleFactor(1.0f, -1.0f);
     1335    IntRect paintRect(IntPoint(0, 0), IntSize(r.width(), r.height()));
     1336
     1337#if PLATFORM(QT) && USE(QTKIT)
     1338    // In Qt, GraphicsContext is a QPainter so every transformations applied on it won't matter because here
     1339    // the video is rendered by QuickTime not by Qt.
     1340    CGContextRef cgContext = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
     1341    CGContextSaveGState(cgContext);
     1342    CGContextSetInterpolationQuality(cgContext, kCGInterpolationLow);
     1343    CGContextTranslateCTM(cgContext, r.x(), r.y() + r.height());
     1344    CGContextScaleCTM(cgContext, scaleFactor.width(), scaleFactor.height());
     1345
     1346    newContext = [NSGraphicsContext currentContext];
     1347#else
    13301348    GraphicsContextStateSaver stateSaver(*context);
    13311349    context->translate(r.x(), r.y() + r.height());
    1332     context->scale(FloatSize(1.0f, -1.0f));
     1350    context->scale(scaleFactor);
    13331351    context->setImageInterpolationQuality(InterpolationLow);
    1334     IntRect paintRect(IntPoint(0, 0), IntSize(r.width(), r.height()));
    1335    
    1336     NSGraphicsContext* newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context->platformContext() flipped:NO];
    1337 
     1352
     1353    newContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context->platformContext() flipped:NO];
     1354#endif
    13381355    // draw the current video frame
    13391356    if (qtVideoRenderer) {
     
    13891406    }
    13901407#endif
    1391 
     1408#if PLATFORM(QT) && USE(QTKIT)
     1409    CGContextRestoreGState(cgContext);
     1410#endif
    13921411    END_BLOCK_OBJC_EXCEPTIONS;
    13931412    [m_objcObserver.get() setDelayCallbacks:NO];
     
    15941613}
    15951614
    1596 #if USE(ACCELERATED_COMPOSITING)
     1615#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    15971616bool MediaPlayerPrivateQTKit::supportsAcceleratedRendering() const
    15981617{
     
    17451764- (void)layerHostChanged:(NSNotification *)notification
    17461765{
    1747 #if USE(ACCELERATED_COMPOSITING)
     1766#if USE(ACCELERATED_COMPOSITING) && !(PLATFORM(QT) && USE(QTKIT))
    17481767    CALayer* rootLayer = static_cast<CALayer*>([notification object]);
    17491768    m_callback->layerHostChanged(rootLayer);
  • trunk/Source/WebCore/platform/mac/KURLMac.mm

    r30243 r87312  
    2828
    2929#import "FoundationExtras.h"
     30#import <CoreFoundation/CFURL.h>
    3031
    3132namespace WebCore {
  • trunk/Source/WebCore/platform/mac/SharedBufferMac.mm

    r85036 r87312  
    4848{
    4949    JSC::initializeThreading();
     50#if PLATFORM(QT) && USE(QTKIT)
     51    WTF::initializeMainThread();
     52#else
    5053    WTF::initializeMainThreadToProcessMainThread();
     54#endif
    5155    WebCoreObjCFinalizeOnMainThread(self);
    5256}
     
    108112    return (CFDataRef)RetainPtr<WebCoreSharedBufferData>(AdoptNS, [[WebCoreSharedBufferData alloc] initWithSharedBuffer:this]).releaseRef();
    109113}
    110 
     114#if !(PLATFORM(QT) && USE(QTKIT))
    111115PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath)
    112116{
     
    116120    return 0;
    117121}
    118 
     122#endif
    119123}
    120124
  • trunk/Source/WebCore/platform/mac/WebCoreObjCExtras.mm

    r85036 r87312  
    3737#include <objc/objc-auto.h>
    3838#include <objc/objc-runtime.h>
     39#include <utility>
    3940#include <wtf/Assertions.h>
    4041#include <wtf/MainThread.h>
  • trunk/Source/WebCore/platform/qt/WebCoreSystemInterface.mm

    r87311 r87312  
    11/*
    2  * Copyright (C) 2003, 2006 Apple Computer, Inc.  All rights reserved.
    3  * Copyright (C) 2005 Nokia.  All rights reserved.
     2 * Copyright 2006, 2007, 2008, 2009, 2010 Apple Computer, Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
     
    2423 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2524 */
    26  
    27 #include "config.h"
    28 #include "FloatSize.h"
    2925
    30 #if USE(CG) || USE(SKIA_ON_MAC_CHROME)
     26#import "config.h"
     27#import "WebCoreSystemInterface.h"
     28#import <Foundation/Foundation.h>
    3129
    32 #include <ApplicationServices/ApplicationServices.h>
     30unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
     31int (*wkQTMovieDataRate)(QTMovie*);
     32void (*wkQTMovieDisableComponent)(uint32_t[5]);
     33float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
     34NSString *(*wkQTMovieMaxTimeLoadedChangeNotification)(void);
     35float (*wkQTMovieMaxTimeSeekable)(QTMovie*);
     36int (*wkQTMovieGetType)(QTMovie*);
     37BOOL (*wkQTMovieHasClosedCaptions)(QTMovie*);
     38void (*wkQTMovieSetShowClosedCaptions)(QTMovie*, BOOL);
     39void (*wkQTMovieSelectPreferredAlternates)(QTMovie*);
     40void (*wkQTMovieViewSetDrawSynchronously)(QTMovieView*, BOOL);
     41NSArray *(*wkQTGetSitesInMediaDownloadCache)();
     42void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
     43void (*wkQTClearMediaDownloadCache)();
    3344
    34 namespace WebCore {
    35 
    36 FloatSize::FloatSize(const CGSize& s) : m_width(s.width), m_height(s.height)
    37 {
    38 }
    39 
    40 FloatSize::operator CGSize() const
    41 {
    42     return CGSizeMake(m_width, m_height);
    43 }
    44 
    45 }
    46 
    47 #endif // USE(CG)
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r86537 r87312  
    110110#include "TextIterator.h"
    111111#include "WebPlatformStrategies.h"
     112#if USE(QTKIT)
     113#include "WebSystemInterface.h"
     114#endif
    112115#include "WindowFeatures.h"
    113116#include "WorkerThread.h"
     
    317320
    318321    WebPlatformStrategies::initialize();
     322
     323#if USE(QTKIT)
     324    InitWebCoreSystemInterface();
     325#endif
    319326
    320327    Page::PageClients pageClients;
  • trunk/Source/WebKit/qt/ChangeLog

    r87311 r87312  
     12011-05-25  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        Reviewed by Eric Carlson.
     4
     5        [Qt] Enable usage of QuickTime mediaplayer for the Qt port on Mac.
     6        https://bugs.webkit.org/show_bug.cgi?id=61279
     7
     8        Enable the usage of QuickTime backend for the Qt port. It can be enabled by
     9        passing DEFINES+=USE_QTKIT=1 when calling build-webkit.
     10
     11        * Api/qwebpage.cpp:
     12        (QWebPagePrivate::QWebPagePrivate):
     13        * QtWebKit.pro:
     14        * WebCoreSupport/FullScreenVideoQt.cpp:
     15        (WebCore::FullScreenVideoQt::enterFullScreenForNode):
     16        (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback):
     17        (WebCore::FullScreenVideoQt::isValid):
     18        * WebCoreSupport/WebSystemInterface.h: Added.
     19        * WebCoreSupport/WebSystemInterface.mm: Added.
     20        (InitWebCoreSystemInterface):
     21
    1222011-05-25  Qi Zhang  <qi.2.zhang@nokia.com>
    223
  • trunk/Source/WebKit/qt/QtWebKit.pro

    r86949 r87312  
    216216
    217217contains(DEFINES, ENABLE_VIDEO=1) {
    218     !contains(DEFINES, USE_GSTREAMER=1):contains(MOBILITY_CONFIG, multimedia) {
     218    !contains(DEFINES, USE_QTKIT=1):!contains(DEFINES, USE_GSTREAMER=1):contains(MOBILITY_CONFIG, multimedia) {
    219219        HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h
    220220        SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp
     
    224224        HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h
    225225        SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp
     226    }
     227
     228    contains(DEFINES, USE_QTKIT=1) {
     229        INCLUDEPATH += $$SOURCE_DIR/WebCore/platform/qt/
     230        INCLUDEPATH += $$SOURCE_DIR/../WebKitLibraries/
     231        DEFINES+=NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
     232        HEADERS += $$PWD/WebCoreSupport/WebSystemInterface.h
     233        SOURCES += $$PWD/WebCoreSupport/WebSystemInterface.mm
     234        # We can know the Mac OS version by using the Darwin major version
     235        DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
     236        DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
     237        equals(DARWIN_MAJOR_VERSION, "10") {
     238            LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a -framework Security
     239        } else {
     240            equals(DARWIN_MAJOR_VERSION, "9") {
     241                LIBS+= $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.a -framework Security
     242            }
     243        }
    226244    }
    227245}
  • trunk/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp

    r86550 r87312  
    163163{
    164164    Q_ASSERT(node);
     165    m_videoElement = static_cast<HTMLVideoElement*>(node);
     166
     167#if USE(QT_MULTIMEDIA)
    165168    Q_ASSERT(m_FullScreenVideoHandler);
    166 
    167     m_videoElement = static_cast<HTMLVideoElement*>(node);
    168 
    169 #if USE(QT_MULTIMEDIA)
    170169    HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node);
    171170    PlatformMedia platformMedia = videoElement->platformMedia();
     
    237236#if USE(GSTREAMER)
    238237    return false;
     238#else
     239    return false;
    239240#endif
    240241}
     
    247248#if USE(GSTREAMER)
    248249    return m_FullScreenVideoHandlerGStreamer;
    249 #endif
    250 }
    251 
    252 }
    253 
     250#else
     251    return 0;
     252#endif
     253}
     254
     255}
     256
Note: See TracChangeset for help on using the changeset viewer.