| Differences between
and this patch
- a/Source/WebCore/ChangeLog +42 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2020-01-07  youenn fablet  <youenn@apple.com>
2
3
        Implement MediaRecorder backend in GPUProcess
4
        https://bugs.webkit.org/show_bug.cgi?id=205802
5
6
        Reviewed by Eric Carlson.
7
8
        Add a page provider to create MediaRecorderPrivate implementations.
9
        This is used by WebKit layer to implement this in GPUProcess.
10
11
        Update MediaRecorderPrivate by adding an error callback that is used to surface errors as MediaRecorder error events.
12
13
        Covered by existing tests as MediaRecorder implementation in WebKitTestRunner will use GPUProcess.
14
15
        * Headers.cmake:
16
        * Modules/mediarecorder/MediaRecorder.cpp:
17
        (WebCore::MediaRecorder::create):
18
        (WebCore::MediaRecorder::createMediaRecorderPrivate):
19
        * Modules/mediarecorder/MediaRecorder.h:
20
        * Modules/mediarecorder/MediaRecorderProvider.cpp: Added.
21
        (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
22
        * Modules/mediarecorder/MediaRecorderProvider.h: Added.
23
        * Sources.txt:
24
        * WebCore.xcodeproj/project.pbxproj:
25
        * loader/EmptyClients.cpp:
26
        (WebCore::pageConfigurationWithEmptyClients):
27
        * page/Page.cpp:
28
        (WebCore::Page::Page):
29
        * page/Page.h:
30
        (WebCore::Page::mediaRecorderProvider):
31
        * page/PageConfiguration.cpp:
32
        (WebCore::PageConfiguration::PageConfiguration):
33
        * page/PageConfiguration.h:
34
        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
35
        * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
36
        (WebCore::MediaRecorderPrivateWriter::create):
37
        * platform/mediastream/MediaStreamPrivate.h:
38
        * platform/mediastream/MediaStreamTrackPrivate.h:
39
        * testing/Internals.cpp:
40
        (WebCore::Internals::resetToConsistentState):
41
        (WebCore::Internals::setUseGPUProcessForWebRTC):
42
1
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
43
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2
44
3
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
45
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
- a/Source/WebKit/ChangeLog +67 lines
Lines 1-3 a/Source/WebKit/ChangeLog_sec1
1
2020-01-07  youenn fablet  <youenn@apple.com>
2
3
        Implement MediaRecorder backend in GPUProcess
4
        https://bugs.webkit.org/show_bug.cgi?id=205802
5
6
        Reviewed by Eric Carlson.
7
8
        Add support for sending audio/video tracks to record from WebProcess to GPUProcess.
9
        Add a MediaRecorderPrivate implementation that supports sending one audio track and/or one video track to GPUProcess
10
        and stopping/fetching data from the remote recorder in GPUProcess.
11
12
        In GPUProcess, implement the remote recorder using the existing WebCore recorder writer.
13
14
        * CMakeLists.txt:
15
        * DerivedSources-input.xcfilelist:
16
        * DerivedSources-output.xcfilelist:
17
        * DerivedSources.make:
18
        * GPUProcess/GPUConnectionToWebProcess.cpp:
19
        (WebKit::GPUConnectionToWebProcess::userMediaCaptureManagerProxy):
20
        (WebKit::GPUConnectionToWebProcess::mediaRecorders):
21
        (WebKit::GPUConnectionToWebProcess::didReceiveMessage):
22
        * GPUProcess/GPUConnectionToWebProcess.h:
23
        * GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in:
24
        * GPUProcess/webrtc/RemoteMediaRecorder.cpp: Added.
25
        (WebKit::RemoteMediaRecorder::create):
26
        (WebKit::RemoteMediaRecorder::RemoteMediaRecorder):
27
        (WebKit::RemoteMediaRecorder::~RemoteMediaRecorder):
28
        (WebKit::RemoteMediaRecorder::storage):
29
        (WebKit::RemoteMediaRecorder::audioSamplesStorageChanged):
30
        (WebKit::RemoteMediaRecorder::audioSamplesAvailable):
31
        (WebKit::RemoteMediaRecorder::videoSampleAvailable):
32
        (WebKit::RemoteMediaRecorder::fetchData):
33
        (WebKit::RemoteMediaRecorder::stopRecording):
34
        * GPUProcess/webrtc/RemoteMediaRecorder.h: Added.
35
        * GPUProcess/webrtc/RemoteMediaRecorder.messages.in: Added.
36
        * GPUProcess/webrtc/RemoteMediaRecorders.cpp: Added.
37
        (WebKit::RemoteMediaRecorders::RemoteMediaRecorders):
38
        (WebKit::RemoteMediaRecorders::~RemoteMediaRecorders):
39
        (WebKit::RemoteMediaRecorders::didReceiveRemoteMediaRecorderMessage):
40
        (WebKit::RemoteMediaRecorders::createRecorder):
41
        (WebKit::RemoteMediaRecorders::releaseRecorder):
42
        * GPUProcess/webrtc/RemoteMediaRecorders.h: Added.
43
        (WebKit::RemoteMediaRecorders::didReceiveMessageFromWebProcess):
44
        * GPUProcess/webrtc/RemoteMediaRecorders.messages.in: Added.
45
        * Scripts/webkit/messages.py:
46
        * Sources.txt:
47
        * SourcesCocoa.txt:
48
        * WebKit.xcodeproj/project.pbxproj:
49
        * WebProcess/GPU/media/MediaRecorderProvider.cpp: Added.
50
        (WebCore::MediaRecorderProvider::createMediaRecorderPrivate):
51
        * WebProcess/GPU/media/MediaRecorderProvider.h: Added.
52
        * WebProcess/GPU/webrtc/MediaRecorderIdentifier.h: Added.
53
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp: Added.
54
        (WebKit::MediaRecorderPrivate::MediaRecorderPrivate):
55
        (WebKit::MediaRecorderPrivate::~MediaRecorderPrivate):
56
        (WebKit::MediaRecorderPrivate::sampleBufferUpdated):
57
        (WebKit::MediaRecorderPrivate::audioSamplesAvailable):
58
        (WebKit::MediaRecorderPrivate::storageChanged):
59
        (WebKit::MediaRecorderPrivate::fetchData):
60
        (WebKit::MediaRecorderPrivate::stopRecording):
61
        * WebProcess/GPU/webrtc/MediaRecorderPrivate.h: Added.
62
        * WebProcess/GPU/webrtc/MediaRecorderProvider.cpp: Added.
63
        (WebKit::MediaRecorderProvider::createMediaRecorderPrivate):
64
        * WebProcess/GPU/webrtc/MediaRecorderProvider.h: Added.
65
        * WebProcess/WebPage/WebPage.cpp:
66
        (WebKit::m_overriddenMediaType):
67
1
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
68
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2
69
3
        [GTK][WPE] Add API to retrieve and delete surrounding text for input methods
70
        [GTK][WPE] Add API to retrieve and delete surrounding text for input methods
- a/Source/WebKitLegacy/mac/ChangeLog +11 lines
Lines 1-3 a/Source/WebKitLegacy/mac/ChangeLog_sec1
1
2020-01-07  youenn fablet  <youenn@apple.com>
2
3
        Implement MediaRecorder backend in GPUProcess
4
        https://bugs.webkit.org/show_bug.cgi?id=205802
5
6
        Reviewed by Eric Carlson.
7
8
        * WebView/WebView.mm:
9
        (-[WebView _commonInitializationWithFrameName:groupName:]):
10
        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
11
1
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
12
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2
13
3
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
14
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
- a/Source/WebKitLegacy/win/ChangeLog +10 lines
Lines 1-3 a/Source/WebKitLegacy/win/ChangeLog_sec1
1
2020-01-07  youenn fablet  <youenn@apple.com>
2
3
        Implement MediaRecorder backend in GPUProcess
4
        https://bugs.webkit.org/show_bug.cgi?id=205802
5
6
        Reviewed by Eric Carlson.
7
8
        * WebView.cpp:
9
        (WebView::initWithFrame):
10
1
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
11
2020-01-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2
12
3
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
13
        [GTK][WPE] Add API to set purpose and hints of active editable element to input methods
- a/Source/WebCore/Headers.cmake +4 lines
Lines 80-85 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec1
80
    Modules/indexeddb/shared/IDBResultData.h
80
    Modules/indexeddb/shared/IDBResultData.h
81
    Modules/indexeddb/shared/IDBTransactionInfo.h
81
    Modules/indexeddb/shared/IDBTransactionInfo.h
82
82
83
    Modules/mediarecorder/MediaRecorderProvider.h
84
83
    Modules/mediasession/MediaSessionEvents.h
85
    Modules/mediasession/MediaSessionEvents.h
84
    Modules/mediasession/MediaSessionMetadata.h
86
    Modules/mediasession/MediaSessionMetadata.h
85
    Modules/mediasession/WebMediaSessionManager.h
87
    Modules/mediasession/WebMediaSessionManager.h
Lines 1155-1160 set(WebCore_PRIVATE_FRAMEWORK_HEADERS a/Source/WebCore/Headers.cmake_sec2
1155
    platform/graphics/transforms/TransformOperations.h
1157
    platform/graphics/transforms/TransformOperations.h
1156
    platform/graphics/transforms/TransformationMatrix.h
1158
    platform/graphics/transforms/TransformationMatrix.h
1157
1159
1160
    platform/mediarecorder/MediaRecorderPrivate.h
1161
1158
    platform/mediastream/CaptureDevice.h
1162
    platform/mediastream/CaptureDevice.h
1159
    platform/mediastream/CaptureDeviceManager.h
1163
    platform/mediastream/CaptureDeviceManager.h
1160
    platform/mediastream/MediaConstraints.h
1164
    platform/mediastream/MediaConstraints.h
- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp -10 / +20 lines
Lines 34-39 a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp_sec1
34
#include "EventNames.h"
34
#include "EventNames.h"
35
#include "MediaRecorderErrorEvent.h"
35
#include "MediaRecorderErrorEvent.h"
36
#include "MediaRecorderPrivate.h"
36
#include "MediaRecorderPrivate.h"
37
#include "MediaRecorderProvider.h"
38
#include "Page.h"
37
#include "SharedBuffer.h"
39
#include "SharedBuffer.h"
38
#include "WindowEventLoop.h"
40
#include "WindowEventLoop.h"
39
#include <wtf/IsoMallocInlines.h>
41
#include <wtf/IsoMallocInlines.h>
Lines 50-60 creatorFunction MediaRecorder::m_customCreator = nullptr; a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp_sec2
50
52
51
ExceptionOr<Ref<MediaRecorder>> MediaRecorder::create(Document& document, Ref<MediaStream>&& stream, Options&& options)
53
ExceptionOr<Ref<MediaRecorder>> MediaRecorder::create(Document& document, Ref<MediaStream>&& stream, Options&& options)
52
{
54
{
53
    auto privateInstance = MediaRecorder::getPrivateImpl(stream->privateStream());
55
    auto privateInstance = MediaRecorder::createMediaRecorderPrivate(document, stream->privateStream());
54
    if (!privateInstance)
56
    if (!privateInstance)
55
        return Exception { NotSupportedError, "The MediaRecorder is unsupported on this platform"_s };
57
        return Exception { NotSupportedError, "The MediaRecorder is unsupported on this platform"_s };
56
    auto recorder = adoptRef(*new MediaRecorder(document, WTFMove(stream), WTFMove(privateInstance), WTFMove(options)));
58
    auto recorder = adoptRef(*new MediaRecorder(document, WTFMove(stream), WTFMove(privateInstance), WTFMove(options)));
57
    recorder->suspendIfNeeded();
59
    recorder->suspendIfNeeded();
60
    recorder->m_private->setErrorCallback([recorder = recorder.copyRef()](auto&& exception) mutable {
61
        recorder->dispatchError(WTFMove(*exception));
62
    });
58
    return recorder;
63
    return recorder;
59
}
64
}
60
65
Lines 63-79 void MediaRecorder::setCustomPrivateRecorderCreator(creatorFunction creator) a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp_sec3
63
    m_customCreator = creator;
68
    m_customCreator = creator;
64
}
69
}
65
70
66
std::unique_ptr<MediaRecorderPrivate> MediaRecorder::getPrivateImpl(const MediaStreamPrivate& stream)
71
std::unique_ptr<MediaRecorderPrivate> MediaRecorder::createMediaRecorderPrivate(Document& document, const MediaStreamPrivate& stream)
67
{
72
{
68
    if (m_customCreator)
73
    if (m_customCreator)
69
        return m_customCreator();
74
        return m_customCreator();
70
    
75
    
71
#if PLATFORM(COCOA)
76
    auto* page = document.page();
72
    return MediaRecorderPrivateAVFImpl::create(stream);
77
    if (!page)
73
#else
78
        return nullptr;
74
    UNUSED_PARAM(stream);
79
75
    return nullptr;
80
    return page->mediaRecorderProvider().createMediaRecorderPrivate(stream);
76
#endif
77
}
81
}
78
82
79
MediaRecorder::MediaRecorder(Document& document, Ref<MediaStream>&& stream, std::unique_ptr<MediaRecorderPrivate>&& privateImpl, Options&& option)
83
MediaRecorder::MediaRecorder(Document& document, Ref<MediaStream>&& stream, std::unique_ptr<MediaRecorderPrivate>&& privateImpl, Options&& option)
Lines 182-192 void MediaRecorder::didAddOrRemoveTrack() a/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp_sec4
182
        if (!m_isActive || state() == RecordingState::Inactive)
186
        if (!m_isActive || state() == RecordingState::Inactive)
183
            return;
187
            return;
184
        stopRecordingInternal();
188
        stopRecordingInternal();
185
        auto event = MediaRecorderErrorEvent::create(eventNames().errorEvent, Exception { UnknownError, "Track cannot be added to or removed from the MediaStream while recording is happening"_s });
189
        dispatchError(Exception { UnknownError, "Track cannot be added to or removed from the MediaStream while recording is happening"_s });
186
        dispatchEvent(WTFMove(event));
187
    });
190
    });
188
}
191
}
189
192
193
void MediaRecorder::dispatchError(Exception&& exception)
194
{
195
    if (!m_isActive)
196
        return;
197
    dispatchEvent(MediaRecorderErrorEvent::create(eventNames().errorEvent, WTFMove(exception)));
198
}
199
190
void MediaRecorder::trackEnded(MediaStreamTrackPrivate&)
200
void MediaRecorder::trackEnded(MediaStreamTrackPrivate&)
191
{
201
{
192
    auto position = m_tracks.findMatching([](auto& track) {
202
    auto position = m_tracks.findMatching([](auto& track) {
- a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h -3 / +5 lines
Lines 71-81 public: a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h_sec1
71
    
71
    
72
    ExceptionOr<void> startRecording(Optional<int>);
72
    ExceptionOr<void> startRecording(Optional<int>);
73
    ExceptionOr<void> stopRecording();
73
    ExceptionOr<void> stopRecording();
74
    
74
75
private:
75
private:
76
    MediaRecorder(Document&, Ref<MediaStream>&&, std::unique_ptr<MediaRecorderPrivate>&&, Options&& = { });
76
    MediaRecorder(Document&, Ref<MediaStream>&&, std::unique_ptr<MediaRecorderPrivate>&&, Options&& = { });
77
77
78
    static std::unique_ptr<MediaRecorderPrivate> getPrivateImpl(const MediaStreamPrivate&);
78
    static std::unique_ptr<MediaRecorderPrivate> createMediaRecorderPrivate(Document&, const MediaStreamPrivate&);
79
    
79
    
80
    Document* document() const;
80
    Document* document() const;
81
81
Lines 91-97 private: a/Source/WebCore/Modules/mediarecorder/MediaRecorder.h_sec2
91
    const char* activeDOMObjectName() const final;
91
    const char* activeDOMObjectName() const final;
92
    
92
    
93
    void stopRecordingInternal();
93
    void stopRecordingInternal();
94
    
94
95
    void dispatchError(Exception&&);
96
95
    // MediaStream::Observer
97
    // MediaStream::Observer
96
    void didAddOrRemoveTrack() final;
98
    void didAddOrRemoveTrack() final;
97
    
99
    
- a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp +49 lines
Line 0 a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "MediaRecorderProvider.h"
28
29
#include "MediaRecorderPrivate.h"
30
31
#if PLATFORM(COCOA)
32
#include "MediaRecorderPrivateAVFImpl.h"
33
#endif
34
35
namespace WebCore {
36
37
#if ENABLE(MEDIA_STREAM)
38
std::unique_ptr<MediaRecorderPrivate> MediaRecorderProvider::createMediaRecorderPrivate(const MediaStreamPrivate& stream)
39
{
40
#if PLATFORM(COCOA)
41
    return MediaRecorderPrivateAVFImpl::create(stream);
42
#else
43
    UNUSED_PARAM(stream);
44
    return nullptr;
45
#endif
46
}
47
#endif
48
49
}
- a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h +49 lines
Line 0 a/Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
namespace WebCore {
29
30
class MediaRecorderPrivate;
31
class MediaStreamPrivate;
32
33
class WEBCORE_EXPORT MediaRecorderProvider {
34
    WTF_MAKE_FAST_ALLOCATED;
35
public:
36
    MediaRecorderProvider() = default;
37
    virtual ~MediaRecorderProvider() = default;
38
39
#if ENABLE(MEDIA_STREAM)
40
    virtual std::unique_ptr<MediaRecorderPrivate> createMediaRecorderPrivate(const MediaStreamPrivate&);
41
#endif
42
43
    void setUseGPUProcess(bool value) { m_useGPUProcess = value; }
44
45
protected:
46
    bool m_useGPUProcess { false };
47
};
48
49
}
- a/Source/WebCore/Sources.txt +1 lines
Lines 151-156 Modules/mediacontrols/MediaControlsHost.cpp a/Source/WebCore/Sources.txt_sec1
151
151
152
Modules/mediarecorder/BlobEvent.cpp
152
Modules/mediarecorder/BlobEvent.cpp
153
Modules/mediarecorder/MediaRecorder.cpp
153
Modules/mediarecorder/MediaRecorder.cpp
154
Modules/mediarecorder/MediaRecorderProvider.cpp
154
Modules/mediarecorder/MediaRecorderErrorEvent.cpp
155
Modules/mediarecorder/MediaRecorderErrorEvent.cpp
155
156
156
Modules/mediasession/HTMLMediaElementMediaSession.cpp
157
Modules/mediasession/HTMLMediaElementMediaSession.cpp
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -2 / +8 lines
Lines 1101-1106 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
1101
		417612B01E3A994000C3D81D /* LibWebRTCMediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 417612AC1E3A993B00C3D81D /* LibWebRTCMediaEndpoint.h */; };
1101
		417612B01E3A994000C3D81D /* LibWebRTCMediaEndpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 417612AC1E3A993B00C3D81D /* LibWebRTCMediaEndpoint.h */; };
1102
		417612B11E3A994000C3D81D /* LibWebRTCPeerConnectionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417612AD1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.cpp */; };
1102
		417612B11E3A994000C3D81D /* LibWebRTCPeerConnectionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417612AD1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.cpp */; };
1103
		417612B21E3A994000C3D81D /* LibWebRTCPeerConnectionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 417612AE1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.h */; };
1103
		417612B21E3A994000C3D81D /* LibWebRTCPeerConnectionBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 417612AE1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.h */; };
1104
		4176E89623C3537B003E83FE /* MediaRecorderProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 4176E88F23C348D2003E83FE /* MediaRecorderProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
1104
		417DA6D913734E6E007C57FB /* Internals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA4CF13734326007C57FB /* Internals.cpp */; };
1105
		417DA6D913734E6E007C57FB /* Internals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA4CF13734326007C57FB /* Internals.cpp */; };
1105
		417DA6DA13734E6E007C57FB /* Internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 417DA4CE13734326007C57FB /* Internals.h */; };
1106
		417DA6DA13734E6E007C57FB /* Internals.h in Headers */ = {isa = PBXBuildFile; fileRef = 417DA4CE13734326007C57FB /* Internals.h */; };
1106
		417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA71B13735DFA007C57FB /* JSInternals.cpp */; };
1107
		417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA71B13735DFA007C57FB /* JSInternals.cpp */; };
Lines 1374-1382 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
1374
		4BDEA32C218033EB0052DFCD /* JSWorkletGlobalScopeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDEA32B218033EB0052DFCD /* JSWorkletGlobalScopeBase.h */; };
1375
		4BDEA32C218033EB0052DFCD /* JSWorkletGlobalScopeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDEA32B218033EB0052DFCD /* JSWorkletGlobalScopeBase.h */; };
1375
		4D3B00AB215D69A70076B983 /* MediaRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00A9215D69A70076B983 /* MediaRecorder.h */; };
1376
		4D3B00AB215D69A70076B983 /* MediaRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00A9215D69A70076B983 /* MediaRecorder.h */; };
1376
		4D3B00AF215D6A690076B983 /* BlobEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00AD215D6A690076B983 /* BlobEvent.h */; };
1377
		4D3B00AF215D6A690076B983 /* BlobEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B00AD215D6A690076B983 /* BlobEvent.h */; };
1377
		4D3B5016217E58B700665DB1 /* MediaRecorderPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B5014217E58B700665DB1 /* MediaRecorderPrivate.h */; };
1378
		4D3B5016217E58B700665DB1 /* MediaRecorderPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D3B5014217E58B700665DB1 /* MediaRecorderPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
1378
		4D73F946218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D73F944218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h */; };
1379
		4D73F946218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D73F944218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h */; };
1379
		4D73F94E218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D73F94C218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h */; };
1380
		4D73F94E218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 4D73F94C218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
1380
		4DB7130D216ECB4D0096A4DD /* MediaRecorderErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB7130C216EC2BD0096A4DD /* MediaRecorderErrorEvent.h */; };
1381
		4DB7130D216ECB4D0096A4DD /* MediaRecorderErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 4DB7130C216EC2BD0096A4DD /* MediaRecorderErrorEvent.h */; };
1381
		4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
1382
		4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959200A39DABA00220FE5 /* MediaFeatureNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
1382
		4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959240A39DACC00220FE5 /* MediaQuery.h */; settings = {ATTRIBUTES = (Private, ); }; };
1383
		4E19592A0A39DACC00220FE5 /* MediaQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959240A39DACC00220FE5 /* MediaQuery.h */; settings = {ATTRIBUTES = (Private, ); }; };
Lines 7399-7404 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
7399
		417612AE1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCPeerConnectionBackend.h; path = libwebrtc/LibWebRTCPeerConnectionBackend.h; sourceTree = "<group>"; };
7400
		417612AE1E3A993B00C3D81D /* LibWebRTCPeerConnectionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LibWebRTCPeerConnectionBackend.h; path = libwebrtc/LibWebRTCPeerConnectionBackend.h; sourceTree = "<group>"; };
7400
		4176900322FCD8F200B1576D /* MediaSourceRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourceRegistry.h; sourceTree = "<group>"; };
7401
		4176900322FCD8F200B1576D /* MediaSourceRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourceRegistry.h; sourceTree = "<group>"; };
7401
		4176900422FCD8F200B1576D /* MediaSourceRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceRegistry.cpp; sourceTree = "<group>"; };
7402
		4176900422FCD8F200B1576D /* MediaSourceRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSourceRegistry.cpp; sourceTree = "<group>"; };
7403
		4176E88F23C348D2003E83FE /* MediaRecorderProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRecorderProvider.h; sourceTree = "<group>"; };
7404
		4176E89123C34B75003E83FE /* MediaRecorderProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRecorderProvider.cpp; sourceTree = "<group>"; };
7402
		4177F51C2382544000C04486 /* BaseAudioSharedUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseAudioSharedUnit.cpp; sourceTree = "<group>"; };
7405
		4177F51C2382544000C04486 /* BaseAudioSharedUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseAudioSharedUnit.cpp; sourceTree = "<group>"; };
7403
		4177F51E2382545E00C04486 /* BaseAudioSharedUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseAudioSharedUnit.h; sourceTree = "<group>"; };
7406
		4177F51E2382545E00C04486 /* BaseAudioSharedUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseAudioSharedUnit.h; sourceTree = "<group>"; };
7404
		417DA4CE13734326007C57FB /* Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Internals.h; sourceTree = "<group>"; };
7407
		417DA4CE13734326007C57FB /* Internals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Internals.h; sourceTree = "<group>"; };
Lines 18932-18937 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
18932
				4DB7130E216EEBAE0096A4DD /* MediaRecorderErrorEvent.cpp */,
18935
				4DB7130E216EEBAE0096A4DD /* MediaRecorderErrorEvent.cpp */,
18933
				4DB7130C216EC2BD0096A4DD /* MediaRecorderErrorEvent.h */,
18936
				4DB7130C216EC2BD0096A4DD /* MediaRecorderErrorEvent.h */,
18934
				4DB7130A216EC2BC0096A4DD /* MediaRecorderErrorEvent.idl */,
18937
				4DB7130A216EC2BC0096A4DD /* MediaRecorderErrorEvent.idl */,
18938
				4176E89123C34B75003E83FE /* MediaRecorderProvider.cpp */,
18939
				4176E88F23C348D2003E83FE /* MediaRecorderProvider.h */,
18935
			);
18940
			);
18936
			path = mediarecorder;
18941
			path = mediarecorder;
18937
			sourceTree = "<group>";
18942
			sourceTree = "<group>";
Lines 31474-31479 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
31474
				4D3B5016217E58B700665DB1 /* MediaRecorderPrivate.h in Headers */,
31479
				4D3B5016217E58B700665DB1 /* MediaRecorderPrivate.h in Headers */,
31475
				4D73F946218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h in Headers */,
31480
				4D73F946218BC5FA003A3ED6 /* MediaRecorderPrivateAVFImpl.h in Headers */,
31476
				4D73F94E218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h in Headers */,
31481
				4D73F94E218C4A87003A3ED6 /* MediaRecorderPrivateWriterCocoa.h in Headers */,
31482
				4176E89623C3537B003E83FE /* MediaRecorderProvider.h in Headers */,
31477
				C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
31483
				C90843D01B18E47D00B68564 /* MediaRemoteControls.h in Headers */,
31478
				CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
31484
				CD8ACA8F1D23971900ECC59E /* MediaRemoteSoftLink.h in Headers */,
31479
				CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
31485
				CEEFCD7A19DB31F7003876D7 /* MediaResourceLoader.h in Headers */,
- a/Source/WebCore/loader/EmptyClients.cpp -2 / +14 lines
Lines 53-58 a/Source/WebCore/loader/EmptyClients.cpp_sec1
53
#include "IDBConnectionToServer.h"
53
#include "IDBConnectionToServer.h"
54
#include "InspectorClient.h"
54
#include "InspectorClient.h"
55
#include "LibWebRTCProvider.h"
55
#include "LibWebRTCProvider.h"
56
#include "MediaRecorderPrivate.h"
57
#include "MediaRecorderProvider.h"
56
#include "NetworkStorageSession.h"
58
#include "NetworkStorageSession.h"
57
#include "Page.h"
59
#include "Page.h"
58
#include "PageConfiguration.h"
60
#include "PageConfiguration.h"
Lines 571-580 Ref<StorageNamespace> EmptyStorageNamespaceProvider::createTransientLocalStorage a/Source/WebCore/loader/EmptyClients.cpp_sec2
571
    return adoptRef(*new EmptyStorageNamespace { sessionID });
573
    return adoptRef(*new EmptyStorageNamespace { sessionID });
572
}
574
}
573
575
574
class EmptyStorageSessionProvider : public StorageSessionProvider {
576
class EmptyStorageSessionProvider final : public StorageSessionProvider {
575
    NetworkStorageSession* storageSession() const final { return nullptr; }
577
    NetworkStorageSession* storageSession() const final { return nullptr; }
576
};
578
};
577
579
580
class EmptyMediaRecorderProvider final : public MediaRecorderProvider {
581
public:
582
    EmptyMediaRecorderProvider() = default;
583
private:
584
#if ENABLE(MEDIA_STREAM)
585
    std::unique_ptr<MediaRecorderPrivate> createMediaRecorderPrivate(const MediaStreamPrivate&) final { return nullptr; }
586
#endif
587
};
588
578
PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID)
589
PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID)
579
{
590
{
580
    PageConfiguration pageConfiguration {
591
    PageConfiguration pageConfiguration {
Lines 585-591 PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID) a/Source/WebCore/loader/EmptyClients.cpp_sec3
585
        CacheStorageProvider::create(),
596
        CacheStorageProvider::create(),
586
        adoptRef(*new EmptyBackForwardClient),
597
        adoptRef(*new EmptyBackForwardClient),
587
        CookieJar::create(adoptRef(*new EmptyStorageSessionProvider)),
598
        CookieJar::create(adoptRef(*new EmptyStorageSessionProvider)),
588
        makeUniqueRef<EmptyProgressTrackerClient>()
599
        makeUniqueRef<EmptyProgressTrackerClient>(),
600
        makeUniqueRef<EmptyMediaRecorderProvider>()
589
    };
601
    };
590
602
591
    static NeverDestroyed<EmptyChromeClient> dummyChromeClient;
603
    static NeverDestroyed<EmptyChromeClient> dummyChromeClient;
- a/Source/WebCore/page/Page.cpp +1 lines
Lines 246-251 Page::Page(PageConfiguration&& pageConfiguration) a/Source/WebCore/page/Page.cpp_sec1
246
#if ENABLE(SPEECH_SYNTHESIS)
246
#if ENABLE(SPEECH_SYNTHESIS)
247
    , m_speechSynthesisClient(WTFMove(pageConfiguration.speechSynthesisClient))
247
    , m_speechSynthesisClient(WTFMove(pageConfiguration.speechSynthesisClient))
248
#endif
248
#endif
249
    , m_mediaRecorderProvider((WTFMove(pageConfiguration.mediaRecorderProvider)))
249
    , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider))
250
    , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider))
250
    , m_verticalScrollElasticity(ScrollElasticityAllowed)
251
    , m_verticalScrollElasticity(ScrollElasticityAllowed)
251
    , m_horizontalScrollElasticity(ScrollElasticityAllowed)
252
    , m_horizontalScrollElasticity(ScrollElasticityAllowed)
- a/Source/WebCore/page/Page.h -1 / +3 lines
Lines 110-115 class LibWebRTCProvider; a/Source/WebCore/page/Page.h_sec1
110
class LowPowerModeNotifier;
110
class LowPowerModeNotifier;
111
class MediaCanStartListener;
111
class MediaCanStartListener;
112
class MediaPlaybackTarget;
112
class MediaPlaybackTarget;
113
class MediaRecorderProvider;
113
class PageConfiguration;
114
class PageConfiguration;
114
class PageConsoleClient;
115
class PageConsoleClient;
115
class PageDebuggable;
116
class PageDebuggable;
Lines 584-589 public: a/Source/WebCore/page/Page.h_sec2
584
    DatabaseProvider& databaseProvider() { return m_databaseProvider; }
585
    DatabaseProvider& databaseProvider() { return m_databaseProvider; }
585
    CacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider; }
586
    CacheStorageProvider& cacheStorageProvider() { return m_cacheStorageProvider; }
586
    SocketProvider& socketProvider() { return m_socketProvider; }
587
    SocketProvider& socketProvider() { return m_socketProvider; }
588
    MediaRecorderProvider& mediaRecorderProvider() { return m_mediaRecorderProvider; }
587
    CookieJar& cookieJar() { return m_cookieJar.get(); }
589
    CookieJar& cookieJar() { return m_cookieJar.get(); }
588
590
589
    StorageNamespaceProvider& storageNamespaceProvider() { return m_storageNamespaceProvider.get(); }
591
    StorageNamespaceProvider& storageNamespaceProvider() { return m_storageNamespaceProvider.get(); }
Lines 795-800 private: a/Source/WebCore/page/Page.h_sec3
795
    std::unique_ptr<SpeechSynthesisClient> m_speechSynthesisClient;
797
    std::unique_ptr<SpeechSynthesisClient> m_speechSynthesisClient;
796
#endif
798
#endif
797
799
800
    UniqueRef<MediaRecorderProvider> m_mediaRecorderProvider;
798
    UniqueRef<LibWebRTCProvider> m_libWebRTCProvider;
801
    UniqueRef<LibWebRTCProvider> m_libWebRTCProvider;
799
    RTCController m_rtcController;
802
    RTCController m_rtcController;
800
803
Lines 920-926 private: a/Source/WebCore/page/Page.h_sec4
920
    Ref<UserContentProvider> m_userContentProvider;
923
    Ref<UserContentProvider> m_userContentProvider;
921
    Ref<VisitedLinkStore> m_visitedLinkStore;
924
    Ref<VisitedLinkStore> m_visitedLinkStore;
922
    RefPtr<WheelEventTestMonitor> m_wheelEventTestMonitor;
925
    RefPtr<WheelEventTestMonitor> m_wheelEventTestMonitor;
923
924
    HashSet<ActivityStateChangeObserver*> m_activityStateChangeObservers;
926
    HashSet<ActivityStateChangeObserver*> m_activityStateChangeObservers;
925
927
926
#if ENABLE(RESOURCE_USAGE)
928
#if ENABLE(RESOURCE_USAGE)
- a/Source/WebCore/page/PageConfiguration.cpp -1 / +3 lines
Lines 36-41 a/Source/WebCore/page/PageConfiguration.cpp_sec1
36
#include "DragClient.h"
36
#include "DragClient.h"
37
#include "EditorClient.h"
37
#include "EditorClient.h"
38
#include "LibWebRTCProvider.h"
38
#include "LibWebRTCProvider.h"
39
#include "MediaRecorderProvider.h"
39
#include "PerformanceLoggingClient.h"
40
#include "PerformanceLoggingClient.h"
40
#include "PlugInClient.h"
41
#include "PlugInClient.h"
41
#include "PluginInfoProvider.h"
42
#include "PluginInfoProvider.h"
Lines 55-61 a/Source/WebCore/page/PageConfiguration.cpp_sec2
55
56
56
namespace WebCore {
57
namespace WebCore {
57
58
58
PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar, UniqueRef<ProgressTrackerClient>&& progressTrackerClient)
59
PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar, UniqueRef<ProgressTrackerClient>&& progressTrackerClient, UniqueRef<MediaRecorderProvider>&& mediaRecorderProvider)
59
    : sessionID(sessionID)
60
    : sessionID(sessionID)
60
    , editorClient(WTFMove(editorClient))
61
    , editorClient(WTFMove(editorClient))
61
    , socketProvider(WTFMove(socketProvider))
62
    , socketProvider(WTFMove(socketProvider))
Lines 64-69 PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorC a/Source/WebCore/page/PageConfiguration.cpp_sec3
64
    , backForwardClient(WTFMove(backForwardClient))
65
    , backForwardClient(WTFMove(backForwardClient))
65
    , cookieJar(WTFMove(cookieJar))
66
    , cookieJar(WTFMove(cookieJar))
66
    , cacheStorageProvider(WTFMove(cacheStorageProvider))
67
    , cacheStorageProvider(WTFMove(cacheStorageProvider))
68
    , mediaRecorderProvider(WTFMove(mediaRecorderProvider))
67
{
69
{
68
}
70
}
69
71
- a/Source/WebCore/page/PageConfiguration.h -1 / +3 lines
Lines 52-57 class EditorClient; a/Source/WebCore/page/PageConfiguration.h_sec1
52
class FrameLoaderClient;
52
class FrameLoaderClient;
53
class InspectorClient;
53
class InspectorClient;
54
class LibWebRTCProvider;
54
class LibWebRTCProvider;
55
class MediaRecorderProvider;
55
class PaymentCoordinatorClient;
56
class PaymentCoordinatorClient;
56
class PerformanceLoggingClient;
57
class PerformanceLoggingClient;
57
class PlugInClient;
58
class PlugInClient;
Lines 68-74 class SpeechSynthesisClient; a/Source/WebCore/page/PageConfiguration.h_sec2
68
class PageConfiguration {
69
class PageConfiguration {
69
    WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
70
    WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
70
public:
71
public:
71
    WEBCORE_EXPORT PageConfiguration(PAL::SessionID, UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&, UniqueRef<ProgressTrackerClient>&&);
72
    WEBCORE_EXPORT PageConfiguration(PAL::SessionID, UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&, UniqueRef<ProgressTrackerClient>&&, UniqueRef<MediaRecorderProvider>&&);
72
    WEBCORE_EXPORT ~PageConfiguration();
73
    WEBCORE_EXPORT ~PageConfiguration();
73
    PageConfiguration(PageConfiguration&&);
74
    PageConfiguration(PageConfiguration&&);
74
75
Lines 123-128 public: a/Source/WebCore/page/PageConfiguration.h_sec3
123
    RefPtr<DeviceOrientationUpdateProvider> deviceOrientationUpdateProvider;
124
    RefPtr<DeviceOrientationUpdateProvider> deviceOrientationUpdateProvider;
124
#endif
125
#endif
125
    Vector<String> corsDisablingPatterns;
126
    Vector<String> corsDisablingPatterns;
127
    UniqueRef<MediaRecorderProvider> mediaRecorderProvider;
126
};
128
};
127
129
128
}
130
}
- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h -4 / +12 lines
Lines 26-31 a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h_sec1
26
26
27
#include <wtf/CompletionHandler.h>
27
#include <wtf/CompletionHandler.h>
28
#include <wtf/Forward.h>
28
#include <wtf/Forward.h>
29
#include "Exception.h"
29
30
30
#if ENABLE(MEDIA_STREAM)
31
#if ENABLE(MEDIA_STREAM)
31
32
Lines 43-54 class SharedBuffer; a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h_sec2
43
44
44
class MediaRecorderPrivate {
45
class MediaRecorderPrivate {
45
public:
46
public:
46
    virtual void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) = 0;
47
    virtual ~MediaRecorderPrivate() = default;
47
    virtual void audioSamplesAvailable(MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) = 0;
48
49
    virtual void sampleBufferUpdated(const MediaStreamTrackPrivate&, MediaSample&) = 0;
50
    virtual void audioSamplesAvailable(const MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) = 0;
48
51
49
    virtual void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String& mimeType)>&&) = 0;
52
    virtual void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String& mimeType)>&&) = 0;
50
    virtual ~MediaRecorderPrivate() = default;
53
    virtual void stopRecording() { };
51
    virtual void stopRecording() { }
54
55
    using ErrorCallback = Function<void(Optional<Exception>&&)>;
56
    void setErrorCallback(ErrorCallback&& errorCallback) { m_errorCallback = WTFMove(errorCallback); }
57
58
protected:
59
    ErrorCallback m_errorCallback;
52
};
60
};
53
    
61
    
54
} // namespace WebCore
62
} // namespace WebCore
- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp -3 / +2 lines
Lines 40-46 std::unique_ptr<MediaRecorderPrivateAVFImpl> MediaRecorderPrivateAVFImpl::create a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp_sec1
40
{
40
{
41
    // FIXME: we will need to implement support for multiple audio/video tracks
41
    // FIXME: we will need to implement support for multiple audio/video tracks
42
    // Currently we only choose the first track as the recorded track.
42
    // Currently we only choose the first track as the recorded track.
43
    // FIXME: We would better to throw an exception to JavaScript if writer creation fails.
44
43
45
    String audioTrackId;
44
    String audioTrackId;
46
    String videoTrackId;
45
    String videoTrackId;
Lines 82-95 MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl(Ref<MediaRecorderPrivat a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp_sec2
82
{
81
{
83
}
82
}
84
83
85
void MediaRecorderPrivateAVFImpl::sampleBufferUpdated(MediaStreamTrackPrivate& track, MediaSample& sampleBuffer)
84
void MediaRecorderPrivateAVFImpl::sampleBufferUpdated(const MediaStreamTrackPrivate& track, MediaSample& sampleBuffer)
86
{
85
{
87
    if (track.id() != m_recordedVideoTrackID)
86
    if (track.id() != m_recordedVideoTrackID)
88
        return;
87
        return;
89
    m_writer->appendVideoSampleBuffer(sampleBuffer.platformSample().sample.cmSampleBuffer);
88
    m_writer->appendVideoSampleBuffer(sampleBuffer.platformSample().sample.cmSampleBuffer);
90
}
89
}
91
90
92
void MediaRecorderPrivateAVFImpl::audioSamplesAvailable(MediaStreamTrackPrivate& track, const WTF::MediaTime& mediaTime, const PlatformAudioData& data, const AudioStreamDescription& description, size_t sampleCount)
91
void MediaRecorderPrivateAVFImpl::audioSamplesAvailable(const MediaStreamTrackPrivate& track, const WTF::MediaTime& mediaTime, const PlatformAudioData& data, const AudioStreamDescription& description, size_t sampleCount)
93
{
92
{
94
    if (track.id() != m_recordedAudioTrackID)
93
    if (track.id() != m_recordedAudioTrackID)
95
        return;
94
        return;
- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h -2 / +2 lines
Lines 43-50 private: a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.h_sec1
43
43
44
    friend std::unique_ptr<MediaRecorderPrivateAVFImpl> std::make_unique<MediaRecorderPrivateAVFImpl>(Ref<MediaRecorderPrivateWriter>&&, String&&, String&&);
44
    friend std::unique_ptr<MediaRecorderPrivateAVFImpl> std::make_unique<MediaRecorderPrivateAVFImpl>(Ref<MediaRecorderPrivateWriter>&&, String&&, String&&);
45
45
46
    void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final;
46
    void sampleBufferUpdated(const MediaStreamTrackPrivate&, MediaSample&) final;
47
    void audioSamplesAvailable(MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final;
47
    void audioSamplesAvailable(const MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final;
48
    void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String&)>&&) final;
48
    void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String&)>&&) final;
49
    const String& mimeType();
49
    const String& mimeType();
50
    void stopRecording();
50
    void stopRecording();
- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.cpp -3 / +3 lines
Lines 33-49 a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.cpp_sec1
33
33
34
namespace WebCore {
34
namespace WebCore {
35
35
36
void MediaRecorderPrivateMock::sampleBufferUpdated(MediaStreamTrackPrivate& track, MediaSample&)
36
void MediaRecorderPrivateMock::sampleBufferUpdated(const MediaStreamTrackPrivate& track, MediaSample&)
37
{
37
{
38
    generateMockString(track);
38
    generateMockString(track);
39
}
39
}
40
40
41
void MediaRecorderPrivateMock::audioSamplesAvailable(MediaStreamTrackPrivate& track, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t)
41
void MediaRecorderPrivateMock::audioSamplesAvailable(const MediaStreamTrackPrivate& track, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t)
42
{
42
{
43
    generateMockString(track);
43
    generateMockString(track);
44
}
44
}
45
45
46
void MediaRecorderPrivateMock::generateMockString(MediaStreamTrackPrivate& track)
46
void MediaRecorderPrivateMock::generateMockString(const MediaStreamTrackPrivate& track)
47
{
47
{
48
    auto locker = holdLock(m_bufferLock);
48
    auto locker = holdLock(m_bufferLock);
49
    if (track.type() == RealtimeMediaSource::Type::Audio)
49
    if (track.type() == RealtimeMediaSource::Type::Audio)
- a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h -3 / +3 lines
Lines 36-47 class MediaStreamTrackPrivate; a/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h_sec1
36
36
37
class WEBCORE_EXPORT MediaRecorderPrivateMock final : public MediaRecorderPrivate {
37
class WEBCORE_EXPORT MediaRecorderPrivateMock final : public MediaRecorderPrivate {
38
private:
38
private:
39
    void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final;
39
    void sampleBufferUpdated(const MediaStreamTrackPrivate&, MediaSample&) final;
40
    void audioSamplesAvailable(MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final;
40
    void audioSamplesAvailable(const MediaStreamTrackPrivate&, const WTF::MediaTime&, const PlatformAudioData&, const AudioStreamDescription&, size_t) final;
41
    void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String&)>&&) final;
41
    void fetchData(CompletionHandler<void(RefPtr<SharedBuffer>&&, const String&)>&&) final;
42
    const String& mimeType();
42
    const String& mimeType();
43
    
43
    
44
    void generateMockString(MediaStreamTrackPrivate&);
44
    void generateMockString(const MediaStreamTrackPrivate&);
45
45
46
    mutable Lock m_bufferLock;
46
    mutable Lock m_bufferLock;
47
    StringBuilder m_buffer;
47
    StringBuilder m_buffer;
- a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h -1 / +2 lines
Lines 49-57 class AudioStreamDescription; a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h_sec1
49
class MediaStreamTrackPrivate;
49
class MediaStreamTrackPrivate;
50
class PlatformAudioData;
50
class PlatformAudioData;
51
51
52
class MediaRecorderPrivateWriter : public ThreadSafeRefCounted<MediaRecorderPrivateWriter, WTF::DestructionThread::Main>, public CanMakeWeakPtr<MediaRecorderPrivateWriter> {
52
class WEBCORE_EXPORT MediaRecorderPrivateWriter : public ThreadSafeRefCounted<MediaRecorderPrivateWriter, WTF::DestructionThread::Main>, public CanMakeWeakPtr<MediaRecorderPrivateWriter> {
53
public:
53
public:
54
    static RefPtr<MediaRecorderPrivateWriter> create(const MediaStreamTrackPrivate* audioTrack, const MediaStreamTrackPrivate* videoTrack);
54
    static RefPtr<MediaRecorderPrivateWriter> create(const MediaStreamTrackPrivate* audioTrack, const MediaStreamTrackPrivate* videoTrack);
55
    static RefPtr<MediaRecorderPrivateWriter> create(bool hasAudio, int width, int height);
55
    ~MediaRecorderPrivateWriter();
56
    ~MediaRecorderPrivateWriter();
56
    
57
    
57
    bool setupWriter();
58
    bool setupWriter();
- a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm -4 / +14 lines
Lines 90-95 static NSString *getAVEncoderBitRateKeyWithFallback() a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm_sec1
90
}
90
}
91
91
92
RefPtr<MediaRecorderPrivateWriter> MediaRecorderPrivateWriter::create(const MediaStreamTrackPrivate* audioTrack, const MediaStreamTrackPrivate* videoTrack)
92
RefPtr<MediaRecorderPrivateWriter> MediaRecorderPrivateWriter::create(const MediaStreamTrackPrivate* audioTrack, const MediaStreamTrackPrivate* videoTrack)
93
{
94
    int width = 0, height = 0;
95
    if (videoTrack) {
96
        auto& settings = videoTrack->settings();
97
        width = settings.width();
98
        height = settings.height();
99
    }
100
    return create(!!audioTrack, width, height);
101
}
102
103
RefPtr<MediaRecorderPrivateWriter> MediaRecorderPrivateWriter::create(bool hasAudio, int width, int height)
93
{
104
{
94
    NSString *directory = FileSystem::createTemporaryDirectory(@"videos");
105
    NSString *directory = FileSystem::createTemporaryDirectory(@"videos");
95
    NSString *filename = [NSString stringWithFormat:@"/%lld.mp4", CMClockGetTime(CMClockGetHostTimeClock()).value];
106
    NSString *filename = [NSString stringWithFormat:@"/%lld.mp4", CMClockGetTime(CMClockGetHostTimeClock()).value];
Lines 106-117 RefPtr<MediaRecorderPrivateWriter> MediaRecorderPrivateWriter::create(const Medi a/Source/WebCore/platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm_sec2
106
117
107
    auto writer = adoptRef(*new MediaRecorderPrivateWriter(WTFMove(avAssetWriter), WTFMove(filePath)));
118
    auto writer = adoptRef(*new MediaRecorderPrivateWriter(WTFMove(avAssetWriter), WTFMove(filePath)));
108
119
109
    if (audioTrack && !writer->setAudioInput())
120
    if (hasAudio && !writer->setAudioInput())
110
        return nullptr;
121
        return nullptr;
111
122
112
    if (videoTrack) {
123
    if (width && height) {
113
        auto& settings = videoTrack->settings();
124
        if (!writer->setVideoInput(width, height))
114
        if (!writer->setVideoInput(settings.width(), settings.height()))
115
            return nullptr;
125
            return nullptr;
116
    }
126
    }
117
127
- a/Source/WebCore/platform/mediastream/MediaStreamPrivate.h -1 / +1 lines
Lines 81-87 public: a/Source/WebCore/platform/mediastream/MediaStreamPrivate.h_sec1
81
81
82
    String id() const { return m_id; }
82
    String id() const { return m_id; }
83
83
84
    MediaStreamTrackPrivateVector tracks() const;
84
    WEBCORE_EXPORT MediaStreamTrackPrivateVector tracks() const;
85
    MediaStreamTrackPrivate* activeVideoTrack() { return m_activeVideoTrack; }
85
    MediaStreamTrackPrivate* activeVideoTrack() { return m_activeVideoTrack; }
86
86
87
    bool active() const { return m_isActive; }
87
    bool active() const { return m_isActive; }
- a/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h -2 / +2 lines
Lines 100-106 public: a/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h_sec1
100
    Ref<MediaStreamTrackPrivate> clone();
100
    Ref<MediaStreamTrackPrivate> clone();
101
101
102
    RealtimeMediaSource& source() { return m_source.get(); }
102
    RealtimeMediaSource& source() { return m_source.get(); }
103
    RealtimeMediaSource::Type type() const;
103
    WEBCORE_EXPORT RealtimeMediaSource::Type type() const;
104
104
105
    void endTrack();
105
    void endTrack();
106
106
Lines 110-116 public: a/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h_sec2
110
    bool hasObserver(Observer&) const;
110
    bool hasObserver(Observer&) const;
111
#endif
111
#endif
112
112
113
    const RealtimeMediaSourceSettings& settings() const;
113
    WEBCORE_EXPORT const RealtimeMediaSourceSettings& settings() const;
114
    const RealtimeMediaSourceCapabilities& capabilities() const;
114
    const RealtimeMediaSourceCapabilities& capabilities() const;
115
115
116
    void applyConstraints(const MediaConstraints&, RealtimeMediaSource::ApplyConstraintsHandler&&);
116
    void applyConstraints(const MediaConstraints&, RealtimeMediaSource::ApplyConstraintsHandler&&);
- a/Source/WebCore/testing/Internals.cpp +5 lines
Lines 122-127 a/Source/WebCore/testing/Internals.cpp_sec1
122
#include "MediaEngineConfigurationFactory.h"
122
#include "MediaEngineConfigurationFactory.h"
123
#include "MediaPlayer.h"
123
#include "MediaPlayer.h"
124
#include "MediaProducer.h"
124
#include "MediaProducer.h"
125
#include "MediaRecorderProvider.h"
125
#include "MediaResourceLoader.h"
126
#include "MediaResourceLoader.h"
126
#include "MediaStreamTrack.h"
127
#include "MediaStreamTrack.h"
127
#include "MemoryCache.h"
128
#include "MemoryCache.h"
Lines 550-555 void Internals::resetToConsistentState(Page& page) a/Source/WebCore/testing/Internals.cpp_sec2
550
551
551
#if ENABLE(MEDIA_STREAM)
552
#if ENABLE(MEDIA_STREAM)
552
    RuntimeEnabledFeatures::sharedFeatures().setInterruptAudioOnPageVisibilityChangeEnabled(false);
553
    RuntimeEnabledFeatures::sharedFeatures().setInterruptAudioOnPageVisibilityChangeEnabled(false);
554
    WebCore::MediaRecorder::setCustomPrivateRecorderCreator(nullptr);
555
    page.mediaRecorderProvider().setUseGPUProcess(true);
553
#endif
556
#endif
554
557
555
    HTMLCanvasElement::setMaxPixelMemoryForTesting(0); // This means use the default value.
558
    HTMLCanvasElement::setMaxPixelMemoryForTesting(0); // This means use the default value.
Lines 1558-1564 void Internals::setUseGPUProcessForWebRTC(bool useGPUProcess) a/Source/WebCore/testing/Internals.cpp_sec3
1558
    auto* document = contextDocument();
1561
    auto* document = contextDocument();
1559
    if (!document || !document->page())
1562
    if (!document || !document->page())
1560
        return;
1563
        return;
1564
1561
    document->page()->libWebRTCProvider().setUseGPUProcess(useGPUProcess);
1565
    document->page()->libWebRTCProvider().setUseGPUProcess(useGPUProcess);
1566
    document->page()->mediaRecorderProvider().setUseGPUProcess(useGPUProcess);
1562
#endif
1567
#endif
1563
}
1568
}
1564
#endif
1569
#endif
- a/Source/WebKit/CMakeLists.txt +2 lines
Lines 78-83 set(WebKit_INCLUDE_DIRECTORIES a/Source/WebKit/CMakeLists.txt_sec1
78
    "${WEBKIT_DIR}/WebProcess/Gamepad"
78
    "${WEBKIT_DIR}/WebProcess/Gamepad"
79
    "${WEBKIT_DIR}/WebProcess/Geolocation"
79
    "${WEBKIT_DIR}/WebProcess/Geolocation"
80
    "${WEBKIT_DIR}/WebProcess/GPU"
80
    "${WEBKIT_DIR}/WebProcess/GPU"
81
    "${WEBKIT_DIR}/WebProcess/GPU/media"
82
    "${WEBKIT_DIR}/WebProcess/GPU/webrtc"
81
    "${WEBKIT_DIR}/WebProcess/IconDatabase"
83
    "${WEBKIT_DIR}/WebProcess/IconDatabase"
82
    "${WEBKIT_DIR}/WebProcess/InjectedBundle"
84
    "${WEBKIT_DIR}/WebProcess/InjectedBundle"
83
    "${WEBKIT_DIR}/WebProcess/InjectedBundle/API"
85
    "${WEBKIT_DIR}/WebProcess/InjectedBundle/API"
- a/Source/WebKit/DerivedSources-input.xcfilelist +3 lines
Lines 19-24 $(PROJECT_DIR)/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in a/Source/WebKit/DerivedSources-input.xcfilelist_sec1
19
$(PROJECT_DIR)/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in
19
$(PROJECT_DIR)/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in
20
$(PROJECT_DIR)/GPUProcess/media/RemoteMediaResourceManager.messages.in
20
$(PROJECT_DIR)/GPUProcess/media/RemoteMediaResourceManager.messages.in
21
$(PROJECT_DIR)/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in
21
$(PROJECT_DIR)/GPUProcess/webrtc/LibWebRTCCodecsProxy.messages.in
22
$(PROJECT_DIR)/GPUProcess/webrtc/RemoteMediaRecorder.messages.in
23
$(PROJECT_DIR)/GPUProcess/webrtc/RemoteMediaRecorderManager.messages.in
24
$(PROJECT_DIR)/GPUProcess/webrtc/RemoteMediaRecorders.messages.in
22
$(PROJECT_DIR)/NetworkProcess/Cookies/WebCookieManager.messages.in
25
$(PROJECT_DIR)/NetworkProcess/Cookies/WebCookieManager.messages.in
23
$(PROJECT_DIR)/NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in
26
$(PROJECT_DIR)/NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in
24
$(PROJECT_DIR)/NetworkProcess/IndexedDB/WebIDBServer.messages.in
27
$(PROJECT_DIR)/NetworkProcess/IndexedDB/WebIDBServer.messages.in
- a/Source/WebKit/DerivedSources-output.xcfilelist +9 lines
Lines 129-134 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerMessagesRep a/Source/WebKit/DerivedSources-output.xcfilelist_sec1
129
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessageReceiver.cpp
129
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessageReceiver.cpp
130
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessages.h
130
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessages.h
131
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessagesReplies.h
131
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaPlayerManagerProxyMessagesReplies.h
132
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderManagerMessageReceiver.cpp
133
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderManagerMessages.h
134
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderManagerMessagesReplies.h
135
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderMessageReceiver.cpp
136
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderMessages.h
137
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecorderMessagesReplies.h
138
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecordersMessageReceiver.cpp
139
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecordersMessages.h
140
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaRecordersMessagesReplies.h
132
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessageReceiver.cpp
141
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessageReceiver.cpp
133
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessages.h
142
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessages.h
134
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessagesReplies.h
143
$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/RemoteMediaResourceManagerMessagesReplies.h
- a/Source/WebKit/DerivedSources.make +2 lines
Lines 143-148 MESSAGE_RECEIVERS = \ a/Source/WebKit/DerivedSources.make_sec1
143
    RemoteLayerTreeDrawingAreaProxy \
143
    RemoteLayerTreeDrawingAreaProxy \
144
    RemoteMediaPlayerManager \
144
    RemoteMediaPlayerManager \
145
    RemoteMediaPlayerManagerProxy \
145
    RemoteMediaPlayerManagerProxy \
146
    RemoteMediaRecorder \
147
    RemoteMediaRecorderManager \
146
    RemoteMediaResourceManager \
148
    RemoteMediaResourceManager \
147
    RemoteObjectRegistry \
149
    RemoteObjectRegistry \
148
    RemoteScrollingCoordinator \
150
    RemoteScrollingCoordinator \
- a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp +19 lines
Lines 39-44 a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp_sec1
39
#include "RemoteLayerTreeDrawingAreaProxyMessages.h"
39
#include "RemoteLayerTreeDrawingAreaProxyMessages.h"
40
#include "RemoteMediaPlayerManagerProxy.h"
40
#include "RemoteMediaPlayerManagerProxy.h"
41
#include "RemoteMediaPlayerManagerProxyMessages.h"
41
#include "RemoteMediaPlayerManagerProxyMessages.h"
42
#include "RemoteMediaRecorderManager.h"
43
#include "RemoteMediaRecorderManagerMessages.h"
44
#include "RemoteMediaRecorderMessages.h"
42
#include "RemoteMediaResourceManager.h"
45
#include "RemoteMediaResourceManager.h"
43
#include "RemoteMediaResourceManagerMessages.h"
46
#include "RemoteMediaResourceManagerMessages.h"
44
#include "RemoteScrollingCoordinatorTransaction.h"
47
#include "RemoteScrollingCoordinatorTransaction.h"
Lines 137-142 UserMediaCaptureManagerProxy& GPUConnectionToWebProcess::userMediaCaptureManager a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp_sec2
137
140
138
    return *m_userMediaCaptureManagerProxy;
141
    return *m_userMediaCaptureManagerProxy;
139
}
142
}
143
144
RemoteMediaRecorderManager& GPUConnectionToWebProcess::mediaRecorderManager()
145
{
146
    if (!m_remoteMediaRecorderManager)
147
        m_remoteMediaRecorderManager = makeUnique<RemoteMediaRecorderManager>(*this);
148
149
    return *m_remoteMediaRecorderManager;
150
}
140
#endif
151
#endif
141
152
142
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
153
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
Lines 163-168 void GPUConnectionToWebProcess::didReceiveMessage(IPC::Connection& connection, I a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp_sec3
163
        userMediaCaptureManagerProxy().didReceiveMessageFromGPUProcess(connection, decoder);
174
        userMediaCaptureManagerProxy().didReceiveMessageFromGPUProcess(connection, decoder);
164
        return;
175
        return;
165
    }
176
    }
177
    if (decoder.messageReceiverName() == Messages::RemoteMediaRecorderManager::messageReceiverName()) {
178
        mediaRecorderManager().didReceiveMessageFromWebProcess(connection, decoder);
179
        return;
180
    }
181
    if (decoder.messageReceiverName() == Messages::RemoteMediaRecorder::messageReceiverName()) {
182
        mediaRecorderManager().didReceiveRemoteMediaRecorderMessage(connection, decoder);
183
        return;
184
    }
166
#endif
185
#endif
167
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
186
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
168
    if (decoder.messageReceiverName() == Messages::LibWebRTCCodecsProxy::messageReceiverName()) {
187
    if (decoder.messageReceiverName() == Messages::LibWebRTCCodecsProxy::messageReceiverName()) {
- a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h -1 / +4 lines
Lines 41-48 namespace WebKit { a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h_sec1
41
class GPUProcess;
41
class GPUProcess;
42
class LibWebRTCCodecsProxy;
42
class LibWebRTCCodecsProxy;
43
class RemoteMediaPlayerManagerProxy;
43
class RemoteMediaPlayerManagerProxy;
44
class UserMediaCaptureManagerProxy;
44
class RemoteMediaRecorderManager;
45
class RemoteMediaResourceManager;
45
class RemoteMediaResourceManager;
46
class UserMediaCaptureManagerProxy;
46
47
47
class GPUConnectionToWebProcess
48
class GPUConnectionToWebProcess
48
    : public RefCounted<GPUConnectionToWebProcess>
49
    : public RefCounted<GPUConnectionToWebProcess>
Lines 71-76 private: a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h_sec2
71
#endif
72
#endif
72
#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
73
#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
73
    UserMediaCaptureManagerProxy& userMediaCaptureManagerProxy();
74
    UserMediaCaptureManagerProxy& userMediaCaptureManagerProxy();
75
    RemoteMediaRecorderManager& mediaRecorderManager();
74
#endif
76
#endif
75
77
76
    // IPC::Connection::Client
78
    // IPC::Connection::Client
Lines 89-94 private: a/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h_sec3
89
    PAL::SessionID m_sessionID;
91
    PAL::SessionID m_sessionID;
90
#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
92
#if PLATFORM(COCOA) && ENABLE(MEDIA_STREAM)
91
    std::unique_ptr<UserMediaCaptureManagerProxy> m_userMediaCaptureManagerProxy;
93
    std::unique_ptr<UserMediaCaptureManagerProxy> m_userMediaCaptureManagerProxy;
94
    std::unique_ptr<RemoteMediaRecorderManager> m_remoteMediaRecorderManager;
92
#endif
95
#endif
93
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
96
#if PLATFORM(COCOA) && USE(LIBWEBRTC)
94
    std::unique_ptr<LibWebRTCCodecsProxy> m_libWebRTCCodecsProxy;
97
    std::unique_ptr<LibWebRTCCodecsProxy> m_libWebRTCCodecsProxy;
- a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.cpp +139 lines
Line 0 a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "RemoteMediaRecorder.h"
28
29
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
30
31
#include "SharedRingBufferStorage.h"
32
#include <WebCore/CARingBuffer.h>
33
#include <WebCore/ImageTransferSessionVT.h>
34
#include <WebCore/RemoteVideoSample.h>
35
#include <WebCore/WebAudioBufferList.h>
36
#include <wtf/CompletionHandler.h>
37
38
using namespace WebCore;
39
40
namespace WebKit {
41
42
std::unique_ptr<RemoteMediaRecorder> RemoteMediaRecorder::create(GPUConnectionToWebProcess& gpuConnectionToWebProcess, MediaRecorderIdentifier identifier, bool recordAudio, int width, int height)
43
{
44
    auto writer = MediaRecorderPrivateWriter::create(recordAudio, width, height);
45
    if (!writer)
46
        return nullptr;
47
    return std::unique_ptr<RemoteMediaRecorder>(new RemoteMediaRecorder { gpuConnectionToWebProcess, identifier, writer.releaseNonNull(), recordAudio });
48
}
49
50
RemoteMediaRecorder::RemoteMediaRecorder(GPUConnectionToWebProcess& gpuConnectionToWebProcess, MediaRecorderIdentifier identifier, Ref<MediaRecorderPrivateWriter>&& writer, bool recordAudio)
51
    : m_gpuConnectionToWebProcess(gpuConnectionToWebProcess)
52
    , m_identifier(identifier)
53
    , m_writer(WTFMove(writer))
54
{
55
    if (recordAudio)
56
        m_ringBuffer = makeUnique<CARingBuffer>(makeUniqueRef<SharedRingBufferStorage>(nullptr));
57
}
58
59
RemoteMediaRecorder::~RemoteMediaRecorder()
60
{
61
}
62
63
SharedRingBufferStorage& RemoteMediaRecorder::storage()
64
{
65
    return static_cast<SharedRingBufferStorage&>(m_ringBuffer->storage());
66
}
67
68
void RemoteMediaRecorder::audioSamplesStorageChanged(const SharedMemory::Handle& handle, const WebCore::CAAudioStreamDescription& description, uint64_t numberOfFrames)
69
{
70
    ASSERT(m_ringBuffer);
71
    if (!m_ringBuffer)
72
        return;
73
74
    m_description = description;
75
76
    if (handle.isNull()) {
77
        m_ringBuffer->deallocate();
78
        storage().setReadOnly(false);
79
        storage().setStorage(nullptr);
80
        return;
81
    }
82
83
    auto memory = SharedMemory::map(handle, SharedMemory::Protection::ReadOnly);
84
    storage().setStorage(WTFMove(memory));
85
    storage().setReadOnly(true);
86
87
    m_ringBuffer->allocate(description, numberOfFrames);
88
}
89
90
void RemoteMediaRecorder::audioSamplesAvailable(MediaTime time, uint64_t numberOfFrames, uint64_t startFrame, uint64_t endFrame)
91
{
92
    ASSERT(m_ringBuffer);
93
    if (!m_ringBuffer)
94
        return;
95
96
    m_ringBuffer->setCurrentFrameBounds(startFrame, endFrame);
97
98
    WebAudioBufferList audioData(m_description, numberOfFrames);
99
    m_ringBuffer->fetch(audioData.list(), numberOfFrames, time.timeValue());
100
101
    m_writer->appendAudioSampleBuffer(audioData, m_description, time, numberOfFrames);
102
}
103
104
void RemoteMediaRecorder::videoSampleAvailable(WebCore::RemoteVideoSample&& remoteSample)
105
{
106
    if (!m_imageTransferSession || m_imageTransferSession->pixelFormat() != remoteSample.videoFormat())
107
        m_imageTransferSession = ImageTransferSessionVT::create(remoteSample.videoFormat());
108
109
    if (!m_imageTransferSession) {
110
        ASSERT_NOT_REACHED();
111
        return;
112
    }
113
114
    auto sampleBuffer = m_imageTransferSession->createMediaSample(remoteSample.surface(), remoteSample.time(), remoteSample.size());
115
    if (!sampleBuffer) {
116
        ASSERT_NOT_REACHED();
117
        return;
118
    }
119
120
    m_writer->appendVideoSampleBuffer(sampleBuffer->platformSample().sample.cmSampleBuffer);
121
}
122
123
void RemoteMediaRecorder::fetchData(CompletionHandler<void(IPC::DataReference&&, const String& mimeType)>&& completionHandler)
124
{
125
    static NeverDestroyed<const String> mp4MimeType(MAKE_STATIC_STRING_IMPL("video/mp4"));
126
    m_writer->fetchData([&mp4MimeType = mp4MimeType.get(), completionHandler = WTFMove(completionHandler)](auto&& data) mutable {
127
        auto* pointer = reinterpret_cast<const uint8_t*>(data ? data->data() : nullptr);
128
        completionHandler(IPC::DataReference { pointer, data ? data->size() : 0 }, mp4MimeType);
129
    });
130
}
131
132
void RemoteMediaRecorder::stopRecording()
133
{
134
    m_writer->stopRecording();
135
}
136
137
}
138
139
#endif
- a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.h +85 lines
Line 0 a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
29
30
#include "MediaRecorderIdentifier.h"
31
#include "MessageReceiver.h"
32
#include "SharedMemory.h"
33
#include <WebCore/CAAudioStreamDescription.h>
34
#include <WebCore/MediaRecorderPrivateWriterCocoa.h>
35
#include <wtf/MediaTime.h>
36
37
namespace IPC {
38
class Connection;
39
class DataReference;
40
class Decoder;
41
}
42
43
namespace WebCore {
44
class CARingBuffer;
45
class ImageTransferSessionVT;
46
class RemoteVideoSample;
47
}
48
49
namespace WebKit {
50
51
class GPUConnectionToWebProcess;
52
class SharedRingBufferStorage;
53
54
class RemoteMediaRecorder : private IPC::MessageReceiver {
55
    WTF_MAKE_FAST_ALLOCATED;
56
public:
57
    static std::unique_ptr<RemoteMediaRecorder> create(GPUConnectionToWebProcess&, MediaRecorderIdentifier, bool recordAudio, int width, int height);
58
    ~RemoteMediaRecorder();
59
60
    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
61
62
private:
63
    RemoteMediaRecorder(GPUConnectionToWebProcess&, MediaRecorderIdentifier, Ref<WebCore::MediaRecorderPrivateWriter>&&, bool recordAudio);
64
65
    // IPC::MessageReceiver
66
    void audioSamplesStorageChanged(const SharedMemory::Handle&, const WebCore::CAAudioStreamDescription&, uint64_t numberOfFrames);
67
    void audioSamplesAvailable(MediaTime, uint64_t numberOfFrames, uint64_t startFrame, uint64_t endFrame);
68
    void videoSampleAvailable(WebCore::RemoteVideoSample&&);
69
    void fetchData(CompletionHandler<void(IPC::DataReference&&, const String& mimeType)>&&);
70
    void stopRecording();
71
72
    SharedRingBufferStorage& storage();
73
74
    GPUConnectionToWebProcess& m_gpuConnectionToWebProcess;
75
    MediaRecorderIdentifier m_identifier;
76
    Ref<WebCore::MediaRecorderPrivateWriter> m_writer;
77
78
    WebCore::CAAudioStreamDescription m_description;
79
    std::unique_ptr<WebCore::CARingBuffer> m_ringBuffer;
80
    std::unique_ptr<WebCore::ImageTransferSessionVT> m_imageTransferSession;
81
};
82
83
}
84
85
#endif
- a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.messages.in +34 lines
Line 0 a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorder.messages.in_sec1
1
# Copyright (C) 2019 Apple Inc. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or without
4
# modification, are permitted provided that the following conditions
5
# are met:
6
# 1. Redistributions of source code must retain the above copyright
7
#    notice, this list of conditions and the following disclaimer.
8
# 2. Redistributions in binary form must reproduce the above copyright
9
#    notice, this list of conditions and the following disclaimer in the
10
#    documentation and/or other materials provided with the distribution.
11
#
12
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
13
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
14
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
15
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
16
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
19
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
22
# THE POSSIBILITY OF SUCH DAMAGE.
23
24
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
25
26
messages -> RemoteMediaRecorder NotRefCounted {
27
    AudioSamplesStorageChanged(WebKit::SharedMemory::Handle storageHandle, WebCore::CAAudioStreamDescription description, uint64_t numberOfFrames)
28
    AudioSamplesAvailable(MediaTime time, uint64_t numberOfFrames, uint64_t startFrame, uint64_t endFrame)
29
    VideoSampleAvailable(WebCore::RemoteVideoSample sample)
30
    FetchData() -> (IPC::DataReference buffer, String mimeType) Async
31
    StopRecording()
32
}
33
34
#endif
- a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorderManager.cpp +72 lines
Line 0 a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorderManager.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "RemoteMediaRecorderManager.h"
28
29
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
30
31
#include "DataReference.h"
32
#include "Decoder.h"
33
#include "RemoteMediaRecorder.h"
34
#include <WebCore/ExceptionData.h>
35
36
namespace WebKit {
37
38
RemoteMediaRecorderManager::RemoteMediaRecorderManager(GPUConnectionToWebProcess& gpuConnectionToWebProcess)
39
    : m_gpuConnectionToWebProcess(gpuConnectionToWebProcess)
40
{
41
}
42
43
RemoteMediaRecorderManager::~RemoteMediaRecorderManager()
44
{
45
}
46
47
void RemoteMediaRecorderManager::didReceiveRemoteMediaRecorderMessage(IPC::Connection& connection, IPC::Decoder& decoder)
48
{
49
    if (auto* recorder = m_recorders.get(makeObjectIdentifier<MediaRecorderIdentifierType>(decoder.destinationID())))
50
        recorder->didReceiveMessage(connection, decoder);
51
}
52
53
void RemoteMediaRecorderManager::createRecorder(MediaRecorderIdentifier identifier, bool recordAudio, int width, int height, CompletionHandler<void(Optional<ExceptionData>&&)>&& completionHandler)
54
{
55
    ASSERT(!m_recorders.contains(identifier));
56
    auto recorder = RemoteMediaRecorder::create(m_gpuConnectionToWebProcess, identifier, recordAudio, width, height);
57
    if (!recorder)
58
        return completionHandler(ExceptionData { NotSupportedError, "Unable to create a recorder with the provided stream"_s });
59
60
    m_recorders.add(identifier, WTFMove(recorder));
61
    completionHandler({ });
62
}
63
64
void RemoteMediaRecorderManager::releaseRecorder(MediaRecorderIdentifier identifier)
65
{
66
    ASSERT(m_recorders.contains(identifier));
67
    m_recorders.remove(identifier);
68
}
69
70
}
71
72
#endif
- a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorderManager.h +72 lines
Line 0 a/Source/WebKit/GPUProcess/webrtc/RemoteMediaRecorderManager.h_sec1
1
2
3
/*
4
 * Copyright (C) 2020 Apple Inc. All rights reserved.
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 * 1. Redistributions of source code must retain the above copyright
10
 *    notice, this list of conditions and the following disclaimer.
11
 * 2. Redistributions in binary form must reproduce the above copyright
12
 *    notice, this list of conditions and the following disclaimer in the
13
 *    documentation and/or other materials provided with the distribution.
14
 *
15
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
16
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
19
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25
 * THE POSSIBILITY OF SUCH DAMAGE.
26
 */
27
28
#pragma once
29
30
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
31
32
#include "MediaRecorderIdentifier.h"
33
#include "MessageReceiver.h"
34
#include <wtf/Forward.h>
35
#include <wtf/HashMap.h>
36
37
namespace IPC {
38
class Connection;
39
class Decoder;
40
}
41
42
namespace WebCore {
43
struct ExceptionData;
44
}
45
46
namespace WebKit {
47
48
class GPUConnectionToWebProcess;
49
class RemoteMediaRecorder;
50
51
class RemoteMediaRecorderManager : private IPC::MessageReceiver {
52
    WTF_MAKE_FAST_ALLOCATED;
53
public:
54
    explicit RemoteMediaRecorderManager(GPUConnectionToWebProcess&);
55
    ~RemoteMediaRecorderManager();
56
57
    void didReceiveRemoteMediaRecorderMessage(IPC::Connection&, IPC::Decoder&);
58
    void didReceiveMessageFromWebProcess(IPC::Connection& connection, IPC::Decoder& decoder) { didReceiveMessage(connection, decoder); }
59
60
private:
61
    // IPC::MessageReceiver
62
    void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final;
63
    void createRecorder(MediaRecorderIdentifier, bool recordAudio, int width, int height, CompletionHandler<void(Optional<WebCore::ExceptionData>&&)>&&);
64
    void releaseRecorder(MediaRecorderIdentifier);
65
66
    GPUConnectionToWebProcess& m_gpuConnectionToWebProcess;
67
    HashMap<MediaRecorderIdentifier, std::unique_ptr<RemoteMediaRecorder>> m_recorders;
68
};
69
70
}
71
72
#endif
- a/Source/WebKit/Scripts/webkit/messages.py +1 lines
Lines 220-225 def types_that_cannot_be_forward_declared(): a/Source/WebKit/Scripts/webkit/messages.py_sec1
220
        'WebKit::ActivityStateChangeID',
220
        'WebKit::ActivityStateChangeID',
221
        'WebKit::LayerHostingContextID',
221
        'WebKit::LayerHostingContextID',
222
        'WebKit::MediaPlayerPrivateRemoteIdentifier',
222
        'WebKit::MediaPlayerPrivateRemoteIdentifier',
223
        'WebKit::MediaRecorderIdentifier',
223
        'WebKit::RemoteMediaResourceIdentifier',
224
        'WebKit::RemoteMediaResourceIdentifier',
224
        'WebKit::RTCDecoderIdentifier',
225
        'WebKit::RTCDecoderIdentifier',
225
        'WebKit::RTCEncoderIdentifier',
226
        'WebKit::RTCEncoderIdentifier',
- a/Source/WebKit/Sources.txt +4 lines
Lines 24-29 a/Source/WebKit/Sources.txt_sec1
24
GPUProcess/GPUProcess.cpp
24
GPUProcess/GPUProcess.cpp
25
GPUProcess/GPUConnectionToWebProcess.cpp
25
GPUProcess/GPUConnectionToWebProcess.cpp
26
GPUProcess/GPUProcessCreationParameters.cpp
26
GPUProcess/GPUProcessCreationParameters.cpp
27
GPUProcess/webrtc/RemoteMediaRecorder.cpp
28
GPUProcess/webrtc/RemoteMediaRecorderManager.cpp
27
GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp
29
GPUProcess/media/RemoteMediaPlayerManagerProxy.cpp
28
GPUProcess/media/RemoteMediaPlayerProxy.cpp
30
GPUProcess/media/RemoteMediaPlayerProxy.cpp
29
GPUProcess/media/RemoteMediaResource.cpp
31
GPUProcess/media/RemoteMediaResource.cpp
Lines 513-518 WebProcess/GPU/media/RemoteMediaPlayerManager.cpp a/Source/WebKit/Sources.txt_sec2
513
WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp @no-unify
515
WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp @no-unify
514
WebProcess/GPU/media/RemoteMediaResourceProxy.cpp
516
WebProcess/GPU/media/RemoteMediaResourceProxy.cpp
515
WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp
517
WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp
518
WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp
519
WebProcess/GPU/webrtc/MediaRecorderProvider.cpp
516
520
517
WebProcess/Network/NetworkProcessConnection.cpp
521
WebProcess/Network/NetworkProcessConnection.cpp
518
WebProcess/Network/WebLoaderStrategy.cpp
522
WebProcess/Network/WebLoaderStrategy.cpp
- a/Source/WebKit/SourcesCocoa.txt +2 lines
Lines 635-639 GPUProcessProxyMessageReceiver.cpp a/Source/WebKit/SourcesCocoa.txt_sec1
635
GPUProcessMessageReceiver.cpp
635
GPUProcessMessageReceiver.cpp
636
LibWebRTCCodecsProxyMessageReceiver.cpp
636
LibWebRTCCodecsProxyMessageReceiver.cpp
637
LibWebRTCCodecsMessageReceiver.cpp
637
LibWebRTCCodecsMessageReceiver.cpp
638
RemoteMediaRecorderMessageReceiver.cpp
639
RemoteMediaRecorderManagerMessageReceiver.cpp
638
ServiceWorkerFetchTaskMessageReceiver.cpp
640
ServiceWorkerFetchTaskMessageReceiver.cpp
639
TextCheckingControllerProxyMessageReceiver.cpp
641
TextCheckingControllerProxyMessageReceiver.cpp
- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +22 lines
Lines 3316-3321 a/Source/WebKit/WebKit.xcodeproj/project.pbxproj_sec1
3316
		4172198C23B612E800AE5686 /* RTCDecoderIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDecoderIdentifier.h; sourceTree = "<group>"; };
3316
		4172198C23B612E800AE5686 /* RTCDecoderIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCDecoderIdentifier.h; sourceTree = "<group>"; };
3317
		4172198D23B62C7C00AE5686 /* LibWebRTCCodecs.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = LibWebRTCCodecs.messages.in; sourceTree = "<group>"; };
3317
		4172198D23B62C7C00AE5686 /* LibWebRTCCodecs.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = LibWebRTCCodecs.messages.in; sourceTree = "<group>"; };
3318
		4176901322FDD41B00B1576D /* NetworkRTCProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkRTCProvider.mm; sourceTree = "<group>"; };
3318
		4176901322FDD41B00B1576D /* NetworkRTCProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkRTCProvider.mm; sourceTree = "<group>"; };
3319
		4176E89223C34D6E003E83FE /* MediaRecorderProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaRecorderProvider.h; sourceTree = "<group>"; };
3320
		4176E89323C34D6F003E83FE /* MediaRecorderProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRecorderProvider.cpp; sourceTree = "<group>"; };
3321
		4176E89423C34E26003E83FE /* MediaRecorderPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaRecorderPrivate.cpp; sourceTree = "<group>"; };
3322
		4176E89523C34E27003E83FE /* MediaRecorderPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRecorderPrivate.h; sourceTree = "<group>"; };
3323
		4176E89723C361BD003E83FE /* MediaRecorderIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaRecorderIdentifier.h; sourceTree = "<group>"; };
3324
		4176E89823C36677003E83FE /* RemoteMediaRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteMediaRecorder.h; sourceTree = "<group>"; };
3325
		4176E89923C36D8E003E83FE /* RemoteMediaRecorderManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteMediaRecorderManager.h; sourceTree = "<group>"; };
3326
		4176E89A23C36F71003E83FE /* RemoteMediaRecorderManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteMediaRecorderManager.cpp; sourceTree = "<group>"; };
3327
		4176E89B23C37222003E83FE /* RemoteMediaRecorderManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RemoteMediaRecorderManager.messages.in; sourceTree = "<group>"; };
3328
		4176E89C23C37479003E83FE /* RemoteMediaRecorder.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RemoteMediaRecorder.messages.in; sourceTree = "<group>"; };
3329
		4176E89D23C376D5003E83FE /* RemoteMediaRecorder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteMediaRecorder.cpp; sourceTree = "<group>"; };
3319
		417915AC2256BB7400D6F97E /* WebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketChannel.cpp; path = Network/WebSocketChannel.cpp; sourceTree = "<group>"; };
3330
		417915AC2256BB7400D6F97E /* WebSocketChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebSocketChannel.cpp; path = Network/WebSocketChannel.cpp; sourceTree = "<group>"; };
3320
		417915AD2256BB7400D6F97E /* WebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketChannel.h; path = Network/WebSocketChannel.h; sourceTree = "<group>"; };
3331
		417915AD2256BB7400D6F97E /* WebSocketChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketChannel.h; path = Network/WebSocketChannel.h; sourceTree = "<group>"; };
3321
		417915B02256C0D600D6F97E /* WebSocketChannelManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketChannelManager.h; path = Network/WebSocketChannelManager.h; sourceTree = "<group>"; };
3332
		417915B02256C0D600D6F97E /* WebSocketChannelManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketChannelManager.h; path = Network/WebSocketChannelManager.h; sourceTree = "<group>"; };
Lines 7117-7122 a/Source/WebKit/WebKit.xcodeproj/project.pbxproj_sec2
7117
				4172198A23B6128200AE5686 /* LibWebRTCCodecs.cpp */,
7128
				4172198A23B6128200AE5686 /* LibWebRTCCodecs.cpp */,
7118
				4172198923B6128200AE5686 /* LibWebRTCCodecs.h */,
7129
				4172198923B6128200AE5686 /* LibWebRTCCodecs.h */,
7119
				4172198D23B62C7C00AE5686 /* LibWebRTCCodecs.messages.in */,
7130
				4172198D23B62C7C00AE5686 /* LibWebRTCCodecs.messages.in */,
7131
				4176E89723C361BD003E83FE /* MediaRecorderIdentifier.h */,
7132
				4176E89423C34E26003E83FE /* MediaRecorderPrivate.cpp */,
7133
				4176E89523C34E27003E83FE /* MediaRecorderPrivate.h */,
7134
				4176E89323C34D6F003E83FE /* MediaRecorderProvider.cpp */,
7135
				4176E89223C34D6E003E83FE /* MediaRecorderProvider.h */,
7120
				4172198C23B612E800AE5686 /* RTCDecoderIdentifier.h */,
7136
				4172198C23B612E800AE5686 /* RTCDecoderIdentifier.h */,
7121
				4158649A23BE092400A0A61E /* RTCEncoderIdentifier.h */,
7137
				4158649A23BE092400A0A61E /* RTCEncoderIdentifier.h */,
7122
			);
7138
			);
Lines 7129-7134 a/Source/WebKit/WebKit.xcodeproj/project.pbxproj_sec3
7129
				41E0A7C623B6397800561060 /* LibWebRTCCodecsProxy.h */,
7145
				41E0A7C623B6397800561060 /* LibWebRTCCodecsProxy.h */,
7130
				41E0A7C723B6397900561060 /* LibWebRTCCodecsProxy.messages.in */,
7146
				41E0A7C723B6397900561060 /* LibWebRTCCodecsProxy.messages.in */,
7131
				41E0A7C823B6397900561060 /* LibWebRTCCodecsProxy.mm */,
7147
				41E0A7C823B6397900561060 /* LibWebRTCCodecsProxy.mm */,
7148
				4176E89D23C376D5003E83FE /* RemoteMediaRecorder.cpp */,
7149
				4176E89823C36677003E83FE /* RemoteMediaRecorder.h */,
7150
				4176E89C23C37479003E83FE /* RemoteMediaRecorder.messages.in */,
7151
				4176E89A23C36F71003E83FE /* RemoteMediaRecorderManager.cpp */,
7152
				4176E89923C36D8E003E83FE /* RemoteMediaRecorderManager.h */,
7153
				4176E89B23C37222003E83FE /* RemoteMediaRecorderManager.messages.in */,
7132
			);
7154
			);
7133
			path = webrtc;
7155
			path = webrtc;
7134
			sourceTree = "<group>";
7156
			sourceTree = "<group>";
- a/Source/WebKit/WebProcess/GPU/media/MediaRecorderProvider.cpp +45 lines
Line 0 a/Source/WebKit/WebProcess/GPU/media/MediaRecorderProvider.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "MediaRecorderProvider.h"
28
29
#if PLATFORM(COCOA)
30
#include "MediaRecorderPrivateAVFImpl.h"
31
#endif
32
33
namespace WebCore {
34
35
std::unique_ptr<MediaRecorderPrivate> MediaRecorderProvider::createMediaRecorderPrivate(MediaStreamPrivate& stream)
36
{
37
#if PLATFORM(COCOA)
38
    return MediaRecorderPrivateAVFImpl::create(stream);
39
#else
40
    UNUSED_PARAM(stream);
41
    return nullptr;
42
#endif
43
}
44
45
}
- a/Source/WebKit/WebProcess/GPU/media/MediaRecorderProvider.h +42 lines
Line 0 a/Source/WebKit/WebProcess/GPU/media/MediaRecorderProvider.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
namespace WebCore {
29
30
class MediaRecorderPrivate;
31
class MediaStreamPrivate;
32
33
class WEBCORE_EXPORT MediaRecorderProvider {
34
    WTF_MAKE_FAST_ALLOCATED;
35
public:
36
    static UniqueRef<MediaRecorderProvider> create() { return makeUniqueRef<MediaRecorderProvider>(); }
37
    virtual ~MediaRecorderProvider() = default;
38
39
    virtual std::unique_ptr<MediaRecorderPrivate> createMediaRecorderPrivate(MediaStreamPrivate&);
40
};
41
42
}
- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderIdentifier.h +35 lines
Line 0 a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderIdentifier.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include <wtf/ObjectIdentifier.h>
29
30
namespace WebKit {
31
32
enum MediaRecorderIdentifierType { };
33
using MediaRecorderIdentifier = ObjectIdentifier<MediaRecorderIdentifierType>;
34
35
} // namespace WebKit
- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp +146 lines
Line 0 a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "MediaRecorderPrivate.h"
28
29
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
30
31
#include "GPUProcessConnection.h"
32
#include "RemoteMediaRecorderManagerMessages.h"
33
#include "RemoteMediaRecorderMessages.h"
34
#include "WebProcess.h"
35
#include <WebCore/CARingBuffer.h>
36
#include <WebCore/MediaStreamPrivate.h>
37
#include <WebCore/MediaStreamTrackPrivate.h>
38
#include <WebCore/RemoteVideoSample.h>
39
#include <WebCore/SharedBuffer.h>
40
#include <WebCore/WebAudioBufferList.h>
41
42
using namespace WebCore;
43
44
namespace WebKit {
45
46
MediaRecorderPrivate::MediaRecorderPrivate(const MediaStreamPrivate& stream)
47
    : m_identifier(MediaRecorderIdentifier::generate())
48
    , m_connection(WebProcess::singleton().ensureGPUProcessConnection().connection())
49
{
50
    // FIXME: we will need to implement support for multiple audio/video tracks
51
    // Currently we only choose the first track as the recorded track.
52
    // FIXME: We would better to throw an exception to JavaScript if writer creation fails.
53
54
    const MediaStreamTrackPrivate* audioTrack { nullptr };
55
    const MediaStreamTrackPrivate* videoTrack { nullptr };
56
    for (auto& track : stream.tracks()) {
57
        if (!track->enabled() || track->ended())
58
            continue;
59
        switch (track->type()) {
60
        case RealtimeMediaSource::Type::Video: {
61
            auto& settings = track->settings();
62
            if (!videoTrack && settings.supportsWidth() && settings.supportsHeight()) {
63
                videoTrack = track.get();
64
                m_recordedVideoTrackID = videoTrack->id();
65
            }
66
            break;
67
        }
68
        case RealtimeMediaSource::Type::Audio:
69
            if (!audioTrack) {
70
                m_ringBuffer = makeUnique<CARingBuffer>(makeUniqueRef<SharedRingBufferStorage>(this));
71
                audioTrack = track.get();
72
                m_recordedAudioTrackID = audioTrack->id();
73
            }
74
            break;
75
        case RealtimeMediaSource::Type::None:
76
            break;
77
        }
78
    }
79
    m_connection->sendWithAsyncReply(Messages::RemoteMediaRecorderManager::CreateRecorder { m_identifier, !!audioTrack, videoTrack ? videoTrack->settings().width() : 0, videoTrack ? videoTrack->settings().height() : 0 }, [this, weakThis = makeWeakPtr(this)](auto&& exception) {
80
        if (!weakThis || !exception)
81
            return;
82
        m_errorCallback(Exception { exception->code, WTFMove(exception->message) });
83
    }, 0);
84
}
85
86
MediaRecorderPrivate::~MediaRecorderPrivate()
87
{
88
    m_connection->send(Messages::RemoteMediaRecorderManager::ReleaseRecorder { m_identifier }, 0);
89
}
90
91
void MediaRecorderPrivate::sampleBufferUpdated(const WebCore::MediaStreamTrackPrivate& track, WebCore::MediaSample& sample)
92
{
93
    if (track.id() != m_recordedVideoTrackID)
94
        return;
95
    if (auto remoteSample = RemoteVideoSample::create(sample))
96
        m_connection->send(Messages::RemoteMediaRecorder::VideoSampleAvailable { WTFMove(*remoteSample) }, m_identifier);
97
}
98
99
void MediaRecorderPrivate::audioSamplesAvailable(const WebCore::MediaStreamTrackPrivate& track, const MediaTime& time, const PlatformAudioData& audioData, const AudioStreamDescription& description, size_t numberOfFrames)
100
{
101
    if (track.id() != m_recordedAudioTrackID)
102
        return;
103
104
    if (m_description != description) {
105
        ASSERT(description.platformDescription().type == PlatformDescription::CAAudioStreamBasicType);
106
        m_description = *WTF::get<const AudioStreamBasicDescription*>(description.platformDescription().description);
107
108
        // Allocate a ring buffer large enough to contain 2 seconds of audio.
109
        m_numberOfFrames = m_description.sampleRate() * 2;
110
        m_ringBuffer->allocate(m_description.streamDescription(), m_numberOfFrames);
111
    }
112
113
    ASSERT(is<WebAudioBufferList>(audioData));
114
    m_ringBuffer->store(downcast<WebAudioBufferList>(audioData).list(), numberOfFrames, time.timeValue());
115
    uint64_t startFrame;
116
    uint64_t endFrame;
117
    m_ringBuffer->getCurrentFrameBounds(startFrame, endFrame);
118
    m_connection->send(Messages::RemoteMediaRecorder::AudioSamplesAvailable { time, numberOfFrames, startFrame, endFrame }, m_identifier);
119
}
120
121
void MediaRecorderPrivate::storageChanged(SharedMemory* storage)
122
{
123
    SharedMemory::Handle handle;
124
    if (storage)
125
        storage->createHandle(handle, SharedMemory::Protection::ReadOnly);
126
    m_connection->send(Messages::RemoteMediaRecorder::AudioSamplesStorageChanged { handle, m_description, static_cast<uint64_t>(m_numberOfFrames) }, m_identifier);
127
}
128
129
void MediaRecorderPrivate::fetchData(CompletionHandler<void(RefPtr<WebCore::SharedBuffer>&&, const String& mimeType)>&& completionHandler)
130
{
131
    m_connection->sendWithAsyncReply(Messages::RemoteMediaRecorder::FetchData { }, [completionHandler = WTFMove(completionHandler)](auto&& data, auto&& mimeType) mutable {
132
        RefPtr<SharedBuffer> buffer;
133
        if (data.size())
134
            buffer = SharedBuffer::create(data.data(), data.size());
135
        completionHandler(WTFMove(buffer), mimeType);
136
    }, m_identifier);
137
}
138
139
void MediaRecorderPrivate::stopRecording()
140
{
141
    m_connection->send(Messages::RemoteMediaRecorder::StopRecording { }, m_identifier);
142
}
143
144
}
145
146
#endif // PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h +76 lines
Line 0 a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#if PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
29
30
#include "MediaRecorderIdentifier.h"
31
#include "SharedRingBufferStorage.h"
32
#include <WebCore/MediaRecorderPrivate.h>
33
#include <wtf/MediaTime.h>
34
#include <wtf/WeakPtr.h>
35
36
namespace IPC {
37
class Connection;
38
}
39
40
namespace WebCore {
41
class MediaStreamPrivate;
42
}
43
44
namespace WebKit {
45
46
class MediaRecorderPrivate final : public WebCore::MediaRecorderPrivate, public SharedRingBufferStorage::Client, public CanMakeWeakPtr<MediaRecorderPrivate> {
47
    WTF_MAKE_FAST_ALLOCATED;
48
public:
49
    explicit MediaRecorderPrivate(const WebCore::MediaStreamPrivate&);
50
    ~MediaRecorderPrivate();
51
52
private:
53
    // WebCore::MediaRecorderPrivate
54
    void sampleBufferUpdated(const WebCore::MediaStreamTrackPrivate&, WebCore::MediaSample&) final;
55
    void audioSamplesAvailable(const WebCore::MediaStreamTrackPrivate&, const WTF::MediaTime&, const WebCore::PlatformAudioData&, const WebCore::AudioStreamDescription&, size_t) final;
56
    void fetchData(CompletionHandler<void(RefPtr<WebCore::SharedBuffer>&&, const String& mimeType)>&&) final;
57
    void stopRecording() final;
58
59
    // SharedRingBufferStorage::Client
60
    void storageChanged(SharedMemory*);
61
62
    MediaRecorderIdentifier m_identifier;
63
64
    Ref<IPC::Connection> m_connection;
65
    String m_recordedAudioTrackID;
66
    String m_recordedVideoTrackID;
67
68
    std::unique_ptr<WebCore::CARingBuffer> m_ringBuffer;
69
    WebCore::CAAudioStreamDescription m_description { };
70
    int64_t m_numberOfFrames { 0 };
71
};
72
73
}
74
75
#endif // PLATFORM(COCOA) && ENABLE(GPU_PROCESS)
76
- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.cpp +50 lines
Line 0 a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.cpp_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "MediaRecorderProvider.h"
28
29
#include "MediaRecorderPrivate.h"
30
#include <WebCore/MediaRecorderPrivate.h>
31
32
using namespace WebCore;
33
34
namespace WebKit {
35
36
#if ENABLE(MEDIA_STREAM)
37
std::unique_ptr<WebCore::MediaRecorderPrivate> MediaRecorderProvider::createMediaRecorderPrivate(const MediaStreamPrivate& stream)
38
{
39
#if ENABLE(GPU_PROCESS)
40
    if (!m_useGPUProcess)
41
        return WebCore::MediaRecorderProvider::createMediaRecorderPrivate(stream);
42
43
    return makeUnique<MediaRecorderPrivate>(stream);
44
#else
45
    return WebCore::MediaRecorderProvider::createMediaRecorderPrivate(stream);
46
#endif // ENABLE(GPU_PROCESS)
47
}
48
#endif // ENABLE(MEDIA_STREAM)
49
50
}
- a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.h +42 lines
Line 0 a/Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderProvider.h_sec1
1
/*
2
 * Copyright (C) 2020 Apple Inc. 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. AND ITS CONTRIBUTORS ``AS IS''
14
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23
 * THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#pragma once
27
28
#include <WebCore/MediaRecorderProvider.h>
29
30
namespace WebKit {
31
32
class MediaRecorderProvider final : public WebCore::MediaRecorderProvider {
33
public:
34
    MediaRecorderProvider() = default;
35
36
private:
37
#if ENABLE(MEDIA_STREAM)
38
    std::unique_ptr<WebCore::MediaRecorderPrivate> createMediaRecorderPrivate(const WebCore::MediaStreamPrivate&) final;
39
#endif
40
};
41
42
}
- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp -1 / +3 lines
Lines 45-50 a/Source/WebKit/WebProcess/WebPage/WebPage.cpp_sec1
45
#include "LibWebRTCProvider.h"
45
#include "LibWebRTCProvider.h"
46
#include "LoadParameters.h"
46
#include "LoadParameters.h"
47
#include "Logging.h"
47
#include "Logging.h"
48
#include "MediaRecorderProvider.h"
48
#include "NetscapePlugin.h"
49
#include "NetscapePlugin.h"
49
#include "NetworkConnectionToWebProcessMessages.h"
50
#include "NetworkConnectionToWebProcessMessages.h"
50
#include "NetworkProcessConnection.h"
51
#include "NetworkProcessConnection.h"
Lines 460-466 WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) a/Source/WebKit/WebProcess/WebPage/WebPage.cpp_sec2
460
        WebProcess::singleton().cacheStorageProvider(),
461
        WebProcess::singleton().cacheStorageProvider(),
461
        WebBackForwardListProxy::create(*this),
462
        WebBackForwardListProxy::create(*this),
462
        WebCookieJar::create(),
463
        WebCookieJar::create(),
463
        makeUniqueRef<WebProgressTrackerClient>(*this)
464
        makeUniqueRef<WebProgressTrackerClient>(*this),
465
        makeUniqueRef<MediaRecorderProvider>()
464
    );
466
    );
465
    pageConfiguration.chromeClient = new WebChromeClient(*this);
467
    pageConfiguration.chromeClient = new WebChromeClient(*this);
466
#if ENABLE(CONTEXT_MENUS)
468
#if ENABLE(CONTEXT_MENUS)
- a/Source/WebKitLegacy/mac/WebView/WebView.mm -2 / +5 lines
Lines 180-185 a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec1
180
#import <WebCore/LocalizedStrings.h>
180
#import <WebCore/LocalizedStrings.h>
181
#import <WebCore/LogInitialization.h>
181
#import <WebCore/LogInitialization.h>
182
#import <WebCore/MIMETypeRegistry.h>
182
#import <WebCore/MIMETypeRegistry.h>
183
#import <WebCore/MediaRecorderProvider.h>
183
#import <WebCore/MemoryCache.h>
184
#import <WebCore/MemoryCache.h>
184
#import <WebCore/MemoryRelease.h>
185
#import <WebCore/MemoryRelease.h>
185
#import <WebCore/NetworkStorageSession.h>
186
#import <WebCore/NetworkStorageSession.h>
Lines 1448-1454 static void WebKitInitializeGamepadProviderIfNecessary() a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec2
1448
        WebCore::CacheStorageProvider::create(),
1449
        WebCore::CacheStorageProvider::create(),
1449
        BackForwardList::create(self),
1450
        BackForwardList::create(self),
1450
        WebCore::CookieJar::create(storageProvider.copyRef()),
1451
        WebCore::CookieJar::create(storageProvider.copyRef()),
1451
        makeUniqueRef<WebProgressTrackerClient>(self)
1452
        makeUniqueRef<WebProgressTrackerClient>(self),
1453
        makeUniqueRef<WebCore::MediaRecorderProvider>()
1452
    );
1454
    );
1453
#if !PLATFORM(IOS_FAMILY)
1455
#if !PLATFORM(IOS_FAMILY)
1454
    pageConfiguration.chromeClient = new WebChromeClient(self);
1456
    pageConfiguration.chromeClient = new WebChromeClient(self);
Lines 1717-1723 static void WebKitInitializeGamepadProviderIfNecessary() a/Source/WebKitLegacy/mac/WebView/WebView.mm_sec3
1717
        WebCore::CacheStorageProvider::create(),
1719
        WebCore::CacheStorageProvider::create(),
1718
        BackForwardList::create(self),
1720
        BackForwardList::create(self),
1719
        WebCore::CookieJar::create(storageProvider.copyRef()),
1721
        WebCore::CookieJar::create(storageProvider.copyRef()),
1720
        makeUniqueRef<WebProgressTrackerClient>(self)
1722
        makeUniqueRef<WebProgressTrackerClient>(self),
1723
        makeUniqueRef<WebCore::MediaRecorderProvider>()
1721
    );
1724
    );
1722
    pageConfiguration.chromeClient = new WebChromeClientIOS(self);
1725
    pageConfiguration.chromeClient = new WebChromeClientIOS(self);
1723
#if ENABLE(DRAG_SUPPORT)
1726
#if ENABLE(DRAG_SUPPORT)
- a/Source/WebKitLegacy/win/WebView.cpp -2 / +4 lines
Lines 129-134 a/Source/WebKitLegacy/win/WebView.cpp_sec1
129
#include <WebCore/LogInitialization.h>
129
#include <WebCore/LogInitialization.h>
130
#include <WebCore/Logging.h>
130
#include <WebCore/Logging.h>
131
#include <WebCore/MIMETypeRegistry.h>
131
#include <WebCore/MIMETypeRegistry.h>
132
#include <WebCore/MediaRecorderProvider.h>
132
#include <WebCore/MemoryCache.h>
133
#include <WebCore/MemoryCache.h>
133
#include <WebCore/MemoryRelease.h>
134
#include <WebCore/MemoryRelease.h>
134
#include <WebCore/NetworkStorageSession.h>
135
#include <WebCore/NetworkStorageSession.h>
Lines 3118-3127 HRESULT WebView::initWithFrame(RECT frame, _In_ BSTR frameName, _In_ BSTR groupN a/Source/WebKitLegacy/win/WebView.cpp_sec2
3118
        makeUniqueRef<WebEditorClient>(this),
3119
        makeUniqueRef<WebEditorClient>(this),
3119
        SocketProvider::create(),
3120
        SocketProvider::create(),
3120
        makeUniqueRef<LibWebRTCProvider>(),
3121
        makeUniqueRef<LibWebRTCProvider>(),
3121
        WebCore::CacheStorageProvider::create(),
3122
        CacheStorageProvider::create(),
3122
        BackForwardList::create(),
3123
        BackForwardList::create(),
3123
        CookieJar::create(storageProvider.copyRef()),
3124
        CookieJar::create(storageProvider.copyRef()),
3124
        makeUniqueRef<WebProgressTrackerClient>()
3125
        makeUniqueRef<WebProgressTrackerClient>(),
3126
        makeUniqueRef<MediaRecorderProvider>()
3125
    );
3127
    );
3126
    configuration.chromeClient = new WebChromeClient(this);
3128
    configuration.chromeClient = new WebChromeClient(this);
3127
    configuration.contextMenuClient = new WebContextMenuClient(this);
3129
    configuration.contextMenuClient = new WebContextMenuClient(this);
- a/LayoutTests/ChangeLog +10 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2020-01-07  youenn fablet  <youenn@apple.com>
2
3
        Implement MediaRecorder backend in GPUProcess
4
        https://bugs.webkit.org/show_bug.cgi?id=205802
5
6
        Reviewed by Eric Carlson.
7
8
        * http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html:
9
        Do not use GPUProcess for this test until canvas buffers are IOSurfaces.
10
1
2020-01-06  Fujii Hironori  <Hironori.Fujii@sony.com>
11
2020-01-06  Fujii Hironori  <Hironori.Fujii@sony.com>
2
12
3
        ComplexTextController::offsetForPosition returns a wrong offset for a glyph boundary in a RTL text
13
        ComplexTextController::offsetForPosition returns a wrong offset for a glyph boundary in a RTL text
- a/LayoutTests/http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html -1 / +5 lines
Lines 20-25 a/LayoutTests/http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html_sec1
20
    </canvas>
20
    </canvas>
21
</div>
21
</div>
22
<script>
22
<script>
23
    // This test is not passing with GPUProcess as long as capture frames are not IOSurfaced backed.
24
    if (window.internals)
25
        window.internals.setUseGPUProcessForWebRTC(false);
26
23
    var context;
27
    var context;
24
    var drawStartTime;
28
    var drawStartTime;
25
29
Lines 111-114 a/LayoutTests/http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html_sec2
111
115
112
</script>
116
</script>
113
</body>
117
</body>
114
</html>
118
</html>

Return to Bug 205802