| Differences between
and this patch
- a/Source/WebCore/ChangeLog +60 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-10-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Use std::unique_ptr instead of PassOwnPtr in MediaPlayerFoo classes
4
        https://bugs.webkit.org/show_bug.cgi?id=137765
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        As a step to use std::unique_ptr|make_unique<>, this patch changes use of OwnPtr|PassOwnPtr with
9
        std::unique_ptr<>|make_unique<>. However we have to set constructor to public in order to use
10
        std::make_unique<>. This change will conflict with MediaPlayerFoo's create() factory function
11
        because there are two object creation methods. Thus this patch removes create() factory function
12
        in MediaPlayerFoo classes and also lets MediaPlayerFactory create MediaPlayerFoo using std::make_unique<>
13
        instead of the create() factory functions.
14
15
        No new tests, no behavior changes.
16
17
        * html/HTMLMediaElement.cpp:
18
        (WebCore::HTMLMediaElement::parseAttribute):
19
        * html/HTMLMediaElement.h:
20
        * platform/graphics/MediaEnginePlayerType.h: Added.
21
        * platform/graphics/MediaPlayer.cpp:
22
        (WebCore::NullMediaPlayerPrivate::NullMediaPlayerPrivate):
23
        (WebCore::MediaPlayerFactory::MediaPlayerFactory):
24
        (WebCore::MediaPlayerFactory::createMediaPlayer):
25
        (WebCore::addMediaEngine):
26
        (WebCore::MediaPlayer::MediaPlayer):
27
        (WebCore::MediaPlayer::loadWithNextMediaEngine):
28
        (WebCore::createNullMediaPlayer): Deleted.
29
        * platform/graphics/MediaPlayer.h:
30
        (WebCore::MediaPlayer::create): Deleted.
31
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
32
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
33
        (WebCore::MediaPlayerPrivateAVFoundationCF::registerMediaEngine):
34
        (WebCore::MediaPlayerPrivateAVFoundationCF::create): Deleted.
35
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
36
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
37
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
38
        (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
39
        (WebCore::MediaPlayerPrivateAVFoundationObjC::create): Deleted.
40
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
41
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
42
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
43
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create): Deleted.
44
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
45
        (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
46
        (WebCore::MediaPlayerPrivateGStreamer::create): Deleted.
47
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
48
        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
49
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
50
        (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine):
51
        (WebCore::MediaPlayerPrivateQTKit::create): Deleted.
52
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
53
        (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine):
54
        (WebCore::MediaPlayerPrivateMediaFoundation::create): Deleted.
55
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
56
        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
57
        (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
58
        (WebCore::MockMediaPlayerMediaSource::create): Deleted.
59
        * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
60
1
2014-10-22  Chris Dumez  <cdumez@apple.com>
61
2014-10-22  Chris Dumez  <cdumez@apple.com>
2
62
3
        Clean up virtual functions in rendering/
63
        Clean up virtual functions in rendering/
- a/Source/WebCore/CMakeLists.txt -8 / +7 lines
Lines 2170-2181 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
2170
    platform/mock/GeolocationClientMock.cpp
2170
    platform/mock/GeolocationClientMock.cpp
2171
    platform/mock/MediaConstraintsMock.cpp
2171
    platform/mock/MediaConstraintsMock.cpp
2172
    platform/mock/MockMediaStreamCenter.cpp
2172
    platform/mock/MockMediaStreamCenter.cpp
2173
    platform/mock/PlatformSpeechSynthesizerMock.cpp
2173
    platform/mock/RTCDataChannelHandlerMock.cpp
2174
    platform/mock/RTCDataChannelHandlerMock.cpp
2174
    platform/mock/RTCDTMFSenderHandlerMock.cpp
2175
    platform/mock/RTCDTMFSenderHandlerMock.cpp
2175
    platform/mock/RTCNotifiersMock.cpp
2176
    platform/mock/RTCNotifiersMock.cpp
2176
    platform/mock/RTCPeerConnectionHandlerMock.cpp
2177
    platform/mock/RTCPeerConnectionHandlerMock.cpp
2177
    platform/mock/ScrollbarThemeMock.cpp
2178
    platform/mock/ScrollbarThemeMock.cpp
2178
2179
2180
    platform/mock/mediasource/MockBox.cpp
2181
    platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
2182
    platform/mock/mediasource/MockMediaSourcePrivate.cpp
2183
    platform/mock/mediasource/MockSourceBufferPrivate.cpp
2184
    platform/mock/mediasource/MockTracks.cpp
2185
2179
    platform/network/AuthenticationChallengeBase.cpp
2186
    platform/network/AuthenticationChallengeBase.cpp
2180
    platform/network/BlobData.cpp
2187
    platform/network/BlobData.cpp
2181
    platform/network/BlobDataFileReference.cpp
2188
    platform/network/BlobDataFileReference.cpp
Lines 3125-3138 set(WebCoreTestSupport_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec2
3125
)
3132
)
3126
3133
3127
set(WebCoreTestSupport_SOURCES
3134
set(WebCoreTestSupport_SOURCES
3128
    platform/mock/PlatformSpeechSynthesizerMock.cpp
3129
3130
    platform/mock/mediasource/MockBox.cpp
3131
    platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
3132
    platform/mock/mediasource/MockMediaSourcePrivate.cpp
3133
    platform/mock/mediasource/MockSourceBufferPrivate.cpp
3134
    platform/mock/mediasource/MockTracks.cpp
3135
3136
    testing/InternalSettings.cpp
3135
    testing/InternalSettings.cpp
3137
    testing/Internals.cpp
3136
    testing/Internals.cpp
3138
3137
- a/Source/WebCore/WebCore.exp.in -2 / +2 lines
Lines 3233-3239 __ZN7WebCore8Document13getTouchRectsERN3WTF6VectorINS_7IntRectELm0ENS1_15CrashOn a/Source/WebCore/WebCore.exp.in_sec1
3233
#if ENABLE(MEDIA_SOURCE)
3233
#if ENABLE(MEDIA_SOURCE)
3234
__ZN7WebCore12SourceBuffer25bufferedSamplesForTrackIDERKN3WTF12AtomicStringE
3234
__ZN7WebCore12SourceBuffer25bufferedSamplesForTrackIDERKN3WTF12AtomicStringE
3235
__ZN7WebCore14JSSourceBuffer9toWrappedEN3JSC7JSValueE
3235
__ZN7WebCore14JSSourceBuffer9toWrappedEN3JSC7JSValueE
3236
__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EE
3236
__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EE
3237
#endif
3237
#endif
3238
3238
3239
#if ENABLE(MEDIA_STREAM)
3239
#if ENABLE(MEDIA_STREAM)
Lines 3411-3417 __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE a/Source/WebCore/WebCore.exp.in_sec2
3411
__ZN7WebCore16HTMLMediaElement4playEv
3411
__ZN7WebCore16HTMLMediaElement4playEv
3412
__ZN7WebCore16HTMLMediaElement5pauseEv
3412
__ZN7WebCore16HTMLMediaElement5pauseEv
3413
__ZN7WebCore16HTMLMediaElement8setMutedEb
3413
__ZN7WebCore16HTMLMediaElement8setMutedEb
3414
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EEE
3414
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EEE
3415
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3415
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3416
__ZNK7WebCore10TimeRanges7nearestEd
3416
__ZNK7WebCore10TimeRanges7nearestEd
3417
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
3417
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +4 lines
Lines 5599-5604 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
5599
		CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
5599
		CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
5600
		CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
5600
		CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
5601
		CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; };
5601
		CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; };
5602
		CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */; settings = {ATTRIBUTES = (Private, ); }; };
5602
		CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
5603
		CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
5603
		CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };
5604
		CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };
5604
		CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };
5605
		CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 13044-13049 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
13044
		CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
13045
		CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
13045
		CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
13046
		CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
13046
		CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; };
13047
		CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; };
13048
		CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEnginePlayerType.h; sourceTree = "<group>"; };
13047
		CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };
13049
		CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };
13048
		CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };
13050
		CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };
13049
		CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };
13051
		CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };
Lines 20552-20557 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
20552
				141DC04C164834B900371E5A /* LayoutRect.cpp */,
20554
				141DC04C164834B900371E5A /* LayoutRect.cpp */,
20553
				141DC04D164834B900371E5A /* LayoutRect.h */,
20555
				141DC04D164834B900371E5A /* LayoutRect.h */,
20554
				141DC04E164834B900371E5A /* LayoutSize.h */,
20556
				141DC04E164834B900371E5A /* LayoutSize.h */,
20557
				CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */,
20555
				E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */,
20558
				E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */,
20556
				E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */,
20559
				E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */,
20557
				079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */,
20560
				079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */,
Lines 24537-24542 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24537
				A8D223FE16B52E4E00157288 /* HTMLResourcePreloader.h in Headers */,
24540
				A8D223FE16B52E4E00157288 /* HTMLResourcePreloader.h in Headers */,
24538
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24541
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24539
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24542
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24543
				CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */,
24540
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24544
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24541
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24545
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24542
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
24546
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
- a/Source/WebCore/html/HTMLMediaElement.cpp -3 / +3 lines
Lines 4646-4652 void HTMLMediaElement::clearMediaPlayer(int flags) a/Source/WebCore/html/HTMLMediaElement.cpp_sec1
4646
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4646
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4647
#endif
4647
#endif
4648
4648
4649
    m_player.clear();
4649
    m_player = nullptr;
4650
4650
4651
    stopPeriodicTimers();
4651
    stopPeriodicTimers();
4652
    m_loadTimer.stop();
4652
    m_loadTimer.stop();
Lines 4693-4699 void HTMLMediaElement::stop() a/Source/WebCore/html/HTMLMediaElement.cpp_sec2
4693
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4693
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4694
    // the media player now. Note that userCancelledLoad will already have cleared the player
4694
    // the media player now. Note that userCancelledLoad will already have cleared the player
4695
    // if the media was not fully loaded. This handles all other cases.
4695
    // if the media was not fully loaded. This handles all other cases.
4696
    m_player.clear();
4696
    m_player = nullptr;
4697
4697
4698
    updateSleepDisabling();
4698
    updateSleepDisabling();
4699
}
4699
}
Lines 5334-5340 void HTMLMediaElement::createMediaPlayer() a/Source/WebCore/html/HTMLMediaElement.cpp_sec3
5334
#if ENABLE(VIDEO_TRACK)
5334
#if ENABLE(VIDEO_TRACK)
5335
    forgetResourceSpecificTracks();
5335
    forgetResourceSpecificTracks();
5336
#endif
5336
#endif
5337
    m_player = MediaPlayer::create(*this);
5337
    m_player = std::make_unique<MediaPlayer>(static_cast<MediaPlayerClient&>(*this));
5338
5338
5339
#if ENABLE(WEB_AUDIO)
5339
#if ENABLE(WEB_AUDIO)
5340
    if (m_audioSourceNode) {
5340
    if (m_audioSourceNode) {
- a/Source/WebCore/html/HTMLMediaElement.h -1 / +1 lines
Lines 770-776 private: a/Source/WebCore/html/HTMLMediaElement.h_sec1
770
    MediaPlayer::VideoGravity m_videoFullscreenGravity;
770
    MediaPlayer::VideoGravity m_videoFullscreenGravity;
771
#endif
771
#endif
772
772
773
    OwnPtr<MediaPlayer> m_player;
773
    std::unique_ptr<MediaPlayer> m_player;
774
774
775
    MediaPlayer::Preload m_preload;
775
    MediaPlayer::Preload m_preload;
776
776
- a/Source/WebCore/platform/graphics/MediaEnginePlayerType.h +43 lines
Line 0 a/Source/WebCore/platform/graphics/MediaEnginePlayerType.h_sec1
1
/*
2
 * Copyright (C) 2014 Samsung Electronics.  All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 */
25
26
27
#ifndef MediaEnginePlayerType_h
28
#define MediaEnginePlayerType_h
29
30
namespace WebCore {
31
typedef enum {
32
    NullMediaPlayer,
33
    AVFoundationCFPlayer,
34
    AVFoundationObjCPlayer,
35
    MediaSourceAVFObjCPlayer,
36
    GStreamerPlayer,
37
    QTKitPlayer,
38
    MediaFoundationPlayer,
39
    MockMediaSourcePlayer
40
}  MediaEnginePlayerType;
41
}
42
43
#endif
- a/Source/WebCore/platform/graphics/MediaPlayer.cpp -22 / +57 lines
Lines 44-49 a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec1
44
44
45
#if ENABLE(MEDIA_SOURCE)
45
#if ENABLE(MEDIA_SOURCE)
46
#include "MediaSourcePrivateClient.h"
46
#include "MediaSourcePrivateClient.h"
47
#include "MockMediaPlayerMediaSource.h"
47
#endif
48
#endif
48
49
49
#if USE(GSTREAMER)
50
#if USE(GSTREAMER)
Lines 78-84 const PlatformMedia NoPlatformMedia = { PlatformMedia::None, {0} }; a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec2
78
79
79
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
80
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
80
public:
81
public:
81
    NullMediaPlayerPrivate(MediaPlayer*) { }
82
    explicit NullMediaPlayerPrivate(MediaPlayer*) { }
82
83
83
    virtual void load(const String&) { }
84
    virtual void load(const String&) { }
84
#if ENABLE(MEDIA_SOURCE)
85
#if ENABLE(MEDIA_SOURCE)
Lines 144-182 public: a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec3
144
#endif
145
#endif
145
};
146
};
146
147
147
static PassOwnPtr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) 
148
{ 
149
    return adoptPtr(new NullMediaPlayerPrivate(player)); 
150
}
151
152
148
153
// engine support
149
// engine support
154
150
155
struct MediaPlayerFactory {
151
struct MediaPlayerFactory {
156
    WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED;
152
    WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED;
157
public:
153
public:
158
    MediaPlayerFactory(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs,
154
    MediaPlayerFactory(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs,
159
        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
155
        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
160
        : constructor(constructor)
156
            : playerType(playerType)
161
        , getSupportedTypes(getSupportedTypes)
157
            , getSupportedTypes(getSupportedTypes)
162
        , supportsTypeAndCodecs(supportsTypeAndCodecs)
158
            , supportsTypeAndCodecs(supportsTypeAndCodecs)
163
        , getSitesInMediaCache(getSitesInMediaCache)
159
            , getSitesInMediaCache(getSitesInMediaCache)
164
        , clearMediaCache(clearMediaCache)
160
            , clearMediaCache(clearMediaCache)
165
        , clearMediaCacheForSite(clearMediaCacheForSite)
161
            , clearMediaCacheForSite(clearMediaCacheForSite)
166
        , supportsKeySystem(supportsKeySystem)
162
            , supportsKeySystem(supportsKeySystem)
167
    {
163
    {
168
    }
164
    }
169
165
170
    CreateMediaEnginePlayer constructor;
166
    MediaEnginePlayerType playerType;
171
    MediaEngineSupportedTypes getSupportedTypes;
167
    MediaEngineSupportedTypes getSupportedTypes;
172
    MediaEngineSupportsType supportsTypeAndCodecs;
168
    MediaEngineSupportsType supportsTypeAndCodecs;
173
    MediaEngineGetSitesInMediaCache getSitesInMediaCache;
169
    MediaEngineGetSitesInMediaCache getSitesInMediaCache;
174
    MediaEngineClearMediaCache clearMediaCache;
170
    MediaEngineClearMediaCache clearMediaCache;
175
    MediaEngineClearMediaCacheForSite clearMediaCacheForSite;
171
    MediaEngineClearMediaCacheForSite clearMediaCacheForSite;
176
    MediaEngineSupportsKeySystem supportsKeySystem;
172
    MediaEngineSupportsKeySystem supportsKeySystem;
173
174
    std::unique_ptr<MediaPlayerPrivateInterface> createMediaPlayer(MediaPlayer* player)
175
    {
176
        switch (playerType) {
177
        case NullMediaPlayer:
178
            return std::make_unique<NullMediaPlayerPrivate>(player);
179
#if USE(AVFOUNDATION)
180
#if PLATFORM(WIN)
181
        case AVFoundationCFPlayer:
182
            return std::make_unique<MediaPlayerPrivateAVFoundationCF>(player);
183
#endif
184
        case AVFoundationObjCPlayer:
185
            return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player);
186
#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
187
        case MediaSourceAVFObjCPlayer:
188
            return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player);
189
#endif
190
#endif // USE(AVFOUNDATION)
191
#if USE(GSTREAMER)
192
        case GStreamerPlayer:
193
            return std::make_unique<MediaPlayerPrivateGStreamer>(player);
194
#endif
195
#if PLATFORM(COCOA)
196
        case QTKitPlayer:
197
            return std::make_unique<MediaPlayerPrivateQTKit>(player);
198
#endif
199
#if PLATFORM(WIN) && USE(MEDIA_FOUNDATION)
200
        case MediaFoundationPlayer:
201
            return std::make_unique<MediaPlayerPrivateMediaFoundation>(player);
202
#endif
203
#if ENABLE(MEDIA_SOURCE)
204
        case MockMediaSourcePlayer:
205
            return std::make_unique<MockMediaPlayerMediaSource>(player);
206
#endif
207
        default:
208
            ASSERT_NOT_REACHED();
209
            return std::make_unique<NullMediaPlayerPrivate>(player);
210
        }
211
    }
177
};
212
};
178
213
179
static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
214
static void addMediaEngine(MediaEnginePlayerType, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
180
215
181
static MediaPlayerFactory* bestMediaEngineForSupportParameters(const MediaEngineSupportParameters&, MediaPlayerFactory* current = 0);
216
static MediaPlayerFactory* bestMediaEngineForSupportParameters(const MediaEngineSupportParameters&, MediaPlayerFactory* current = 0);
182
static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current);
217
static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current);
Lines 223-236 static Vector<MediaPlayerFactory*>& installedMediaEngines(RequeryEngineOptions r a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec4
223
    return installedEngines;
258
    return installedEngines;
224
}
259
}
225
260
226
static void addMediaEngine(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType,
261
static void addMediaEngine(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType,
227
    MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
262
    MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
228
{
263
{
229
    ASSERT(constructor);
264
    ASSERT(playerType);
230
    ASSERT(getSupportedTypes);
265
    ASSERT(getSupportedTypes);
231
    ASSERT(supportsType);
266
    ASSERT(supportsType);
232
267
233
    installedMediaEngines().append(new MediaPlayerFactory(constructor, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem));
268
    installedMediaEngines().append(new MediaPlayerFactory(playerType, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem));
234
}
269
}
235
270
236
static const AtomicString& applicationOctetStream()
271
static const AtomicString& applicationOctetStream()
Lines 308-314 static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec5
308
MediaPlayer::MediaPlayer(MediaPlayerClient& client)
343
MediaPlayer::MediaPlayer(MediaPlayerClient& client)
309
    : m_client(client)
344
    : m_client(client)
310
    , m_reloadTimer(this, &MediaPlayer::reloadTimerFired)
345
    , m_reloadTimer(this, &MediaPlayer::reloadTimerFired)
311
    , m_private(createNullMediaPlayer(this))
346
    , m_private(std::make_unique<NullMediaPlayerPrivate>(this))
312
    , m_currentMediaEngine(0)
347
    , m_currentMediaEngine(0)
313
    , m_preload(Auto)
348
    , m_preload(Auto)
314
    , m_visible(false)
349
    , m_visible(false)
Lines 409-415 void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec6
409
        m_private = nullptr;
444
        m_private = nullptr;
410
    } else if (m_currentMediaEngine != engine) {
445
    } else if (m_currentMediaEngine != engine) {
411
        m_currentMediaEngine = engine;
446
        m_currentMediaEngine = engine;
412
        m_private = engine->constructor(this);
447
        m_private = engine->createMediaPlayer(this);
413
        m_client.mediaPlayerEngineUpdated(this);
448
        m_client.mediaPlayerEngineUpdated(this);
414
        m_private->setPrivateBrowsingMode(m_privateBrowsing);
449
        m_private->setPrivateBrowsingMode(m_privateBrowsing);
415
        m_private->setPreload(m_preload);
450
        m_private->setPreload(m_preload);
Lines 426-432 void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec7
426
#endif
461
#endif
427
        m_private->load(m_url.string());
462
        m_private->load(m_url.string());
428
    } else {
463
    } else {
429
        m_private = createNullMediaPlayer(this);
464
        m_private = std::make_unique<NullMediaPlayerPrivate>(this);
430
        m_client.mediaPlayerEngineUpdated(this);
465
        m_client.mediaPlayerEngineUpdated(this);
431
        m_client.mediaPlayerResourceNotSupported(this);
466
        m_client.mediaPlayerResourceNotSupported(this);
432
    }
467
    }
- a/Source/WebCore/platform/graphics/MediaPlayer.h -11 / +4 lines
Lines 35-40 a/Source/WebCore/platform/graphics/MediaPlayer.h_sec1
35
#include "IntRect.h"
35
#include "IntRect.h"
36
#include "URL.h"
36
#include "URL.h"
37
#include "LayoutRect.h"
37
#include "LayoutRect.h"
38
#include "MediaEnginePlayerType.h"
38
#include "MediaSession.h"
39
#include "MediaSession.h"
39
#include "NativeImagePtr.h"
40
#include "NativeImagePtr.h"
40
#include "PlatformLayer.h"
41
#include "PlatformLayer.h"
Lines 46-53 a/Source/WebCore/platform/graphics/MediaPlayer.h_sec2
46
#include <wtf/HashSet.h>
47
#include <wtf/HashSet.h>
47
#include <wtf/MediaTime.h>
48
#include <wtf/MediaTime.h>
48
#include <wtf/Noncopyable.h>
49
#include <wtf/Noncopyable.h>
49
#include <wtf/OwnPtr.h>
50
#include <wtf/PassOwnPtr.h>
51
#include <wtf/text/StringHash.h>
50
#include <wtf/text/StringHash.h>
52
51
53
#if ENABLE(AVF_CAPTIONS)
52
#if ENABLE(AVF_CAPTIONS)
Lines 277-287 public: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec3
277
class MediaPlayer {
276
class MediaPlayer {
278
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
277
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
279
public:
278
public:
280
279
    explicit MediaPlayer(MediaPlayerClient&);
281
    static PassOwnPtr<MediaPlayer> create(MediaPlayerClient& client)
282
    {
283
        return adoptPtr(new MediaPlayer(client));
284
    }
285
    virtual ~MediaPlayer();
280
    virtual ~MediaPlayer();
286
281
287
    // Media engine support.
282
    // Media engine support.
Lines 577-583 public: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec4
577
    String sourceApplicationIdentifier() const;
572
    String sourceApplicationIdentifier() const;
578
573
579
private:
574
private:
580
    MediaPlayer(MediaPlayerClient&);
581
    MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
575
    MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
582
    void loadWithNextMediaEngine(MediaPlayerFactory*);
576
    void loadWithNextMediaEngine(MediaPlayerFactory*);
583
    void reloadTimerFired(Timer<MediaPlayer>&);
577
    void reloadTimerFired(Timer<MediaPlayer>&);
Lines 586-592 private: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec5
586
580
587
    MediaPlayerClient& m_client;
581
    MediaPlayerClient& m_client;
588
    Timer<MediaPlayer> m_reloadTimer;
582
    Timer<MediaPlayer> m_reloadTimer;
589
    OwnPtr<MediaPlayerPrivateInterface> m_private;
583
    std::unique_ptr<MediaPlayerPrivateInterface> m_private;
590
    MediaPlayerFactory* m_currentMediaEngine;
584
    MediaPlayerFactory* m_currentMediaEngine;
591
    URL m_url;
585
    URL m_url;
592
    String m_contentMIMEType;
586
    String m_contentMIMEType;
Lines 608-614 private: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec6
608
#endif
602
#endif
609
};
603
};
610
604
611
typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
612
typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
605
typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
613
typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters);
606
typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters);
614
typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
607
typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
Lines 616-622 typedef void (*MediaEngineClearMediaCache)(); a/Source/WebCore/platform/graphics/MediaPlayer.h_sec7
616
typedef void (*MediaEngineClearMediaCacheForSite)(const String&);
609
typedef void (*MediaEngineClearMediaCacheForSite)(const String&);
617
typedef bool (*MediaEngineSupportsKeySystem)(const String& keySystem, const String& mimeType);
610
typedef bool (*MediaEngineSupportsKeySystem)(const String& keySystem, const String& mimeType);
618
611
619
typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType,
612
typedef void (*MediaEngineRegistrar)(MediaEnginePlayerType, MediaEngineSupportedTypes, MediaEngineSupportsType,
620
    MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
613
    MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
621
typedef void (*MediaEngineRegister)(MediaEngineRegistrar);
614
typedef void (*MediaEngineRegister)(MediaEngineRegistrar);
622
615
- a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h -1 / +1 lines
Lines 46-51 class GenericCueData; a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h_sec1
46
class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent
46
class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent
47
{
47
{
48
public:
48
public:
49
    explicit MediaPlayerPrivateAVFoundation(MediaPlayer*);
49
50
50
    virtual void repaint();
51
    virtual void repaint();
51
    virtual void metadataLoaded();
52
    virtual void metadataLoaded();
Lines 144-150 public: a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h_sec2
144
#endif
145
#endif
145
146
146
protected:
147
protected:
147
    MediaPlayerPrivateAVFoundation(MediaPlayer*);
148
    virtual ~MediaPlayerPrivateAVFoundation();
148
    virtual ~MediaPlayerPrivateAVFoundation();
149
149
150
    WeakPtr<MediaPlayerPrivateAVFoundation> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
150
    WeakPtr<MediaPlayerPrivateAVFoundation> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp -6 / +1 lines
Lines 335-349 static dispatch_queue_t globalLoaderDelegateQueue() a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp_sec1
335
}
335
}
336
#endif
336
#endif
337
337
338
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) 
339
{ 
340
    return adoptPtr(new MediaPlayerPrivateAVFoundationCF(player));
341
}
342
343
void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar)
338
void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar)
344
{
339
{
345
    if (isAvailable())
340
    if (isAvailable())
346
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
341
        registrar(AVFoundationCFPlayer, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
347
}
342
}
348
343
349
MediaPlayerPrivateAVFoundationCF::MediaPlayerPrivateAVFoundationCF(MediaPlayer* player)
344
MediaPlayerPrivateAVFoundationCF::MediaPlayerPrivateAVFoundationCF(MediaPlayer* player)
- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h -3 / +1 lines
Lines 41-46 class WebCoreAVCFResourceLoader; a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h_sec1
41
41
42
class MediaPlayerPrivateAVFoundationCF : public MediaPlayerPrivateAVFoundation {
42
class MediaPlayerPrivateAVFoundationCF : public MediaPlayerPrivateAVFoundation {
43
public:
43
public:
44
    explicit MediaPlayerPrivateAVFoundationCF(MediaPlayer*);
44
    virtual ~MediaPlayerPrivateAVFoundationCF();
45
    virtual ~MediaPlayerPrivateAVFoundationCF();
45
46
46
    virtual void tracksChanged() override;
47
    virtual void tracksChanged() override;
Lines 58-67 public: a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h_sec2
58
    static void registerMediaEngine(MediaEngineRegistrar);
59
    static void registerMediaEngine(MediaEngineRegistrar);
59
60
60
private:
61
private:
61
    MediaPlayerPrivateAVFoundationCF(MediaPlayer*);
62
63
    // Engine support
62
    // Engine support
64
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
65
    static void getSupportedTypes(HashSet<String>& types);
63
    static void getSupportedTypes(HashSet<String>& types);
66
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
64
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
67
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
65
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h -3 / +1 lines
Lines 69-74 class VideoTrackPrivateAVFObjC; a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h_sec1
69
69
70
class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation {
70
class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation {
71
public:
71
public:
72
    explicit MediaPlayerPrivateAVFoundationObjC(MediaPlayer*);
72
    virtual ~MediaPlayerPrivateAVFoundationObjC();
73
    virtual ~MediaPlayerPrivateAVFoundationObjC();
73
74
74
    static void registerMediaEngine(MediaEngineRegistrar);
75
    static void registerMediaEngine(MediaEngineRegistrar);
Lines 131-140 public: a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h_sec2
131
    WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
132
    WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
132
133
133
private:
134
private:
134
    MediaPlayerPrivateAVFoundationObjC(MediaPlayer*);
135
136
    // engine support
135
    // engine support
137
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
138
    static void getSupportedTypes(HashSet<String>& types);
136
    static void getSupportedTypes(HashSet<String>& types);
139
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
137
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
140
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
138
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm -6 / +1 lines
Lines 383-397 static dispatch_queue_t globalPullDelegateQueue() a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm_sec1
383
}
383
}
384
#endif
384
#endif
385
385
386
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player)
387
{ 
388
    return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player));
389
}
390
391
void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar)
386
void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar)
392
{
387
{
393
    if (isAvailable())
388
    if (isAvailable())
394
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
389
        registrar(AVFoundationObjCPlayer, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem);
395
}
390
}
396
391
397
MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player)
392
MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player)
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h -3 / +1 lines
Lines 50-62 class MediaSourcePrivateAVFObjC; a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h_sec1
50
50
51
class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface {
51
class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface {
52
public:
52
public:
53
    MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*);
53
    explicit MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*);
54
    virtual ~MediaPlayerPrivateMediaSourceAVFObjC();
54
    virtual ~MediaPlayerPrivateMediaSourceAVFObjC();
55
55
56
    static void registerMediaEngine(MediaEngineRegistrar);
56
    static void registerMediaEngine(MediaEngineRegistrar);
57
57
58
    // MediaPlayer Factory Methods
59
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
60
    static bool isAvailable();
58
    static bool isAvailable();
61
    static void getSupportedTypes(HashSet<String>& types);
59
    static void getSupportedTypes(HashSet<String>& types);
62
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
60
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm -6 / +1 lines
Lines 196-207 MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC() a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm_sec1
196
void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegistrar registrar)
196
void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegistrar registrar)
197
{
197
{
198
    if (isAvailable())
198
    if (isAvailable())
199
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
199
        registrar(MediaSourceAVFObjCPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0);
200
}
201
202
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player)
203
{
204
    return adoptPtr(new MediaPlayerPrivateMediaSourceAVFObjC(player));
205
}
200
}
206
201
207
bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
202
bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp -6 / +1 lines
Lines 138-152 void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object) a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp_sec1
138
    LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get());
138
    LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get());
139
}
139
}
140
140
141
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
142
{
143
    return adoptPtr(new MediaPlayerPrivateGStreamer(player));
144
}
145
146
void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar)
141
void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar)
147
{
142
{
148
    if (isAvailable())
143
    if (isAvailable())
149
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
144
        registrar(GStreamerPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0);
150
}
145
}
151
146
152
bool initializeGStreamerAndRegisterWebKitElements()
147
bool initializeGStreamerAndRegisterWebKitElements()
- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h -4 / +2 lines
Lines 57-63 class VideoTrackPrivateGStreamer; a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h_sec1
57
57
58
class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
58
class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
59
public:
59
public:
60
    explicit MediaPlayerPrivateGStreamer(MediaPlayer*);
60
    ~MediaPlayerPrivateGStreamer();
61
    ~MediaPlayerPrivateGStreamer();
62
61
    static void registerMediaEngine(MediaEngineRegistrar);
63
    static void registerMediaEngine(MediaEngineRegistrar);
62
    gboolean handleMessage(GstMessage*);
64
    gboolean handleMessage(GstMessage*);
63
    void handlePluginInstallerResult(GstInstallPluginsReturn);
65
    void handlePluginInstallerResult(GstInstallPluginsReturn);
Lines 126-135 public: a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h_sec2
126
    bool changePipelineState(GstState);
128
    bool changePipelineState(GstState);
127
129
128
private:
130
private:
129
    MediaPlayerPrivateGStreamer(MediaPlayer*);
130
131
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
132
133
    static void getSupportedTypes(HashSet<String>&);
131
    static void getSupportedTypes(HashSet<String>&);
134
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
132
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
135
133
- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h -4 / +1 lines
Lines 50-55 namespace WebCore { a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h_sec1
50
    
50
    
51
class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface {
51
class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface {
52
public:
52
public:
53
    explicit MediaPlayerPrivateQTKit(MediaPlayer*);
53
    ~MediaPlayerPrivateQTKit();
54
    ~MediaPlayerPrivateQTKit();
54
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
55
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
55
56
Lines 63-72 public: a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h_sec2
63
    void layerHostChanged(PlatformLayer* rootLayer);
64
    void layerHostChanged(PlatformLayer* rootLayer);
64
65
65
private:
66
private:
66
    MediaPlayerPrivateQTKit(MediaPlayer*);
67
68
    // engine support
69
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
70
    static void getSupportedTypes(HashSet<String>& types);
67
    static void getSupportedTypes(HashSet<String>& types);
71
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
68
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
72
69
- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm -6 / +1 lines
Lines 166-180 using namespace WebCore; a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm_sec1
166
166
167
namespace WebCore {
167
namespace WebCore {
168
168
169
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player)
170
{ 
171
    return adoptPtr(new MediaPlayerPrivateQTKit(player));
172
}
173
174
void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar)
169
void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar)
175
{
170
{
176
    if (isAvailable())
171
    if (isAvailable())
177
        registrar(create, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, 0);
172
        registrar(QTKitPlayer, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, 0);
178
}
173
}
179
174
180
MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player)
175
MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player)
- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp -6 / +1 lines
Lines 41-55 MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp_sec1
41
{
41
{
42
}
42
}
43
43
44
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaFoundation::create(MediaPlayer* player)
45
{
46
    return adoptPtr(new MediaPlayerPrivateMediaFoundation(player));
47
}
48
49
void MediaPlayerPrivateMediaFoundation::registerMediaEngine(MediaEngineRegistrar registrar)
44
void MediaPlayerPrivateMediaFoundation::registerMediaEngine(MediaEngineRegistrar registrar)
50
{
45
{
51
    if (isAvailable())
46
    if (isAvailable())
52
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
47
        registrar(MediaFoundationPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0);
53
}
48
}
54
49
55
bool MediaPlayerPrivateMediaFoundation::isAvailable() 
50
bool MediaPlayerPrivateMediaFoundation::isAvailable() 
- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h -2 / +1 lines
Lines 30-39 namespace WebCore { a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h_sec1
30
30
31
class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface {
31
class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface {
32
public:
32
public:
33
    MediaPlayerPrivateMediaFoundation(MediaPlayer*);
33
    explicit MediaPlayerPrivateMediaFoundation(MediaPlayer*);
34
    static void registerMediaEngine(MediaEngineRegistrar);
34
    static void registerMediaEngine(MediaEngineRegistrar);
35
35
36
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
37
    static void getSupportedTypes(HashSet<String>& types);
36
    static void getSupportedTypes(HashSet<String>& types);
38
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
37
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
39
    static bool isAvailable();
38
    static bool isAvailable();
- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp -6 / +1 lines
Lines 41-52 namespace WebCore { a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp_sec1
41
// MediaPlayer Enigne Support
41
// MediaPlayer Enigne Support
42
void MockMediaPlayerMediaSource::registerMediaEngine(MediaEngineRegistrar registrar)
42
void MockMediaPlayerMediaSource::registerMediaEngine(MediaEngineRegistrar registrar)
43
{
43
{
44
    registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
44
    registrar(MockMediaSourcePlayer, getSupportedTypes, supportsType, 0, 0, 0, 0);
45
}
46
47
PassOwnPtr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player)
48
{
49
    return adoptPtr(new MockMediaPlayerMediaSource(player));
50
}
45
}
51
46
52
static HashSet<String> mimeTypeCache()
47
static HashSet<String> mimeTypeCache()
- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h -5 / +3 lines
Lines 38-51 class MockMediaSourcePrivate; a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h_sec1
38
38
39
class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface {
39
class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface {
40
public:
40
public:
41
    WEBCORE_EXPORT explicit MockMediaPlayerMediaSource(MediaPlayer*);
42
    virtual ~MockMediaPlayerMediaSource();
43
41
    // MediaPlayer Engine Support
44
    // MediaPlayer Engine Support
42
    static void registerMediaEngine(MediaEngineRegistrar);
45
    static void registerMediaEngine(MediaEngineRegistrar);
43
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
44
    static void getSupportedTypes(HashSet<String>& types);
46
    static void getSupportedTypes(HashSet<String>& types);
45
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
47
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
46
48
47
    virtual ~MockMediaPlayerMediaSource();
48
49
    void advanceCurrentTime();
49
    void advanceCurrentTime();
50
    void updateDuration(const MediaTime&);
50
    void updateDuration(const MediaTime&);
51
51
Lines 56-63 public: a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h_sec2
56
    void seekCompleted();
56
    void seekCompleted();
57
57
58
private:
58
private:
59
    MockMediaPlayerMediaSource(MediaPlayer*);
60
61
    // MediaPlayerPrivate Overrides
59
    // MediaPlayerPrivate Overrides
62
    virtual void load(const String& url) override;
60
    virtual void load(const String& url) override;
63
    virtual void load(const String& url, MediaSourcePrivateClient*) override;
61
    virtual void load(const String& url, MediaSourcePrivateClient*) override;

Return to Bug 137765