| Differences between
and this patch
- a/Source/WebCore/ChangeLog +60 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2014-10-21  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-21  Andy Estes  <aestes@apple.com>
61
2014-10-21  Andy Estes  <aestes@apple.com>
2
62
3
        One more iOS build fix after r175013.
63
        One more iOS build fix after r175013.
- a/Source/WebCore/CMakeLists.txt -8 / +7 lines
Lines 2168-2179 set(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
2168
    platform/mock/GeolocationClientMock.cpp
2168
    platform/mock/GeolocationClientMock.cpp
2169
    platform/mock/MediaConstraintsMock.cpp
2169
    platform/mock/MediaConstraintsMock.cpp
2170
    platform/mock/MockMediaStreamCenter.cpp
2170
    platform/mock/MockMediaStreamCenter.cpp
2171
    platform/mock/PlatformSpeechSynthesizerMock.cpp
2171
    platform/mock/RTCDataChannelHandlerMock.cpp
2172
    platform/mock/RTCDataChannelHandlerMock.cpp
2172
    platform/mock/RTCDTMFSenderHandlerMock.cpp
2173
    platform/mock/RTCDTMFSenderHandlerMock.cpp
2173
    platform/mock/RTCNotifiersMock.cpp
2174
    platform/mock/RTCNotifiersMock.cpp
2174
    platform/mock/RTCPeerConnectionHandlerMock.cpp
2175
    platform/mock/RTCPeerConnectionHandlerMock.cpp
2175
    platform/mock/ScrollbarThemeMock.cpp
2176
    platform/mock/ScrollbarThemeMock.cpp
2176
2177
2178
    platform/mock/mediasource/MockBox.cpp
2179
    platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
2180
    platform/mock/mediasource/MockMediaSourcePrivate.cpp
2181
    platform/mock/mediasource/MockSourceBufferPrivate.cpp
2182
    platform/mock/mediasource/MockTracks.cpp
2183
2177
    platform/network/AuthenticationChallengeBase.cpp
2184
    platform/network/AuthenticationChallengeBase.cpp
2178
    platform/network/BlobData.cpp
2185
    platform/network/BlobData.cpp
2179
    platform/network/BlobDataFileReference.cpp
2186
    platform/network/BlobDataFileReference.cpp
Lines 3123-3136 set(WebCoreTestSupport_IDL_FILES a/Source/WebCore/CMakeLists.txt_sec2
3123
)
3130
)
3124
3131
3125
set(WebCoreTestSupport_SOURCES
3132
set(WebCoreTestSupport_SOURCES
3126
    platform/mock/PlatformSpeechSynthesizerMock.cpp
3127
3128
    platform/mock/mediasource/MockBox.cpp
3129
    platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
3130
    platform/mock/mediasource/MockMediaSourcePrivate.cpp
3131
    platform/mock/mediasource/MockSourceBufferPrivate.cpp
3132
    platform/mock/mediasource/MockTracks.cpp
3133
3134
    testing/InternalSettings.cpp
3133
    testing/InternalSettings.cpp
3135
    testing/Internals.cpp
3134
    testing/Internals.cpp
3136
3135
- a/Source/WebCore/WebCore.exp.in -2 / +2 lines
Lines 3232-3238 __ZN7WebCore8Document13getTouchRectsERN3WTF6VectorINS_7IntRectELm0ENS1_15CrashOn a/Source/WebCore/WebCore.exp.in_sec1
3232
#if ENABLE(MEDIA_SOURCE)
3232
#if ENABLE(MEDIA_SOURCE)
3233
__ZN7WebCore12SourceBuffer25bufferedSamplesForTrackIDERKN3WTF12AtomicStringE
3233
__ZN7WebCore12SourceBuffer25bufferedSamplesForTrackIDERKN3WTF12AtomicStringE
3234
__ZN7WebCore14JSSourceBuffer9toWrappedEN3JSC7JSValueE
3234
__ZN7WebCore14JSSourceBuffer9toWrappedEN3JSC7JSValueE
3235
__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EE
3235
__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EE
3236
#endif
3236
#endif
3237
3237
3238
#if ENABLE(MEDIA_STREAM)
3238
#if ENABLE(MEDIA_STREAM)
Lines 3408-3414 __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE a/Source/WebCore/WebCore.exp.in_sec2
3408
__ZN7WebCore16HTMLMediaElement4playEv
3408
__ZN7WebCore16HTMLMediaElement4playEv
3409
__ZN7WebCore16HTMLMediaElement5pauseEv
3409
__ZN7WebCore16HTMLMediaElement5pauseEv
3410
__ZN7WebCore16HTMLMediaElement8setMutedEb
3410
__ZN7WebCore16HTMLMediaElement8setMutedEb
3411
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EEE
3411
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EEE
3412
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3412
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3413
__ZNK7WebCore10TimeRanges7nearestEd
3413
__ZNK7WebCore10TimeRanges7nearestEd
3414
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
3414
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +4 lines
Lines 5576-5581 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
5576
		CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
5576
		CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; };
5577
		CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
5577
		CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; };
5578
		CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; };
5578
		CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; };
5579
		CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */; settings = {ATTRIBUTES = (Private, ); }; };
5579
		CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
5580
		CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
5580
		CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };
5581
		CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; };
5581
		CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };
5582
		CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 12993-12998 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
12993
		CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
12994
		CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; };
12994
		CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
12995
		CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; };
12995
		CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; };
12996
		CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; };
12997
		CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEnginePlayerType.h; sourceTree = "<group>"; };
12996
		CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };
12998
		CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; };
12997
		CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };
12999
		CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; };
12998
		CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };
13000
		CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; };
Lines 20475-20480 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
20475
				141DC04C164834B900371E5A /* LayoutRect.cpp */,
20477
				141DC04C164834B900371E5A /* LayoutRect.cpp */,
20476
				141DC04D164834B900371E5A /* LayoutRect.h */,
20478
				141DC04D164834B900371E5A /* LayoutRect.h */,
20477
				141DC04E164834B900371E5A /* LayoutSize.h */,
20479
				141DC04E164834B900371E5A /* LayoutSize.h */,
20480
				CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */,
20478
				E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */,
20481
				E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */,
20479
				E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */,
20482
				E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */,
20480
				079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */,
20483
				079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */,
Lines 24450-24455 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24450
				A8D223FE16B52E4E00157288 /* HTMLResourcePreloader.h in Headers */,
24453
				A8D223FE16B52E4E00157288 /* HTMLResourcePreloader.h in Headers */,
24451
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24454
				A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */,
24452
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24455
				977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */,
24456
				CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */,
24453
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24457
				977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */,
24454
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24458
				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,
24455
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
24459
				E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */,
- a/Source/WebCore/html/HTMLMediaElement.cpp -3 / +3 lines
Lines 4645-4651 void HTMLMediaElement::clearMediaPlayer(int flags) a/Source/WebCore/html/HTMLMediaElement.cpp_sec1
4645
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4645
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4646
#endif
4646
#endif
4647
4647
4648
    m_player.clear();
4648
    m_player = nullptr;
4649
4649
4650
    stopPeriodicTimers();
4650
    stopPeriodicTimers();
4651
    m_loadTimer.stop();
4651
    m_loadTimer.stop();
Lines 4692-4698 void HTMLMediaElement::stop() a/Source/WebCore/html/HTMLMediaElement.cpp_sec2
4692
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4692
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4693
    // the media player now. Note that userCancelledLoad will already have cleared the player
4693
    // the media player now. Note that userCancelledLoad will already have cleared the player
4694
    // if the media was not fully loaded. This handles all other cases.
4694
    // if the media was not fully loaded. This handles all other cases.
4695
    m_player.clear();
4695
    m_player = nullptr;
4696
4696
4697
    updateSleepDisabling();
4697
    updateSleepDisabling();
4698
}
4698
}
Lines 5333-5339 void HTMLMediaElement::createMediaPlayer() a/Source/WebCore/html/HTMLMediaElement.cpp_sec3
5333
#if ENABLE(VIDEO_TRACK)
5333
#if ENABLE(VIDEO_TRACK)
5334
    forgetResourceSpecificTracks();
5334
    forgetResourceSpecificTracks();
5335
#endif
5335
#endif
5336
    m_player = MediaPlayer::create(*this);
5336
    m_player = std::make_unique<MediaPlayer>(static_cast<MediaPlayerClient&>(*this));
5337
5337
5338
#if ENABLE(WEB_AUDIO)
5338
#if ENABLE(WEB_AUDIO)
5339
    if (m_audioSourceNode) {
5339
    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 -25 / +61 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 56-69 a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec2
56
#define PlatformMediaEngineClassName MediaPlayerPrivateMediaFoundation
57
#define PlatformMediaEngineClassName MediaPlayerPrivateMediaFoundation
57
#endif
58
#endif
58
59
60
#if ENABLE(VIDEO) && USE(AVFOUNDATION)
61
#include "MediaPlayerPrivateAVFoundationObjC.h"
62
#endif
63
59
#if PLATFORM(COCOA)
64
#if PLATFORM(COCOA)
60
#include "MediaPlayerPrivateQTKit.h"
65
#include "MediaPlayerPrivateQTKit.h"
61
#if USE(AVFOUNDATION)
62
#include "MediaPlayerPrivateAVFoundationObjC.h"
63
#if ENABLE(MEDIA_SOURCE)
66
#if ENABLE(MEDIA_SOURCE)
64
#include "MediaPlayerPrivateMediaSourceAVFObjC.h"
67
#include "MediaPlayerPrivateMediaSourceAVFObjC.h"
65
#endif
68
#endif
66
#endif
67
#elif PLATFORM(WIN) && !USE(GSTREAMER)
69
#elif PLATFORM(WIN) && !USE(GSTREAMER)
68
#if USE(AVFOUNDATION)
70
#if USE(AVFOUNDATION)
69
#include "MediaPlayerPrivateAVFoundationCF.h"
71
#include "MediaPlayerPrivateAVFoundationCF.h"
Lines 78-84 const PlatformMedia NoPlatformMedia = { PlatformMedia::None, {0} }; a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec3
78
80
79
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
81
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
80
public:
82
public:
81
    NullMediaPlayerPrivate(MediaPlayer*) { }
83
    explicit NullMediaPlayerPrivate(MediaPlayer*) { }
82
84
83
    virtual void load(const String&) { }
85
    virtual void load(const String&) { }
84
#if ENABLE(MEDIA_SOURCE)
86
#if ENABLE(MEDIA_SOURCE)
Lines 144-182 public: a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec4
144
#endif
146
#endif
145
};
147
};
146
148
147
static PassOwnPtr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) 
148
{ 
149
    return adoptPtr(new NullMediaPlayerPrivate(player)); 
150
}
151
152
149
153
// engine support
150
// engine support
154
151
155
struct MediaPlayerFactory {
152
struct MediaPlayerFactory {
156
    WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED;
153
    WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED;
157
public:
154
public:
158
    MediaPlayerFactory(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs,
155
    MediaPlayerFactory(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs,
159
        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
156
        MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
160
        : constructor(constructor)
157
            : playerType(playerType)
161
        , getSupportedTypes(getSupportedTypes)
158
            , getSupportedTypes(getSupportedTypes)
162
        , supportsTypeAndCodecs(supportsTypeAndCodecs)
159
            , supportsTypeAndCodecs(supportsTypeAndCodecs)
163
        , getSitesInMediaCache(getSitesInMediaCache)
160
            , getSitesInMediaCache(getSitesInMediaCache)
164
        , clearMediaCache(clearMediaCache)
161
            , clearMediaCache(clearMediaCache)
165
        , clearMediaCacheForSite(clearMediaCacheForSite)
162
            , clearMediaCacheForSite(clearMediaCacheForSite)
166
        , supportsKeySystem(supportsKeySystem)
163
            , supportsKeySystem(supportsKeySystem)
167
    {
164
    {
168
    }
165
    }
169
166
170
    CreateMediaEnginePlayer constructor;
167
    MediaEnginePlayerType playerType;
171
    MediaEngineSupportedTypes getSupportedTypes;
168
    MediaEngineSupportedTypes getSupportedTypes;
172
    MediaEngineSupportsType supportsTypeAndCodecs;
169
    MediaEngineSupportsType supportsTypeAndCodecs;
173
    MediaEngineGetSitesInMediaCache getSitesInMediaCache;
170
    MediaEngineGetSitesInMediaCache getSitesInMediaCache;
174
    MediaEngineClearMediaCache clearMediaCache;
171
    MediaEngineClearMediaCache clearMediaCache;
175
    MediaEngineClearMediaCacheForSite clearMediaCacheForSite;
172
    MediaEngineClearMediaCacheForSite clearMediaCacheForSite;
176
    MediaEngineSupportsKeySystem supportsKeySystem;
173
    MediaEngineSupportsKeySystem supportsKeySystem;
174
175
    std::unique_ptr<MediaPlayerPrivateInterface> createMediaPlayer(MediaPlayer* player)
176
    {
177
        switch (playerType) {
178
        case NullMediaPlayer:
179
            return std::make_unique<NullMediaPlayerPrivate>(player);
180
#if USE(AVFOUNDATION)
181
#if PLATFORM(WIN)
182
        case AVFoundationCFPlayer:
183
            return std::make_unique<MediaPlayerPrivateAVFoundationCF>(player);
184
#endif
185
        case AVFoundationObjCPlayer:
186
            return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player);
187
#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE)
188
        case MediaSourceAVFObjCPlayer:
189
            return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player);
190
#endif
191
#endif // USE(AVFOUNDATION)
192
#if USE(GSTREAMER)
193
        case GStreamerPlayer:
194
            return std::make_unique<MediaPlayerPrivateGStreamer>(player);
195
#endif
196
#if PLATFORM(COCOA)
197
        case QTKitPlayer:
198
            return std::make_unique<MediaPlayerPrivateQTKit>(player);
199
#endif
200
#if PLATFORM(WIN) && USE(MEDIA_FOUNDATION)
201
        case MediaFoundationPlayer:
202
            return std::make_unique<MediaPlayerPrivateMediaFoundation>(player);
203
#endif
204
#if ENABLE(MEDIA_SOURCE)
205
        case MockMediaSourcePlayer:
206
            return std::make_unique<MockMediaPlayerMediaSource>(player);
207
#endif
208
        default:
209
            ASSERT_NOT_REACHED();
210
            return std::make_unique<NullMediaPlayerPrivate>(player);
211
        }
212
    }
177
};
213
};
178
214
179
static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
215
static void addMediaEngine(MediaEnginePlayerType, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
180
216
181
static MediaPlayerFactory* bestMediaEngineForSupportParameters(const MediaEngineSupportParameters&, MediaPlayerFactory* current = 0);
217
static MediaPlayerFactory* bestMediaEngineForSupportParameters(const MediaEngineSupportParameters&, MediaPlayerFactory* current = 0);
182
static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current);
218
static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current);
Lines 223-236 static Vector<MediaPlayerFactory*>& installedMediaEngines(RequeryEngineOptions r a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec5
223
    return installedEngines;
259
    return installedEngines;
224
}
260
}
225
261
226
static void addMediaEngine(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType,
262
static void addMediaEngine(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType,
227
    MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
263
    MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem)
228
{
264
{
229
    ASSERT(constructor);
265
    ASSERT(playerType);
230
    ASSERT(getSupportedTypes);
266
    ASSERT(getSupportedTypes);
231
    ASSERT(supportsType);
267
    ASSERT(supportsType);
232
268
233
    installedMediaEngines().append(new MediaPlayerFactory(constructor, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem));
269
    installedMediaEngines().append(new MediaPlayerFactory(playerType, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem));
234
}
270
}
235
271
236
static const AtomicString& applicationOctetStream()
272
static const AtomicString& applicationOctetStream()
Lines 308-314 static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec6
308
MediaPlayer::MediaPlayer(MediaPlayerClient& client)
344
MediaPlayer::MediaPlayer(MediaPlayerClient& client)
309
    : m_client(client)
345
    : m_client(client)
310
    , m_reloadTimer(this, &MediaPlayer::reloadTimerFired)
346
    , m_reloadTimer(this, &MediaPlayer::reloadTimerFired)
311
    , m_private(createNullMediaPlayer(this))
347
    , m_private(std::make_unique<NullMediaPlayerPrivate>(this))
312
    , m_currentMediaEngine(0)
348
    , m_currentMediaEngine(0)
313
    , m_preload(Auto)
349
    , m_preload(Auto)
314
    , m_visible(false)
350
    , m_visible(false)
Lines 409-415 void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec7
409
        m_private = nullptr;
445
        m_private = nullptr;
410
    } else if (m_currentMediaEngine != engine) {
446
    } else if (m_currentMediaEngine != engine) {
411
        m_currentMediaEngine = engine;
447
        m_currentMediaEngine = engine;
412
        m_private = engine->constructor(this);
448
        m_private = engine->createMediaPlayer(this);
413
        m_client.mediaPlayerEngineUpdated(this);
449
        m_client.mediaPlayerEngineUpdated(this);
414
        m_private->setPrivateBrowsingMode(m_privateBrowsing);
450
        m_private->setPrivateBrowsingMode(m_privateBrowsing);
415
        m_private->setPreload(m_preload);
451
        m_private->setPreload(m_preload);
Lines 426-432 void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec8
426
#endif
462
#endif
427
        m_private->load(m_url.string());
463
        m_private->load(m_url.string());
428
    } else {
464
    } else {
429
        m_private = createNullMediaPlayer(this);
465
        m_private = std::make_unique<NullMediaPlayerPrivate>(this);
430
        m_client.mediaPlayerEngineUpdated(this);
466
        m_client.mediaPlayerEngineUpdated(this);
431
        m_client.mediaPlayerResourceNotSupported(this);
467
        m_client.mediaPlayerResourceNotSupported(this);
432
    }
468
    }
- 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 45-52 a/Source/WebCore/platform/graphics/MediaPlayer.h_sec2
45
#include <wtf/HashSet.h>
46
#include <wtf/HashSet.h>
46
#include <wtf/MediaTime.h>
47
#include <wtf/MediaTime.h>
47
#include <wtf/Noncopyable.h>
48
#include <wtf/Noncopyable.h>
48
#include <wtf/OwnPtr.h>
49
#include <wtf/PassOwnPtr.h>
50
#include <wtf/text/StringHash.h>
49
#include <wtf/text/StringHash.h>
51
50
52
#if ENABLE(AVF_CAPTIONS)
51
#if ENABLE(AVF_CAPTIONS)
Lines 278-288 public: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec3
278
class MediaPlayer {
277
class MediaPlayer {
279
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
278
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
280
public:
279
public:
281
280
    explicit MediaPlayer(MediaPlayerClient&);
282
    static PassOwnPtr<MediaPlayer> create(MediaPlayerClient& client)
283
    {
284
        return adoptPtr(new MediaPlayer(client));
285
    }
286
    virtual ~MediaPlayer();
281
    virtual ~MediaPlayer();
287
282
288
    // Media engine support.
283
    // 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