Support in-band VTT captions when loading media in the GPU Process
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2020 21:37:58 +0000 (21:37 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Feb 2020 21:37:58 +0000 (21:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=207467
<rdar://problem/59312749>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, existing tests enabled in GPU process.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::nextAudioNodeLogIdentifier):
(WebCore::AudioContext::nextAudioParameterLogIdentifier):
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
(WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack):
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::AudioTrack):
(WebCore::AudioTrack::willRemove):
(WebCore::AudioTrack::setMediaElement):
(WebCore::AudioTrack::setLogger):
* html/track/AudioTrack.h:
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::parseWebVTTCueData):
* html/track/InbandGenericTextTrack.h:
* html/track/InbandTextTrack.cpp:
(WebCore::InbandTextTrack::create):
(WebCore::InbandTextTrack::InbandTextTrack):
(WebCore::toPrivate):
(WebCore::InbandTextTrack::updateKindFromPrivate):
(WebCore::InbandTextTrack::setLogger):
* html/track/InbandTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::parseWebVTTCueData):
* html/track/InbandWebVTTTextTrack.h:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setKind):
(WebCore::TextTrack::setMode):
(WebCore::TextTrack::removeAllCues):
(WebCore::TextTrack::addCue):
* html/track/TextTrack.h:
(WTF::LogArgument<WebCore::TextTrack::Kind>::toString):
(WTF::LogArgument<WebCore::TextTrack::Mode>::toString):
* html/track/TrackBase.cpp:
(WebCore::TrackBase::TrackBase):
(WebCore::TrackBase::setMediaElement):
(WebCore::TrackBase::setLogger):
(WebCore::nextLogIdentifier): Deleted.
* html/track/TrackBase.h:
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::setMediaElement):
(WebCore::VideoTrack::setLogger):
* html/track/VideoTrack.h:
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::kind const):
(WebCore::InbandTextTrackPrivate::cueFormat const):
(WebCore::InbandTextTrackPrivate::InbandTextTrackPrivate):
* platform/graphics/InbandTextTrackPrivateClient.h:
* platform/graphics/MediaPlayerEnums.h:
* platform/graphics/TrackPrivateBase.cpp:
(WebCore::TrackPrivateBase::setLogger):
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
(WebCore::InbandTextTrackPrivateAVFObjC::kind const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
(WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
(WebCore::OutOfBandTextTrackPrivateAVF::OutOfBandTextTrackPrivateAVF):
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::ISOWebVTTCue):
* platform/graphics/iso/ISOVTTCue.h:
* platform/mock/mediasource/MockTracks.h:
(WebCore::MockTextTrackPrivate::MockTextTrackPrivate):

Source/WebKit:

* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* GPUProcess/media/RemoteAudioTrackProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack):
(WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack):
(WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged):
(WebKit::RemoteMediaPlayerProxy::textTrackSetMode):
* GPUProcess/media/RemoteMediaPlayerProxy.h:
* GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* GPUProcess/media/RemoteTextTrackProxy.cpp: Added.
(WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
(WebKit::RemoteTextTrackProxy::configuration):
(WebKit::RemoteTextTrackProxy::configurationChanged):
(WebKit::RemoteTextTrackProxy::willRemove):
(WebKit::RemoteTextTrackProxy::idChanged):
(WebKit::RemoteTextTrackProxy::labelChanged):
(WebKit::RemoteTextTrackProxy::languageChanged):
(WebKit::RemoteTextTrackProxy::addDataCue):
(WebKit::RemoteTextTrackProxy::updateDataCue):
(WebKit::RemoteTextTrackProxy::removeDataCue):
(WebKit::RemoteTextTrackProxy::addGenericCue):
(WebKit::RemoteTextTrackProxy::updateGenericCue):
(WebKit::RemoteTextTrackProxy::removeGenericCue):
(WebKit::RemoteTextTrackProxy::parseWebVTTFileHeader):
(WebKit::RemoteTextTrackProxy::parseWebVTTCueData):
* GPUProcess/media/RemoteTextTrackProxy.h: Copied from Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.h.
* GPUProcess/media/RemoteVideoTrackProxy.h:
* GPUProcess/media/TextTrackPrivateRemoteConfiguration.h: Added.
(WebKit::TextTrackPrivateRemoteConfiguration::encode const):
(WebKit::TextTrackPrivateRemoteConfiguration::decode):
* GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
* GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
(WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
* GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
* Scripts/webkit/messages.py:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::removeRemoteAudioTrack):
(WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged):
(WebKit::MediaPlayerPrivateRemote::addRemoteTextTrack):
(WebKit::MediaPlayerPrivateRemote::removeRemoteTextTrack):
(WebKit::MediaPlayerPrivateRemote::remoteTextTrackConfigurationChanged):
(WebKit::MediaPlayerPrivateRemote::parseWebVTTFileHeader):
(WebKit::MediaPlayerPrivateRemote::parseWebVTTCueData):
(WebKit::MediaPlayerPrivateRemote::parseWebVTTCueDataStruct):
* WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
* WebProcess/GPU/media/TextTrackPrivateRemote.cpp: Added.
(WebKit::TextTrackPrivateRemote::TextTrackPrivateRemote):
(WebKit::TextTrackPrivateRemote::setMode):
(WebKit::TextTrackPrivateRemote::updateConfiguration):
(WebKit::TextTrackPrivateRemote::addDataCue):
(WebKit::TextTrackPrivateRemote::updateDataCue):
(WebKit::TextTrackPrivateRemote::removeDataCue):
(WebKit::TextTrackPrivateRemote::addGenericCue):
(WebKit::TextTrackPrivateRemote::updateGenericCue):
(WebKit::TextTrackPrivateRemote::removeGenericCue):
(WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader):
(WebKit::TextTrackPrivateRemote::parseWebVTTCueData):
(WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct):
* WebProcess/GPU/media/TextTrackPrivateRemote.h: Added.
* WebProcess/GPU/media/TextTrackPrivateRemote.messages.in: Added.

Source/WTF:

* wtf/LoggerHelper.h:
(WTF::LoggerHelper::childLogIdentifier const):

LayoutTests:

* gpu-process/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

66 files changed:
LayoutTests/ChangeLog
LayoutTests/gpu-process/TestExpectations
Source/WTF/ChangeLog
Source/WTF/wtf/LoggerHelper.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/webaudio/AudioContext.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/track/AudioTrack.cpp
Source/WebCore/html/track/AudioTrack.h
Source/WebCore/html/track/InbandGenericTextTrack.cpp
Source/WebCore/html/track/InbandGenericTextTrack.h
Source/WebCore/html/track/InbandTextTrack.cpp
Source/WebCore/html/track/InbandTextTrack.h
Source/WebCore/html/track/InbandWebVTTTextTrack.cpp
Source/WebCore/html/track/InbandWebVTTTextTrack.h
Source/WebCore/html/track/TextTrack.cpp
Source/WebCore/html/track/TextTrack.h
Source/WebCore/html/track/TrackBase.cpp
Source/WebCore/html/track/TrackBase.h
Source/WebCore/html/track/VideoTrack.cpp
Source/WebCore/html/track/VideoTrack.h
Source/WebCore/platform/graphics/InbandTextTrackPrivate.h
Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h
Source/WebCore/platform/graphics/MediaPlayerEnums.h
Source/WebCore/platform/graphics/TrackPrivateBase.cpp
Source/WebCore/platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h
Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/iso/ISOVTTCue.cpp
Source/WebCore/platform/graphics/iso/ISOVTTCue.h
Source/WebCore/platform/mock/mediasource/MockTracks.h
Source/WebKit/ChangeLog
Source/WebKit/DerivedSources-input.xcfilelist
Source/WebKit/DerivedSources-output.xcfilelist
Source/WebKit/DerivedSources.make
Source/WebKit/GPUProcess/media/RemoteAudioTrackProxy.h
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp [new file with mode: 0644]
Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h [new file with mode: 0644]
Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.h
Source/WebKit/GPUProcess/media/TextTrackPrivateRemoteConfiguration.h [new file with mode: 0644]
Source/WebKit/GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h
Source/WebKit/GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp
Source/WebKit/GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Sources.txt
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp [new file with mode: 0644]
Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h [new file with mode: 0644]
Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.messages.in [new file with mode: 0644]

index 0c3f604..654954f 100644 (file)
@@ -1,5 +1,15 @@
 2020-02-11  Eric Carlson  <eric.carlson@apple.com>
 
+        Support in-band VTT captions when loading media in the GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=207467
+        <rdar://problem/59312749>
+
+        Reviewed by Jer Noble.
+
+        * gpu-process/TestExpectations:
+
+2020-02-11  Eric Carlson  <eric.carlson@apple.com>
+
         video.currentTime is not being updated in iOS 13.4 Beta
         https://bugs.webkit.org/show_bug.cgi?id=207489
         <rdar://problem/59322640>
index 001faee..b2402b9 100644 (file)
@@ -220,12 +220,16 @@ media/restricted-audio-playback-with-multiple-settimeouts.html [ Pass ]
 media/video-controls-visible-audio-only.html [ Pass ]
 media/video-play-audio-require-user-gesture.html [ Pass ]
 media/track/audio-track.html [ Pass ]
-media/audio-track-add-remove.html [ Pass ]
 media/track/video-track-add-remove.html [ Pass ]
 media/track/video-track-alternate-groups.html [ Pass ]
 media/track/video-track-addition-and-frame-removal.html [ Pass ]
 media/track/video-track.html [ Pass ]
 
+media/track/track-in-band.html [ Pass ]
+http/tests/media/track/track-webvtt-slow-loading.html [ Pass ]
+http/tests/media/track/track-webvtt-slow-loading-2.html [ Pass ]
+http/tests/media/hls/hls-webvtt-tracks.html [ Pass ]
+
 accessibility/media-element.html [ Skip ]
 fast/block/float/list-marker-is-float-crash.html [ Skip ]
 fast/css/relative-position-replaced-in-table-display-crash.html [ Skip ]
index 910f378..2d120ae 100644 (file)
@@ -1,3 +1,14 @@
+2020-02-11  Eric Carlson  <eric.carlson@apple.com>
+
+        Support in-band VTT captions when loading media in the GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=207467
+        <rdar://problem/59312749>
+
+        Reviewed by Jer Noble.
+
+        * wtf/LoggerHelper.h:
+        (WTF::LoggerHelper::childLogIdentifier const):
+
 2020-02-10  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Unreviewed, speculative build fix on watchOS simulator
index 402c340..0d4c292 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -56,11 +56,11 @@ public:
 #define INFO_LOG_IF(condition, ...)       if (condition) logger().info(logChannel(), __VA_ARGS__)
 #define DEBUG_LOG_IF(condition, ...)      if (condition) logger().debug(logChannel(), __VA_ARGS__)
 
-    const void* childLogIdentifier(uint64_t identifier) const
+    const void* childLogIdentifier(const void* parentIdentifier, uint64_t childIdentifier) const
     {
         static constexpr uint64_t parentMask = 0xffffffffffff0000ull;
         static constexpr uint64_t maskLowerWord = 0xffffull;
-        return reinterpret_cast<const void*>((reinterpret_cast<uint64_t>(logIdentifier()) & parentMask) | (identifier & maskLowerWord));
+        return reinterpret_cast<const void*>((reinterpret_cast<uint64_t>(parentIdentifier) & parentMask) | (childIdentifier & maskLowerWord));
     }
 
     static const void* uniqueLogIdentifier()
index 1b96186..6d74d40 100644 (file)
@@ -1,3 +1,90 @@
+2020-02-11  Eric Carlson  <eric.carlson@apple.com>
+
+        Support in-band VTT captions when loading media in the GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=207467
+        <rdar://problem/59312749>
+
+        Reviewed by Jer Noble.
+
+        No new tests, existing tests enabled in GPU process.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
+        * Modules/webaudio/AudioContext.h:
+        (WebCore::AudioContext::nextAudioNodeLogIdentifier):
+        (WebCore::AudioContext::nextAudioParameterLogIdentifier):
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
+        (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack):
+        * html/track/AudioTrack.cpp:
+        (WebCore::AudioTrack::AudioTrack):
+        (WebCore::AudioTrack::willRemove):
+        (WebCore::AudioTrack::setMediaElement):
+        (WebCore::AudioTrack::setLogger):
+        * html/track/AudioTrack.h:
+        * html/track/InbandGenericTextTrack.cpp:
+        (WebCore::InbandGenericTextTrack::parseWebVTTCueData):
+        * html/track/InbandGenericTextTrack.h:
+        * html/track/InbandTextTrack.cpp:
+        (WebCore::InbandTextTrack::create):
+        (WebCore::InbandTextTrack::InbandTextTrack):
+        (WebCore::toPrivate):
+        (WebCore::InbandTextTrack::updateKindFromPrivate):
+        (WebCore::InbandTextTrack::setLogger):
+        * html/track/InbandTextTrack.h:
+        * html/track/InbandWebVTTTextTrack.cpp:
+        (WebCore::InbandWebVTTTextTrack::parseWebVTTCueData):
+        * html/track/InbandWebVTTTextTrack.h:
+        * html/track/TextTrack.cpp:
+        (WebCore::TextTrack::setKind):
+        (WebCore::TextTrack::setMode):
+        (WebCore::TextTrack::removeAllCues):
+        (WebCore::TextTrack::addCue):
+        * html/track/TextTrack.h:
+        (WTF::LogArgument<WebCore::TextTrack::Kind>::toString):
+        (WTF::LogArgument<WebCore::TextTrack::Mode>::toString):
+        * html/track/TrackBase.cpp:
+        (WebCore::TrackBase::TrackBase):
+        (WebCore::TrackBase::setMediaElement):
+        (WebCore::TrackBase::setLogger):
+        (WebCore::nextLogIdentifier): Deleted.
+        * html/track/TrackBase.h:
+        * html/track/VideoTrack.cpp:
+        (WebCore::VideoTrack::VideoTrack):
+        (WebCore::VideoTrack::setMediaElement):
+        (WebCore::VideoTrack::setLogger):
+        * html/track/VideoTrack.h:
+        * platform/graphics/InbandTextTrackPrivate.h:
+        (WebCore::InbandTextTrackPrivate::kind const):
+        (WebCore::InbandTextTrackPrivate::cueFormat const):
+        (WebCore::InbandTextTrackPrivate::InbandTextTrackPrivate):
+        * platform/graphics/InbandTextTrackPrivateClient.h:
+        * platform/graphics/MediaPlayerEnums.h:
+        * platform/graphics/TrackPrivateBase.cpp:
+        (WebCore::TrackPrivateBase::setLogger):
+        * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
+        (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
+        * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+        (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks):
+        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
+        (WebCore::InbandTextTrackPrivateAVFObjC::kind const):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack):
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
+        (WebCore::OutOfBandTextTrackPrivateAVF::OutOfBandTextTrackPrivateAVF):
+        * platform/graphics/iso/ISOVTTCue.cpp:
+        (WebCore::ISOWebVTTCue::ISOWebVTTCue):
+        * platform/graphics/iso/ISOVTTCue.h:
+        * platform/mock/mediasource/MockTracks.h:
+        (WebCore::MockTextTrackPrivate::MockTextTrackPrivate):
+
 2020-02-11  Andres Gonzalez  <andresg_22@apple.com>
 
         Fix for crashes in WebAccessibilityObjectWrapper after notification updates in IsolatedTree mode.
index b7698b6..73cd043 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2013 Google Inc. All rights reserved.
- * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -1251,7 +1251,7 @@ void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(const Init
 
             // 5.4.2 If the mode property on new text track equals "showing" or "hidden", then set active
             // track flag to true.
-            if (textTrackPrivate.mode() != InbandTextTrackPrivate::Disabled)
+            if (textTrackPrivate.mode() != InbandTextTrackPrivate::Mode::Disabled)
                 activeTrackFlag = true;
 
             // 5.4.3 Add new text track to the textTracks attribute on this SourceBuffer object.
index 35946b5..e3df010 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Google Inc. All rights reserved.
- * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -282,8 +282,8 @@ public:
     const Logger& logger() const final { return m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     WTFLogChannel& logChannel() const final;
-    const void* nextAudioNodeLogIdentifier() { return childLogIdentifier(++m_nextAudioNodeIdentifier); }
-    const void* nextAudioParameterLogIdentifier() { return childLogIdentifier(++m_nextAudioParameterIdentifier); }
+    const void* nextAudioNodeLogIdentifier() { return childLogIdentifier(m_logIdentifier, ++m_nextAudioNodeIdentifier); }
+    const void* nextAudioParameterLogIdentifier() { return childLogIdentifier(m_logIdentifier, ++m_nextAudioParameterIdentifier); }
 #endif
 
     void postTask(WTF::Function<void()>&&);
index 56f1218..b4794b7 100644 (file)
                07C1C0E21BFB600100BD2256 /* MediaTrackSupportedConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C1C0E01BFB600100BD2256 /* MediaTrackSupportedConstraints.h */; };
                07C1C0E51BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C1C0E41BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
                07CE77D516712A6A00C55A47 /* InbandTextTrackPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               07D12F5C23DE543F0080997D /* ISOVTTCue.h in Headers */ = {isa = PBXBuildFile; fileRef = CD871C651FB52B6700F0B965 /* ISOVTTCue.h */; settings = {ATTRIBUTES = (Private, ); }; };
                07D60928214C5BFD00E7396C /* WindowDisplayCaptureSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D60926214C5BFC00E7396C /* WindowDisplayCaptureSourceMac.h */; };
                07D637401BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D6373E1BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h */; settings = {ATTRIBUTES = (Private, ); }; };
                07D6A4F41BED5F8800174146 /* MockRealtimeAudioSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07D6A4F21BED5F8800174146 /* MockRealtimeAudioSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
                                CD5FF49A2162E4A6004BD86F /* ISOSchemeInformationBox.h in Headers */,
                                CD5FF49B2162E4B7004BD86F /* ISOSchemeTypeBox.h in Headers */,
                                CD5FF4972162E2B7004BD86F /* ISOTrackEncryptionBox.h in Headers */,
+                               07D12F5C23DE543F0080997D /* ISOVTTCue.h in Headers */,
                                71247E381FEA5F86008C08CE /* IterationCompositeOperation.h in Headers */,
                                7C30D9841F815AEC00268356 /* JSAbortController.h in Headers */,
                                7C30D9861F815AEC00268356 /* JSAbortSignal.h in Headers */,
index da14277..a73bc0b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -4068,11 +4068,18 @@ void HTMLMediaElement::closeCaptionTracksChanged()
 
 void HTMLMediaElement::addAudioTrack(Ref<AudioTrack>&& track)
 {
+#if !RELEASE_LOG_DISABLED
+    track->setLogger(logger(), logIdentifier());
+#endif
     ensureAudioTracks().append(WTFMove(track));
 }
 
 void HTMLMediaElement::addTextTrack(Ref<TextTrack>&& track)
 {
+#if !RELEASE_LOG_DISABLED
+    track->setLogger(logger(), logIdentifier());
+#endif
+
     if (!m_requireCaptionPreferencesChangedCallbacks) {
         m_requireCaptionPreferencesChangedCallbacks = true;
         Document& document = this->document();
@@ -4088,6 +4095,9 @@ void HTMLMediaElement::addTextTrack(Ref<TextTrack>&& track)
 
 void HTMLMediaElement::addVideoTrack(Ref<VideoTrack>&& track)
 {
+#if !RELEASE_LOG_DISABLED
+    track->setLogger(logger(), logIdentifier());
+#endif
     ensureVideoTracks().append(WTFMove(track));
 }
 
@@ -4150,6 +4160,9 @@ ExceptionOr<TextTrack&> HTMLMediaElement::addTextTrack(const String& kind, const
     // track label to label, its text track language to language...
     auto track = TextTrack::create(ActiveDOMObject::scriptExecutionContext(), this, kind, emptyString(), label, language);
     auto& trackReference = track.get();
+#if !RELEASE_LOG_DISABLED
+    trackReference.setLogger(logger(), logIdentifier());
+#endif
 
     // Note, due to side effects when changing track parameters, we have to
     // first append the track to the text track list.
index b04620a..0209f9e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -82,9 +82,6 @@ AudioTrack::AudioTrack(AudioTrackClient& client, AudioTrackPrivate& trackPrivate
     , m_enabled(trackPrivate.enabled())
 {
     m_private->setClient(this);
-#if !RELEASE_LOG_DISABLED
-    m_private->setLogger(logger(), logIdentifier());
-#endif
     updateKindFromPrivate();
 }
 
@@ -163,6 +160,7 @@ void AudioTrack::willRemove()
     auto element = makeRefPtr(mediaElement().get());
     if (!element)
         return;
+
     element->removeAudioTrack(*this);
 }
 
@@ -199,10 +197,15 @@ void AudioTrack::updateKindFromPrivate()
 void AudioTrack::setMediaElement(WeakPtr<HTMLMediaElement> element)
 {
     TrackBase::setMediaElement(element);
+}
+
 #if !RELEASE_LOG_DISABLED
-    m_private->setLogger(logger(), logIdentifier());
-#endif
+void AudioTrack::setLogger(const Logger& logger, const void* logIdentifier)
+{
+    TrackBase::setLogger(logger, logIdentifier);
+    m_private->setLogger(logger, this->logIdentifier());
 }
+#endif
 
 } // namespace WebCore
 
index 315de65..ee241e3 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -66,6 +66,9 @@ public:
 
     void setPrivate(AudioTrackPrivate&);
     void setMediaElement(WeakPtr<HTMLMediaElement>) override;
+#if !RELEASE_LOG_DISABLED
+    void setLogger(const Logger&, const void*) final;
+#endif
 
 private:
     AudioTrack(AudioTrackClient&, AudioTrackPrivate&);
index 4934d72..262894f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -178,9 +178,9 @@ WebVTTParser& InbandGenericTextTrack::parser()
     return *m_webVTTParser;
 }
 
-void InbandGenericTextTrack::parseWebVTTCueData(const ISOWebVTTCue& cueData)
+void InbandGenericTextTrack::parseWebVTTCueData(ISOWebVTTCue&& cueData)
 {
-    parser().parseCueData(cueData);
+    parser().parseCueData(WTFMove(cueData));
 }
 
 void InbandGenericTextTrack::parseWebVTTFileHeader(String&& header)
index 2cdf12e..2212f95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -68,7 +68,7 @@ private:
     void updateCueFromCueData(TextTrackCueGeneric&, GenericCueData&);
 
     WebVTTParser& parser();
-    void parseWebVTTCueData(const ISOWebVTTCue&) final;
+    void parseWebVTTCueData(ISOWebVTTCue&&) final;
     void parseWebVTTFileHeader(String&&) final;
 
     void newCuesParsed() final;
index be9c99a..6e87ea1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -42,11 +42,11 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(InbandTextTrack);
 Ref<InbandTextTrack> InbandTextTrack::create(ScriptExecutionContext& context, TextTrackClient& client, InbandTextTrackPrivate& trackPrivate)
 {
     switch (trackPrivate.cueFormat()) {
-    case InbandTextTrackPrivate::Data:
+    case InbandTextTrackPrivate::CueFormat::Data:
         return InbandDataTextTrack::create(context, client, trackPrivate);
-    case InbandTextTrackPrivate::Generic:
+    case InbandTextTrackPrivate::CueFormat::Generic:
         return InbandGenericTextTrack::create(context, client, trackPrivate);
-    case InbandTextTrackPrivate::WebVTT:
+    case InbandTextTrackPrivate::CueFormat::WebVTT:
         return InbandWebVTTTextTrack::create(context, client, trackPrivate);
     }
     ASSERT_NOT_REACHED();
@@ -57,9 +57,6 @@ InbandTextTrack::InbandTextTrack(ScriptExecutionContext& context, TextTrackClien
     : TextTrack(&context, &client, emptyAtom(), trackPrivate.id(), trackPrivate.label(), trackPrivate.language(), InBand)
     , m_private(trackPrivate)
 {
-#if !RELEASE_LOG_DISABLED
-    m_private->setLogger(logger(), logIdentifier());
-#endif
     m_private->setClient(this);
     updateKindFromPrivate();
 }
@@ -92,14 +89,14 @@ static inline InbandTextTrackPrivate::Mode toPrivate(TextTrack::Mode mode)
 {
     switch (mode) {
     case TextTrack::Mode::Disabled:
-        return InbandTextTrackPrivate::Disabled;
+        return InbandTextTrackPrivate::Mode::Disabled;
     case TextTrack::Mode::Hidden:
-        return InbandTextTrackPrivate::Hidden;
+        return InbandTextTrackPrivate::Mode::Hidden;
     case TextTrack::Mode::Showing:
-        return InbandTextTrackPrivate::Showing;
+        return InbandTextTrackPrivate::Mode::Showing;
     }
     ASSERT_NOT_REACHED();
-    return InbandTextTrackPrivate::Disabled;
+    return InbandTextTrackPrivate::Mode::Disabled;
 }
 
 void InbandTextTrack::setModeInternal(Mode mode)
@@ -168,25 +165,25 @@ void InbandTextTrack::willRemove()
 void InbandTextTrack::updateKindFromPrivate()
 {
     switch (m_private->kind()) {
-    case InbandTextTrackPrivate::Subtitles:
+    case InbandTextTrackPrivate::Kind::Subtitles:
         setKind(Kind::Subtitles);
         return;
-    case InbandTextTrackPrivate::Captions:
+    case InbandTextTrackPrivate::Kind::Captions:
         setKind(Kind::Captions);
         return;
-    case InbandTextTrackPrivate::Descriptions:
+    case InbandTextTrackPrivate::Kind::Descriptions:
         setKind(Kind::Descriptions);
         return;
-    case InbandTextTrackPrivate::Chapters:
+    case InbandTextTrackPrivate::Kind::Chapters:
         setKind(Kind::Chapters);
         return;
-    case InbandTextTrackPrivate::Metadata:
+    case InbandTextTrackPrivate::Kind::Metadata:
         setKind(Kind::Metadata);
         return;
-    case InbandTextTrackPrivate::Forced:
+    case InbandTextTrackPrivate::Kind::Forced:
         setKind(Kind::Forced);
         return;
-    case InbandTextTrackPrivate::None:
+    case InbandTextTrackPrivate::Kind::None:
         break;
     }
     ASSERT_NOT_REACHED();
@@ -205,6 +202,13 @@ void InbandTextTrack::setMediaElement(WeakPtr<HTMLMediaElement> element)
 #endif
 }
 
+#if !RELEASE_LOG_DISABLED
+void InbandTextTrack::setLogger(const Logger& logger, const void* logIdentifier)
+{
+    TextTrack::setLogger(logger, logIdentifier);
+    m_private->setLogger(logger, this->logIdentifier());
+}
+#endif
 
 } // namespace WebCore
 
index 0d45278..e14103d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,6 +50,9 @@ public:
 
     void setPrivate(InbandTextTrackPrivate&);
     void setMediaElement(WeakPtr<HTMLMediaElement>) override;
+#if !RELEASE_LOG_DISABLED
+    void setLogger(const Logger&, const void*) final;
+#endif
 
 protected:
     InbandTextTrack(ScriptExecutionContext&, TextTrackClient&, InbandTextTrackPrivate&);
@@ -80,7 +83,7 @@ private:
 
     void parseWebVTTFileHeader(String&&) override { ASSERT_NOT_REACHED(); }
     void parseWebVTTCueData(const char*, unsigned) override { ASSERT_NOT_REACHED(); }
-    void parseWebVTTCueData(const ISOWebVTTCue&) override { ASSERT_NOT_REACHED(); }
+    void parseWebVTTCueData(ISOWebVTTCue&&) override { ASSERT_NOT_REACHED(); }
 
     MediaTime startTimeVariance() const override;
 };
index 10faa12..7e72332 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -63,9 +63,9 @@ void InbandWebVTTTextTrack::parseWebVTTCueData(const char* data, unsigned length
     parser().parseBytes(data, length);
 }
 
-void InbandWebVTTTextTrack::parseWebVTTCueData(const ISOWebVTTCue& cueData)
+void InbandWebVTTTextTrack::parseWebVTTCueData(ISOWebVTTCue&& cueData)
 {
-    parser().parseCueData(cueData);
+    parser().parseCueData(WTFMove(cueData));
 }
 
 void InbandWebVTTTextTrack::newCuesParsed()
index 945e1e0..ac2b8d5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -44,7 +44,7 @@ private:
 
     WebVTTParser& parser();
     void parseWebVTTCueData(const char* data, unsigned length) final;
-    void parseWebVTTCueData(const ISOWebVTTCue&) final;
+    void parseWebVTTCueData(ISOWebVTTCue&&) final;
 
     void newCuesParsed() final;
     void newRegionsParsed() final;
index fd946b8..ff6ec8b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011, 2013 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -195,8 +195,11 @@ void TextTrack::setKind(Kind newKind)
         mediaElement()->ensureTextTracks().scheduleChangeEvent();
 #endif
 
-    if (m_client && oldKind != m_kind)
-        m_client->textTrackKindChanged(*this);
+    if (oldKind != m_kind) {
+        ALWAYS_LOG(LOGIDENTIFIER, m_kind);
+        if (m_client)
+            m_client->textTrackKindChanged(*this);
+    }
 }
 
 void TextTrack::setKindKeywordIgnoringASCIICase(StringView keyword)
@@ -231,6 +234,8 @@ void TextTrack::setMode(Mode mode)
     if (m_mode == mode)
         return;
 
+    ALWAYS_LOG(LOGIDENTIFIER, mode);
+
     // If mode changes to disabled, remove this track's cues from the client
     // because they will no longer be accessible from the cues() function.
     if (mode == Mode::Disabled && m_client && m_cues)
@@ -264,6 +269,8 @@ void TextTrack::removeAllCues()
     if (!m_cues)
         return;
 
+    ALWAYS_LOG(LOGIDENTIFIER);
+
     if (m_client)
         m_client->textTrackRemoveCues(*this, *m_cues);
     
@@ -297,6 +304,8 @@ ExceptionOr<void> TextTrack::addCue(Ref<TextTrackCue>&& cue)
     if (cue->cueType() == TextTrackCue::Data && m_kind != Kind::Metadata)
         return Exception { InvalidNodeTypeError };
 
+    INFO_LOG(LOGIDENTIFIER, cue.get());
+
     // TODO(93143): Add spec-compliant behavior for negative time values.
     if (!cue->startMediaTime().isValid() || !cue->endMediaTime().isValid() || cue->startMediaTime() < MediaTime::zeroTime() || cue->endMediaTime() < MediaTime::zeroTime())
         return { };
index ed5b83a..47e6dee 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc.  All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -211,9 +211,34 @@ inline void TextTrack::setKindForBindings(Kind kind)
 
 #endif
 
+String convertEnumerationToString(TextTrack::Mode); // Defined in JSTextTrack.cpp
+String convertEnumerationToString(TextTrack::Kind);
 
 } // namespace WebCore
 
+namespace WTF {
+
+template<typename Type>
+struct LogArgument;
+
+template <>
+struct LogArgument<WebCore::TextTrack::Kind> {
+    static String toString(const WebCore::TextTrack::Kind kind)
+    {
+        return convertEnumerationToString(kind);
+    }
+};
+
+template <>
+struct LogArgument<WebCore::TextTrack::Mode> {
+    static String toString(const WebCore::TextTrack::Mode mode)
+    {
+        return convertEnumerationToString(mode);
+    }
+};
+
+};
+
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::TextTrack)
     static bool isType(const WebCore::TrackBase& track) { return track.type() == WebCore::TrackBase::TextTrack; }
 SPECIALIZE_TYPE_TRAITS_END()
index c29402c..6f2107b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,12 +39,6 @@ namespace WebCore {
 static int s_uniqueId = 0;
 
 #if !RELEASE_LOG_DISABLED
-static const void* nextLogIdentifier()
-{
-    static uint64_t logIdentifier = cryptographicallyRandomNumber();
-    return reinterpret_cast<const void*>(++logIdentifier);
-}
-
 static RefPtr<Logger>& nullLogger()
 {
     static NeverDestroyed<RefPtr<Logger>> logger;
@@ -69,7 +63,6 @@ TrackBase::TrackBase(Type type, const AtomString& id, const AtomString& label, c
     }
 
     m_logger = nullLogger().get();
-    m_logIdentifier = nextLogIdentifier();
 #endif
 }
 
@@ -81,13 +74,6 @@ Element* TrackBase::element()
 void TrackBase::setMediaElement(WeakPtr<HTMLMediaElement> element)
 {
     m_mediaElement = element;
-
-#if !RELEASE_LOG_DISABLED
-    if (element) {
-        m_logger = &element->logger();
-        m_logIdentifier = element->logIdentifier();
-    }
-#endif
 }
 
 // See: https://tools.ietf.org/html/bcp47#section-2.1
@@ -168,6 +154,12 @@ AtomString TrackBase::validBCP47Language() const
 }
 
 #if !RELEASE_LOG_DISABLED
+void TrackBase::setLogger(const Logger& logger, const void* logIdentifier)
+{
+    m_logger = &logger;
+    m_logIdentifier = childLogIdentifier(logIdentifier, m_uniqueId);
+}
+
 WTFLogChannel& TrackBase::logChannel() const
 {
     return LogMedia;
index ebd7b8e..728979b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -75,6 +75,7 @@ public:
     virtual bool enabled() const = 0;
 
 #if !RELEASE_LOG_DISABLED
+    virtual void setLogger(const Logger&, const void*);
     const Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     WTFLogChannel& logChannel() const final;
@@ -98,7 +99,7 @@ private:
     AtomString m_validBCP47Language;
 #if !RELEASE_LOG_DISABLED
     RefPtr<const Logger> m_logger;
-    const void* m_logIdentifier;
+    const void* m_logIdentifier { nullptr };
 #endif
 };
 
index 2eaff33..b5df183 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -86,9 +86,6 @@ VideoTrack::VideoTrack(VideoTrackClient& client, VideoTrackPrivate& trackPrivate
     , m_private(trackPrivate)
     , m_selected(trackPrivate.selected())
 {
-#if !RELEASE_LOG_DISABLED
-    m_private->setLogger(logger(), logIdentifier());
-#endif
     m_private->setClient(this);
     updateKindFromPrivate();
 }
@@ -247,10 +244,15 @@ void VideoTrack::updateKindFromPrivate()
 void VideoTrack::setMediaElement(WeakPtr<HTMLMediaElement> element)
 {
     TrackBase::setMediaElement(element);
+}
+
 #if !RELEASE_LOG_DISABLED
-    m_private->setLogger(logger(), logIdentifier());
-#endif
+void VideoTrack::setLogger(const Logger& logger, const void* logIdentifier)
+{
+    TrackBase::setLogger(logger, logIdentifier);
+    m_private->setLogger(logger, this->logIdentifier());
 }
+#endif
 
 } // namespace WebCore
 
index 42273ee..13f7a93 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2011 Google Inc. All rights reserved.
- * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -74,6 +74,9 @@ public:
 
     void setPrivate(VideoTrackPrivate&);
     void setMediaElement(WeakPtr<HTMLMediaElement>) override;
+#if !RELEASE_LOG_DISABLED
+    void setLogger(const Logger&, const void*) final;
+#endif
 
 private:
     VideoTrack(VideoTrackClient&, VideoTrackPrivate&);
index b334235..9086198 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef InbandTextTrackPrivate_h
-#define InbandTextTrackPrivate_h
+#pragma once
 
 #if ENABLE(VIDEO_TRACK)
 
@@ -34,7 +33,7 @@ namespace WebCore {
 
 class InbandTextTrackPrivate : public TrackPrivateBase {
 public:
-    enum CueFormat {
+    enum class CueFormat : uint8_t {
         Data,
         Generic,
         WebVTT
@@ -45,7 +44,7 @@ public:
     InbandTextTrackPrivateClient* client() const override { return m_client; }
     void setClient(InbandTextTrackPrivateClient* client) { m_client = client; }
 
-    enum Mode {
+    enum class Mode : uint8_t {
         Disabled,
         Hidden,
         Showing
@@ -53,7 +52,7 @@ public:
     virtual void setMode(Mode mode) { m_mode = mode; };
     virtual InbandTextTrackPrivate::Mode mode() const { return m_mode; }
 
-    enum Kind {
+    enum class Kind : uint8_t {
         Subtitles,
         Captions,
         Descriptions,
@@ -62,7 +61,8 @@ public:
         Forced,
         None
     };
-    virtual Kind kind() const { return Subtitles; }
+    virtual Kind kind() const { return Kind::Subtitles; }
+
     virtual bool isClosedCaptions() const { return false; }
     virtual bool isSDH() const { return false; }
     virtual bool containsOnlyForcedSubtitles() const { return false; }
@@ -76,7 +76,7 @@ public:
 
     virtual int textTrackIndex() const { return 0; }
 
-    CueFormat cueFormat() const { return m_format; }
+    virtual CueFormat cueFormat() const { return m_format; }
 
 #if !RELEASE_LOG_DISABLED
     const char* logClassName() const override { return "InbandTextTrackPrivate"; }
@@ -85,18 +85,51 @@ public:
 protected:
     InbandTextTrackPrivate(CueFormat format)
         : m_format(format)
-        , m_client(0)
-        , m_mode(Disabled)
     {
     }
 
 private:
     CueFormat m_format;
-    InbandTextTrackPrivateClient* m_client;
-    Mode m_mode;
+    InbandTextTrackPrivateClient* m_client { nullptr };
+    Mode m_mode { Mode::Disabled };
 };
 
 } // namespace WebCore
 
-#endif
-#endif
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::InbandTextTrackPrivate::CueFormat> {
+    using values = EnumValues<
+        WebCore::InbandTextTrackPrivate::CueFormat,
+        WebCore::InbandTextTrackPrivate::CueFormat::Data,
+        WebCore::InbandTextTrackPrivate::CueFormat::Generic,
+        WebCore::InbandTextTrackPrivate::CueFormat::WebVTT
+    >;
+};
+
+template<> struct EnumTraits<WebCore::InbandTextTrackPrivate::Mode> {
+    using values = EnumValues<
+        WebCore::InbandTextTrackPrivate::Mode,
+        WebCore::InbandTextTrackPrivate::Mode::Disabled,
+        WebCore::InbandTextTrackPrivate::Mode::Hidden,
+        WebCore::InbandTextTrackPrivate::Mode::Showing
+    >;
+};
+
+template<> struct EnumTraits<WebCore::InbandTextTrackPrivate::Kind> {
+    using values = EnumValues<
+        WebCore::InbandTextTrackPrivate::Kind,
+        WebCore::InbandTextTrackPrivate::Kind::Subtitles,
+        WebCore::InbandTextTrackPrivate::Kind::Captions,
+        WebCore::InbandTextTrackPrivate::Kind::Descriptions,
+        WebCore::InbandTextTrackPrivate::Kind::Chapters,
+        WebCore::InbandTextTrackPrivate::Kind::Metadata,
+        WebCore::InbandTextTrackPrivate::Kind::Forced,
+        WebCore::InbandTextTrackPrivate::Kind::None
+    >;
+};
+
+} // namespace WTF
+
+#endif // ENABLE(VIDEO_TRACK)
+
index 9d4e1fa..6e0c8f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -240,7 +240,7 @@ public:
 
     virtual void parseWebVTTFileHeader(String&&) { ASSERT_NOT_REACHED(); }
     virtual void parseWebVTTCueData(const char* data, unsigned length) = 0;
-    virtual void parseWebVTTCueData(const ISOWebVTTCue&) = 0;
+    virtual void parseWebVTTCueData(ISOWebVTTCue&&) = 0;
 };
 
 } // namespace WebCore
index 1783832..a9f049f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -101,11 +101,11 @@ public:
     };
 };
 
-WTF::String convertEnumerationToString(MediaPlayerEnums::ReadyState);
-WTF::String convertEnumerationToString(MediaPlayerEnums::NetworkState);
-WTF::String convertEnumerationToString(MediaPlayerEnums::Preload);
-WTF::String convertEnumerationToString(MediaPlayerEnums::SupportsType);
-WTF::String convertEnumerationToString(MediaPlayerEnums::BufferingPolicy);
+String convertEnumerationToString(MediaPlayerEnums::ReadyState);
+String convertEnumerationToString(MediaPlayerEnums::NetworkState);
+String convertEnumerationToString(MediaPlayerEnums::Preload);
+String convertEnumerationToString(MediaPlayerEnums::SupportsType);
+String convertEnumerationToString(MediaPlayerEnums::BufferingPolicy);
 
 } // namespace WebCore
 
index 4363140..fe1c064 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #if ENABLE(VIDEO_TRACK)
 
 #include "Logging.h"
+#include <wtf/LoggerHelper.h>
 
 namespace WebCore {
 
+static uint64_t s_uniqueId = 0;
+
 #if !RELEASE_LOG_DISABLED
 void TrackPrivateBase::setLogger(const Logger& logger, const void* logIdentifier)
 {
     m_logger = &logger;
-    m_logIdentifier = logIdentifier;
+    m_logIdentifier = childLogIdentifier(logIdentifier, ++s_uniqueId);
 }
 
 WTFLogChannel& TrackPrivateBase::logChannel() const
index 0263c64..35da95e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -56,7 +56,7 @@ InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF() = defaul
 
 void InbandMetadataTextTrackPrivateAVF::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&& cueData, const String& type)
 {
-    ASSERT(cueFormat() == Data);
+    ASSERT(cueFormat() == CueFormat::Data);
     ASSERT(start >= MediaTime::zeroTime());
 
     if (!client())
index ba014b5..9b528b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -541,7 +541,7 @@ void InbandTextTrackPrivateAVF::processNativeSamples(CFArrayRef nativeSamples, c
             ISOWebVTTCue cueData = ISOWebVTTCue(presentationTime, duration);
             cueData.read(view);
             INFO_LOG(LOGIDENTIFIER, "VTT cue data ", cueData);
-            client()->parseWebVTTCueData(cueData);
+            client()->parseWebVTTCueData(WTFMove(cueData));
         }
 
         m_sampleInputBuffer.remove(0, (size_t)boxLength);
index c5928bb..e4abc7d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -894,11 +894,11 @@ void MediaPlayerPrivateAVFoundation::configureInbandTracks()
     // is hidden if none are showing. Otherwise disable all tracks.
     for (unsigned i = 0; i < m_textTracks.size(); ++i) {
         RefPtr<InbandTextTrackPrivateAVF> track = m_textTracks[i];
-        if (track->mode() == InbandTextTrackPrivate::Showing) {
+        if (track->mode() == InbandTextTrackPrivate::Mode::Showing) {
             trackToEnable = track;
             break;
         }
-        if (track->mode() == InbandTextTrackPrivate::Hidden)
+        if (track->mode() == InbandTextTrackPrivate::Mode::Hidden)
             trackToEnable = track;
     }
 
index 8b5ec16..b459f6f 100644 (file)
@@ -63,27 +63,27 @@ void InbandTextTrackPrivateAVCF::disconnect()
 InbandTextTrackPrivate::Kind InbandTextTrackPrivateAVCF::kind() const
 {
     if (!m_mediaSelectionOption)
-        return InbandTextTrackPrivate::None;
+        return InbandTextTrackPrivate::Kind::None;
 
     CFStringRef mediaType = AVCFMediaSelectionOptionGetMediaType(mediaSelectionOption());
     
     if (CFStringCompare(mediaType, AVCFMediaTypeClosedCaption, kCFCompareCaseInsensitive) == kCFCompareEqualTo)
-        return InbandTextTrackPrivate::Captions;
+        return InbandTextTrackPrivate::Kind::Captions;
     if (CFStringCompare(mediaType, AVCFMediaTypeSubtitle, kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
         if (AVCFMediaSelectionOptionHasMediaCharacteristic(mediaSelectionOption(), AVCFMediaCharacteristicContainsOnlyForcedSubtitles))
-            return InbandTextTrackPrivate::Forced;
+            return InbandTextTrackPrivate::Kind::Forced;
 
         // An "SDH" track is a subtitle track created for the deaf or hard-of-hearing. "captions" in WebVTT are
         // "labeled as appropriate for the hard-of-hearing", so tag SDH sutitles as "captions".
         if (AVCFMediaSelectionOptionHasMediaCharacteristic(mediaSelectionOption(), AVCFMediaCharacteristicTranscribesSpokenDialogForAccessibility))
-            return InbandTextTrackPrivate::Captions;
+            return InbandTextTrackPrivate::Kind::Captions;
         if (AVCFMediaSelectionOptionHasMediaCharacteristic(mediaSelectionOption(), AVCFMediaCharacteristicDescribesMusicAndSoundForAccessibility))
-            return InbandTextTrackPrivate::Captions;
+            return InbandTextTrackPrivate::Kind::Captions;
         
-        return InbandTextTrackPrivate::Subtitles;
+        return InbandTextTrackPrivate::Kind::Subtitles;
     }
 
-    return InbandTextTrackPrivate::Captions;
+    return InbandTextTrackPrivate::Kind::Captions;
 }
 
 bool InbandTextTrackPrivateAVCF::isClosedCaptions() const
index 19701c0..9e69990 100644 (file)
@@ -58,9 +58,9 @@ void InbandTextTrackPrivateLegacyAVCF::disconnect()
 InbandTextTrackPrivate::Kind InbandTextTrackPrivateLegacyAVCF::kind() const
 {
     if (!m_playerItemTrack)
-        return InbandTextTrackPrivate::None;
+        return InbandTextTrackPrivate::Kind::None;
 
-    return InbandTextTrackPrivate::Captions;
+    return InbandTextTrackPrivate::Kind::Captions;
 }
 
 bool InbandTextTrackPrivateLegacyAVCF::isClosedCaptions() const
index b722ed3..70eac36 100644 (file)
@@ -1277,7 +1277,7 @@ void MediaPlayerPrivateAVFoundationCF::processMediaSelectionOptions()
         if (!newTrack)
             continue;
 
-        m_textTracks.append(InbandTextTrackPrivateAVCF::create(this, option, InbandTextTrackPrivate::Generic));
+        m_textTracks.append(InbandTextTrackPrivateAVCF::create(this, option, InbandTextTrackPrivate::CueFormat::Generic));
     }
 
     processNewAndRemovedTextTracks(removedTextTracks);
index df53537..a3431c2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -59,28 +59,28 @@ void InbandTextTrackPrivateAVFObjC::disconnect()
 InbandTextTrackPrivate::Kind InbandTextTrackPrivateAVFObjC::kind() const
 {
     if (!m_mediaSelectionOption)
-        return InbandTextTrackPrivate::None;
+        return Kind::None;
 
     NSString *mediaType = [m_mediaSelectionOption mediaType];
     
     if ([mediaType isEqualToString:AVMediaTypeClosedCaption])
-        return InbandTextTrackPrivate::Captions;
+        return Kind::Captions;
     if ([mediaType isEqualToString:AVMediaTypeSubtitle]) {
 
         if ([m_mediaSelectionOption hasMediaCharacteristic:AVMediaCharacteristicContainsOnlyForcedSubtitles])
-            return InbandTextTrackPrivate::Forced;
+            return Kind::Forced;
 
         // An "SDH" track is a subtitle track created for the deaf or hard-of-hearing. "captions" in WebVTT are
         // "labeled as appropriate for the hard-of-hearing", so tag SDH sutitles as "captions".
         if ([m_mediaSelectionOption hasMediaCharacteristic:AVMediaCharacteristicTranscribesSpokenDialogForAccessibility])
-            return InbandTextTrackPrivate::Captions;
+            return Kind::Captions;
         if ([m_mediaSelectionOption hasMediaCharacteristic:AVMediaCharacteristicDescribesMusicAndSoundForAccessibility])
-            return InbandTextTrackPrivate::Captions;
+            return Kind::Captions;
         
-        return InbandTextTrackPrivate::Subtitles;
+        return Kind::Subtitles;
     }
 
-    return InbandTextTrackPrivate::Captions;
+    return Kind::Captions;
 }
 
 bool InbandTextTrackPrivateAVFObjC::isClosedCaptions() const
index 1ead5cf..1e372be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -712,13 +712,13 @@ void MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState()
             if (![[currentOption.get() outOfBandIdentifier] isEqual:(__bridge NSString *)uniqueID.get()])
                 continue;
             
-            InbandTextTrackPrivate::Mode mode = InbandTextTrackPrivate::Hidden;
+            InbandTextTrackPrivate::Mode mode = InbandTextTrackPrivate::Mode::Hidden;
             if (track->mode() == PlatformTextTrack::Hidden)
-                mode = InbandTextTrackPrivate::Hidden;
+                mode = InbandTextTrackPrivate::Mode::Hidden;
             else if (track->mode() == PlatformTextTrack::Disabled)
-                mode = InbandTextTrackPrivate::Disabled;
+                mode = InbandTextTrackPrivate::Mode::Disabled;
             else if (track->mode() == PlatformTextTrack::Showing)
-                mode = InbandTextTrackPrivate::Showing;
+                mode = InbandTextTrackPrivate::Mode::Showing;
             
             textTrack->setMode(mode);
             break;
@@ -2503,7 +2503,7 @@ void MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions()
         }
 #endif
 
-        m_textTracks.append(InbandTextTrackPrivateAVFObjC::create(this, option, InbandTextTrackPrivate::Generic));
+        m_textTracks.append(InbandTextTrackPrivateAVFObjC::create(this, option, InbandTextTrackPrivate::CueFormat::Generic));
     }
 
     processNewAndRemovedTextTracks(removedTextTracks);
@@ -2514,7 +2514,7 @@ void MediaPlayerPrivateAVFoundationObjC::processMetadataTrack()
     if (m_metadataTrack)
         return;
 
-    m_metadataTrack = InbandMetadataTextTrackPrivateAVF::create(InbandTextTrackPrivate::Metadata, InbandTextTrackPrivate::Data);
+    m_metadataTrack = InbandMetadataTextTrackPrivateAVF::create(InbandTextTrackPrivate::Kind::Metadata, InbandTextTrackPrivate::CueFormat::Data);
     m_metadataTrack->setInBandMetadataTrackDispatchType("com.apple.streaming");
     player()->addTextTrack(*m_metadataTrack);
 }
index 9ff1c04..e421cef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -107,7 +107,7 @@ public:
     const void* logIdentifier() const final { return m_logIdentifier; }
     WTFLogChannel& logChannel() const final;
 
-    const void* nextSourceBufferLogIdentifier() { return childLogIdentifier(++m_nextSourceBufferID); }
+    const void* nextSourceBufferLogIdentifier() { return childLogIdentifier(m_logIdentifier, ++m_nextSourceBufferID); }
 #endif
 
 private:
index 3261678..0714665 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,7 +50,7 @@ public:
     
 protected:
     OutOfBandTextTrackPrivateAVF(AVFInbandTrackParent* player, AVMediaSelectionOption* selection)
-        : InbandTextTrackPrivateAVF(player, InbandTextTrackPrivate::Generic)
+        : InbandTextTrackPrivateAVF(player, InbandTextTrackPrivate::CueFormat::Generic)
         , m_mediaSelectionOption(selection)
     {
     }
index 6348589..ac05836 100644 (file)
@@ -40,7 +40,7 @@ GST_DEBUG_CATEGORY_EXTERN(webkit_media_player_debug);
 namespace WebCore {
 
 InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstPad> pad)
-    : InbandTextTrackPrivate(WebVTT)
+    : InbandTextTrackPrivate(CueFormat::WebVTT)
     , TrackPrivateBaseGStreamer(this, index, pad)
 {
     m_eventProbe = gst_pad_add_probe(m_pad.get(), GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM, [] (GstPad*, GstPadProbeInfo* info, gpointer userData) -> GstPadProbeReturn {
@@ -59,7 +59,7 @@ InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRe
 }
 
 InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer(gint index, GRefPtr<GstStream> stream)
-    : InbandTextTrackPrivate(WebVTT)
+    : InbandTextTrackPrivate(CueFormat::WebVTT)
     , TrackPrivateBaseGStreamer(this, index, stream)
 {
     m_streamId = gst_stream_get_stream_id(stream.get());
index a12ef4f..6526a18 100644 (file)
@@ -2404,7 +2404,7 @@ void MediaPlayerPrivateGStreamer::processMpegTsSection(GstMpegtsSection* section
             if (stream->stream_type == 0x05 || stream->stream_type >= 0x80) {
                 AtomString pid = String::number(stream->pid);
                 auto track = InbandMetadataTextTrackPrivateGStreamer::create(
-                    InbandTextTrackPrivate::Metadata, InbandTextTrackPrivate::Data, pid);
+                    InbandTextTrackPrivate::Kind::Metadata, InbandTextTrackPrivate::CueFormat::Data, pid);
 
                 // 4.7.10.12.2 Sourcing in-band text tracks
                 // If the new text track's kind is metadata, then set the text track in-band metadata track dispatch
@@ -2450,7 +2450,7 @@ void MediaPlayerPrivateGStreamer::processTableOfContents(GstMessage* message)
     if (m_chaptersTrack)
         m_player->removeTextTrack(*m_chaptersTrack);
 
-    m_chaptersTrack = InbandMetadataTextTrackPrivateGStreamer::create(InbandTextTrackPrivate::Chapters, InbandTextTrackPrivate::Generic);
+    m_chaptersTrack = InbandMetadataTextTrackPrivateGStreamer::create(InbandTextTrackPrivate::Kind::Chapters, InbandTextTrackPrivate::CueFormat::Generic);
     m_player->addTextTrack(*m_chaptersTrack);
 
     GRefPtr<GstToc> toc;
index 4b516ee..737dc24 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -80,6 +80,17 @@ ISOWebVTTCue::ISOWebVTTCue(const MediaTime& presentationTime, const MediaTime& d
 {
 }
 
+ISOWebVTTCue::ISOWebVTTCue(MediaTime&& presentationTime, MediaTime&& duration, String&& sourceID, String&& id, String&& originalStartTime, String&& settings, String&& cueText)
+    : m_presentationTime(WTFMove(presentationTime))
+    , m_duration(WTFMove(duration))
+    , m_sourceID(WTFMove(sourceID))
+    , m_identifier(WTFMove(id))
+    , m_originalStartTime(WTFMove(originalStartTime))
+    , m_settings(WTFMove(settings))
+    , m_cueText(WTFMove(cueText))
+{
+}
+
 bool ISOWebVTTCue::parse(DataView& view, unsigned& offset)
 {
     if (!ISOBox::parse(view, offset))
index ae23bef..9d46456 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,9 +38,11 @@ namespace WebCore {
 // N bytes : CueTimeBox : box : optional
 // N bytes : CueSettingsBox : box : optional
 // N bytes : CuePayloadBox : box : required
-class ISOWebVTTCue final : public ISOBox {
+
+class WEBCORE_EXPORT ISOWebVTTCue final : public ISOBox {
 public:
     ISOWebVTTCue(const MediaTime& presentationTime, const MediaTime& duration);
+    ISOWebVTTCue(MediaTime&& presentationTime, MediaTime&& duration, String&& sourceID, String&& id, String&& originalStartTime, String&& settings, String&& cueText);
 
     static FourCC boxTypeName() { return "vttc"; }
 
@@ -55,6 +57,67 @@ public:
 
     String toJSONString() const;
 
+    template<class Encoder>
+    void encode(Encoder& encoder) const
+    {
+        encoder << m_presentationTime;
+        encoder << m_duration;
+        encoder << m_sourceID;
+        encoder << m_identifier;
+        encoder << m_originalStartTime;
+        encoder << m_settings;
+        encoder << m_cueText;
+    }
+
+    template <class Decoder>
+    static Optional<ISOWebVTTCue> decode(Decoder& decoder)
+    {
+        Optional<MediaTime> presentationTime;
+        decoder >> presentationTime;
+        if (!presentationTime)
+            return WTF::nullopt;
+
+        Optional<MediaTime> duration;
+        decoder >> duration;
+        if (!duration)
+            return WTF::nullopt;
+
+        Optional<String> sourceID;
+        decoder >> sourceID;
+        if (!sourceID)
+            return WTF::nullopt;
+
+        Optional<String> identifier;
+        decoder >> identifier;
+        if (!identifier)
+            return WTF::nullopt;
+
+        Optional<String> originalStartTime;
+        decoder >> originalStartTime;
+        if (!originalStartTime)
+            return WTF::nullopt;
+
+        Optional<String> settings;
+        decoder >> settings;
+        if (!settings)
+            return WTF::nullopt;
+
+        Optional<String> cueText;
+        decoder >> cueText;
+        if (!cueText)
+            return WTF::nullopt;
+
+        return {{
+            WTFMove(*presentationTime),
+            WTFMove(*duration),
+            WTFMove(*sourceID),
+            WTFMove(*identifier),
+            WTFMove(*originalStartTime),
+            WTFMove(*settings),
+            WTFMove(*cueText)
+        }};
+    }
+
 protected:
     bool parse(JSC::DataView&, unsigned& offset) override;
 
index 86e2936..e61ab21 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -60,7 +60,7 @@ public:
 
 protected:
     MockTextTrackPrivate(const MockTrackBox& box)
-        : InbandTextTrackPrivate(InbandTextTrackPrivate::Generic)
+        : InbandTextTrackPrivate(InbandTextTrackPrivate::CueFormat::Generic)
         , m_box(box)
         , m_id(AtomString::number(box.trackID()))
     {
index 27de599..a8ef4c8 100644 (file)
@@ -1,5 +1,81 @@
 2020-02-11  Eric Carlson  <eric.carlson@apple.com>
 
+        Support in-band VTT captions when loading media in the GPU Process
+        https://bugs.webkit.org/show_bug.cgi?id=207467
+        <rdar://problem/59312749>
+
+        Reviewed by Jer Noble.
+
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * GPUProcess/media/RemoteAudioTrackProxy.h:
+        * GPUProcess/media/RemoteMediaPlayerProxy.cpp:
+        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack):
+        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack):
+        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack):
+        (WebKit::RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack):
+        (WebKit::RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged):
+        (WebKit::RemoteMediaPlayerProxy::textTrackSetMode):
+        * GPUProcess/media/RemoteMediaPlayerProxy.h:
+        * GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
+        * GPUProcess/media/RemoteTextTrackProxy.cpp: Added.
+        (WebKit::RemoteTextTrackProxy::RemoteTextTrackProxy):
+        (WebKit::RemoteTextTrackProxy::configuration):
+        (WebKit::RemoteTextTrackProxy::configurationChanged):
+        (WebKit::RemoteTextTrackProxy::willRemove):
+        (WebKit::RemoteTextTrackProxy::idChanged):
+        (WebKit::RemoteTextTrackProxy::labelChanged):
+        (WebKit::RemoteTextTrackProxy::languageChanged):
+        (WebKit::RemoteTextTrackProxy::addDataCue):
+        (WebKit::RemoteTextTrackProxy::updateDataCue):
+        (WebKit::RemoteTextTrackProxy::removeDataCue):
+        (WebKit::RemoteTextTrackProxy::addGenericCue):
+        (WebKit::RemoteTextTrackProxy::updateGenericCue):
+        (WebKit::RemoteTextTrackProxy::removeGenericCue):
+        (WebKit::RemoteTextTrackProxy::parseWebVTTFileHeader):
+        (WebKit::RemoteTextTrackProxy::parseWebVTTCueData):
+        * GPUProcess/media/RemoteTextTrackProxy.h: Copied from Source/WebKit/GPUProcess/media/RemoteVideoTrackProxy.h.
+        * GPUProcess/media/RemoteVideoTrackProxy.h:
+        * GPUProcess/media/TextTrackPrivateRemoteConfiguration.h: Added.
+        (WebKit::TextTrackPrivateRemoteConfiguration::encode const):
+        (WebKit::TextTrackPrivateRemoteConfiguration::decode):
+        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayer.h:
+        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.cpp:
+        (WebKit::RemoteSampleBufferDisplayLayerManager::createLayer):
+        * GPUProcess/webrtc/RemoteSampleBufferDisplayLayerManager.h:
+        * Scripts/webkit/messages.py:
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
+        (WebKit::MediaPlayerPrivateRemote::removeRemoteAudioTrack):
+        (WebKit::MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged):
+        (WebKit::MediaPlayerPrivateRemote::addRemoteTextTrack):
+        (WebKit::MediaPlayerPrivateRemote::removeRemoteTextTrack):
+        (WebKit::MediaPlayerPrivateRemote::remoteTextTrackConfigurationChanged):
+        (WebKit::MediaPlayerPrivateRemote::parseWebVTTFileHeader):
+        (WebKit::MediaPlayerPrivateRemote::parseWebVTTCueData):
+        (WebKit::MediaPlayerPrivateRemote::parseWebVTTCueDataStruct):
+        * WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
+        * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
+        * WebProcess/GPU/media/TextTrackPrivateRemote.cpp: Added.
+        (WebKit::TextTrackPrivateRemote::TextTrackPrivateRemote):
+        (WebKit::TextTrackPrivateRemote::setMode):
+        (WebKit::TextTrackPrivateRemote::updateConfiguration):
+        (WebKit::TextTrackPrivateRemote::addDataCue):
+        (WebKit::TextTrackPrivateRemote::updateDataCue):
+        (WebKit::TextTrackPrivateRemote::removeDataCue):
+        (WebKit::TextTrackPrivateRemote::addGenericCue):
+        (WebKit::TextTrackPrivateRemote::updateGenericCue):
+        (WebKit::TextTrackPrivateRemote::removeGenericCue):
+        (WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader):
+        (WebKit::TextTrackPrivateRemote::parseWebVTTCueData):
+        (WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct):
+        * WebProcess/GPU/media/TextTrackPrivateRemote.h: Added.
+        * WebProcess/GPU/media/TextTrackPrivateRemote.messages.in: Added.
+
+2020-02-11  Eric Carlson  <eric.carlson@apple.com>
+
         video.currentTime is not being updated in iOS 13.4 Beta
         https://bugs.webkit.org/show_bug.cgi?id=207489
         <rdar://problem/59322640>
index 51d318b..e686c63 100644 (file)
@@ -109,6 +109,7 @@ $(PROJECT_DIR)/WebProcess/FullScreen/WebFullScreenManager.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/GPUProcessConnection.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/media/RemoteMediaPlayerManager.messages.in
+$(PROJECT_DIR)/WebProcess/GPU/media/TextTrackPrivateRemote.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/webrtc/LibWebRTCCodecs.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/webrtc/LibWebRTCRemoteCodecs.messages.in
 $(PROJECT_DIR)/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.messages.in
index 5c92b81..1fcf7e4 100644 (file)
@@ -190,6 +190,9 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/StorageManagerSetMessagesReplies.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextCheckingControllerProxyMessageReceiver.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextCheckingControllerProxyMessages.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextCheckingControllerProxyMessagesReplies.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextTrackPrivateRemoteMessageReceiver.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextTrackPrivateRemoteMessages.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/TextTrackPrivateRemoteMessagesReplies.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/UserMediaCaptureManagerMessageReceiver.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/UserMediaCaptureManagerMessages.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebKit2/UserMediaCaptureManagerMessagesReplies.h
index 349e54d..10d1725 100644 (file)
@@ -165,6 +165,7 @@ MESSAGE_RECEIVERS = \
     StorageAreaMap \
     StorageManagerSet \
     TextCheckingControllerProxy \
+    TextTrackPrivateRemote \
     UserMediaCaptureManager \
     UserMediaCaptureManagerProxy \
     VideoFullscreenManager \
index a36c457..d4c706a 100644 (file)
@@ -37,7 +37,7 @@ namespace WebKit {
 struct TrackPrivateRemoteConfiguration;
 
 class RemoteAudioTrackProxy final
-    : public ThreadSafeRefCounted<TrackPrivateBase, WTF::DestructionThread::Main>
+    : public ThreadSafeRefCounted<RemoteAudioTrackProxy, WTF::DestructionThread::Main>
     , private WebCore::AudioTrackPrivateClient {
 public:
     static Ref<RemoteAudioTrackProxy> create(RemoteMediaPlayerProxy& player, TrackPrivateRemoteIdentifier id, Ref<IPC::Connection>&& connection, AudioTrackPrivate& trackPrivate)
@@ -51,7 +51,6 @@ public:
 
 private:
     RemoteAudioTrackProxy(RemoteMediaPlayerProxy&, TrackPrivateRemoteIdentifier, Ref<IPC::Connection>&&, AudioTrackPrivate&);
-    ~RemoteAudioTrackProxy() = default;
 
     // AudioTrackPrivateClient
     void enabledChanged(bool) final;
index c0bb846..d9e3bd3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2019-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,6 +38,7 @@
 #include "RemoteMediaResourceIdentifier.h"
 #include "RemoteMediaResourceLoader.h"
 #include "RemoteMediaResourceManager.h"
+#include "RemoteTextTrackProxy.h"
 #include "RemoteVideoTrackProxy.h"
 #include "WebCoreArgumentCoders.h"
 #include <WebCore/LayoutRect.h>
@@ -365,8 +366,12 @@ bool RemoteMediaPlayerProxy::mediaPlayerRenderingCanBeAccelerated()
     return m_renderingCanBeAccelerated;
 }
 
+#if ENABLE(VIDEO_TRACK)
 void RemoteMediaPlayerProxy::mediaPlayerDidAddAudioTrack(WebCore::AudioTrackPrivate& track)
 {
+#if !RELEASE_LOG_DISABLED
+    track.setLogger(mediaPlayerLogger(), mediaPlayerLogIdentifier());
+#endif
     m_audioTracks.set(&track, RemoteAudioTrackProxy::create(*this, TrackPrivateRemoteIdentifier::generate(), m_webProcessConnection.copyRef(), track));
 }
 
@@ -390,6 +395,9 @@ void RemoteMediaPlayerProxy::audioTrackSetEnabled(TrackPrivateRemoteIdentifier t
 
 void RemoteMediaPlayerProxy::mediaPlayerDidAddVideoTrack(WebCore::VideoTrackPrivate& track)
 {
+#if !RELEASE_LOG_DISABLED
+    track.setLogger(mediaPlayerLogger(), mediaPlayerLogIdentifier());
+#endif
     m_videoTracks.set(&track, RemoteVideoTrackProxy::create(*this, TrackPrivateRemoteIdentifier::generate(), m_webProcessConnection.copyRef(), track));
 }
 
@@ -411,7 +419,38 @@ void RemoteMediaPlayerProxy::videoTrackSetSelected(TrackPrivateRemoteIdentifier
     ASSERT_NOT_REACHED();
 }
 
-// FIXME: Unimplemented
+void RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack(WebCore::InbandTextTrackPrivate& track)
+{
+#if !RELEASE_LOG_DISABLED
+    track.setLogger(mediaPlayerLogger(), mediaPlayerLogIdentifier());
+#endif
+    m_textTracks.set(&track, RemoteTextTrackProxy::create(*this, TrackPrivateRemoteIdentifier::generate(), m_webProcessConnection.copyRef(), track));
+}
+
+void RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack(WebCore::InbandTextTrackPrivate& track)
+{
+    ASSERT(m_textTracks.contains(&track));
+    m_textTracks.remove(&track);
+}
+
+void RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged(const IntRect&)
+{
+    notImplemented();
+}
+
+void RemoteMediaPlayerProxy::textTrackSetMode(TrackPrivateRemoteIdentifier trackID, WebCore::InbandTextTrackPrivate::Mode mode)
+{
+    for (auto& track : m_textTracks.values()) {
+        if (track->identifier() == trackID) {
+            track->setMode(mode);
+            return;
+        }
+    }
+
+    ASSERT_NOT_REACHED();
+}
+#endif
+
 void RemoteMediaPlayerProxy::mediaPlayerResourceNotSupported()
 {
     m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::ResourceNotSupported(), m_id);
@@ -550,24 +589,6 @@ bool RemoteMediaPlayerProxy::doesHaveAttribute(const AtomString&, AtomString*) c
     return false;
 }
 
-#if ENABLE(VIDEO_TRACK)
-void RemoteMediaPlayerProxy::mediaPlayerDidAddTextTrack(InbandTextTrackPrivate&)
-{
-    notImplemented();
-}
-
-void RemoteMediaPlayerProxy::mediaPlayerDidRemoveTextTrack(InbandTextTrackPrivate&)
-{
-    notImplemented();
-}
-
-void RemoteMediaPlayerProxy::textTrackRepresentationBoundsChanged(const IntRect&)
-{
-    notImplemented();
-}
-
-#endif
-
 #if ENABLE(VIDEO_TRACK) && ENABLE(AVF_CAPTIONS)
 Vector<RefPtr<PlatformTextTrack>> RemoteMediaPlayerProxy::outOfBandTrackSources()
 {
index aac36d0..b22630f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2019-2020 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -37,6 +37,7 @@
 #include "SandboxExtension.h"
 #include "TrackPrivateRemoteIdentifier.h"
 #include <WebCore/Cookie.h>
+#include <WebCore/InbandTextTrackPrivate.h>
 #include <WebCore/MediaPlayer.h>
 #include <WebCore/PlatformMediaResourceLoader.h>
 #include <wtf/LoggerHelper.h>
@@ -56,6 +57,7 @@ using LayerHostingContextID = uint32_t;
 class LayerHostingContext;
 class RemoteAudioTrackProxy;
 class RemoteMediaPlayerManagerProxy;
+class RemoteTextTrackProxy;
 class RemoteVideoTrackProxy;
 
 class RemoteMediaPlayerProxy final
@@ -105,6 +107,7 @@ public:
 
     void audioTrackSetEnabled(TrackPrivateRemoteIdentifier, bool);
     void videoTrackSetSelected(TrackPrivateRemoteIdentifier, bool);
+    void textTrackSetMode(TrackPrivateRemoteIdentifier, WebCore::InbandTextTrackPrivate::Mode);
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     void setWirelessVideoPlaybackDisabled(bool);
@@ -223,6 +226,8 @@ private:
 
     HashMap<WebCore::AudioTrackPrivate*, Ref<RemoteAudioTrackProxy>> m_audioTracks;
     HashMap<WebCore::VideoTrackPrivate*, Ref<RemoteVideoTrackProxy>> m_videoTracks;
+    HashMap<WebCore::InbandTextTrackPrivate*, Ref<RemoteTextTrackProxy>> m_textTracks;
+
     MediaPlayerPrivateRemoteIdentifier m_id;
     RefPtr<SandboxExtension> m_sandboxExtension;
     Ref<IPC::Connection> m_webProcessConnection;
index 3960707..8f8615a 100644 (file)
@@ -55,6 +55,7 @@ messages -> RemoteMediaPlayerProxy NotRefCounted {
 
     AudioTrackSetEnabled(WebKit::TrackPrivateRemoteIdentifier trackID, bool enabled)
     VideoTrackSetSelected(WebKit::TrackPrivateRemoteIdentifier trackID, bool enabled)
+    TextTrackSetMode(WebKit::TrackPrivateRemoteIdentifier trackID, enum:uint8_t WebCore::InbandTextTrackPrivate::Mode mode)
 
     # Paint
     # PaintCurrentFrameInContext
diff --git a/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp b/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp
new file mode 100644 (file)
index 0000000..80f78f7
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+* Copyright (C) 2020 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config.h"
+#include "RemoteTextTrackProxy.h"
+
+#if ENABLE(GPU_PROCESS)
+
+#include "MediaPlayerPrivateRemoteMessages.h"
+#include "RemoteMediaPlayerProxy.h"
+#include "TextTrackPrivateRemoteConfiguration.h"
+#include "TextTrackPrivateRemoteMessages.h"
+#include <WebCore/ISOVTTCue.h>
+#include <WebCore/NotImplemented.h>
+
+namespace WebKit {
+
+RemoteTextTrackProxy::RemoteTextTrackProxy(RemoteMediaPlayerProxy& player, TrackPrivateRemoteIdentifier id, Ref<IPC::Connection>&& connection, InbandTextTrackPrivate& trackPrivate)
+    : m_player(player)
+    , m_identifier(id)
+    , m_webProcessConnection(WTFMove(connection))
+    , m_trackPrivate(trackPrivate)
+{
+    m_trackPrivate->setClient(this);
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::AddRemoteTextTrack(m_identifier, configuration()), m_player.idendifier());
+}
+
+TextTrackPrivateRemoteConfiguration& RemoteTextTrackProxy::configuration()
+{
+    static NeverDestroyed<TextTrackPrivateRemoteConfiguration> configuration;
+
+    configuration->id = m_trackPrivate->id();
+    configuration->label = m_trackPrivate->label();
+    configuration->language = m_trackPrivate->language();
+    configuration->trackIndex = m_trackPrivate->trackIndex();
+    configuration->startTimeVariance = m_trackPrivate->startTimeVariance();
+
+    configuration->cueFormat = m_trackPrivate->cueFormat();
+    configuration->mode = m_trackPrivate->mode();
+    configuration->isClosedCaptions = m_trackPrivate->isClosedCaptions();
+    configuration->isSDH = m_trackPrivate->isSDH();
+    configuration->containsOnlyForcedSubtitles = m_trackPrivate->containsOnlyForcedSubtitles();
+    configuration->isMainProgramContent = m_trackPrivate->isMainProgramContent();
+    configuration->isEasyToRead = m_trackPrivate->isEasyToRead();
+    configuration->isDefault = m_trackPrivate->isDefault();
+    configuration->kind = m_trackPrivate->kind();
+
+    return configuration.get();
+}
+
+void RemoteTextTrackProxy::configurationChanged()
+{
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RemoteTextTrackConfigurationChanged(m_identifier, configuration()), m_player.idendifier());
+}
+
+void RemoteTextTrackProxy::willRemove()
+{
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RemoveRemoteTextTrack(m_identifier), m_player.idendifier());
+}
+
+void RemoteTextTrackProxy::idChanged(const AtomString&)
+{
+    configurationChanged();
+}
+
+void RemoteTextTrackProxy::labelChanged(const AtomString&)
+{
+    configurationChanged();
+}
+
+void RemoteTextTrackProxy::languageChanged(const AtomString&)
+{
+    configurationChanged();
+}
+
+void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, const void*, unsigned)
+{
+    notImplemented();
+}
+
+#if ENABLE(DATACUE_VALUE)
+void RemoteTextTrackProxy::addDataCue(const MediaTime&, const MediaTime&, Ref<SerializedPlatformRepresentation>&&, const String&)
+{
+    notImplemented();
+}
+
+void RemoteTextTrackProxy::updateDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&)
+{
+    notImplemented();
+}
+
+void RemoteTextTrackProxy::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformRepresentation&)
+{
+    notImplemented();
+}
+#endif
+
+void RemoteTextTrackProxy::addGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+void RemoteTextTrackProxy::updateGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+void RemoteTextTrackProxy::removeGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+void RemoteTextTrackProxy::parseWebVTTFileHeader(String&& header)
+{
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::ParseWebVTTFileHeader(m_identifier, header), m_player.idendifier());
+}
+
+void RemoteTextTrackProxy::parseWebVTTCueData(const char* data, unsigned length)
+{
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::ParseWebVTTCueData(m_identifier, IPC::DataReference(reinterpret_cast<const uint8_t*>(data), length)), m_player.idendifier());
+}
+
+void RemoteTextTrackProxy::parseWebVTTCueData(ISOWebVTTCue&& cueData)
+{
+    m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::ParseWebVTTCueDataStruct(m_identifier, cueData), m_player.idendifier());
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(GPU_PROCESS)
diff --git a/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h b/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.h
new file mode 100644 (file)
index 0000000..cf4a66a
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+* Copyright (C) 2020 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#pragma once
+
+#if ENABLE(GPU_PROCESS)
+
+#include "TrackPrivateRemoteIdentifier.h"
+#include <WebCore/InbandTextTrackPrivate.h>
+#include <WebCore/TrackBase.h>
+
+namespace WebKit {
+
+struct TextTrackPrivateRemoteConfiguration;
+
+class RemoteTextTrackProxy final
+    : public ThreadSafeRefCounted<RemoteTextTrackProxy, WTF::DestructionThread::Main>
+    , private WebCore::InbandTextTrackPrivateClient {
+public:
+    static Ref<RemoteTextTrackProxy> create(RemoteMediaPlayerProxy& player, TrackPrivateRemoteIdentifier id, Ref<IPC::Connection>&& connection, InbandTextTrackPrivate& trackPrivate)
+    {
+        return adoptRef(*new RemoteTextTrackProxy(player, id, WTFMove(connection), trackPrivate));
+    }
+
+    TrackPrivateRemoteIdentifier identifier() const { return m_identifier; };
+
+    void setMode(WebCore::InbandTextTrackPrivate::Mode mode) { m_trackPrivate->setMode(mode); }
+
+private:
+    RemoteTextTrackProxy(RemoteMediaPlayerProxy&, TrackPrivateRemoteIdentifier, Ref<IPC::Connection>&&, InbandTextTrackPrivate&);
+
+    // InbandTextTrackPrivateClient
+    virtual void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned);
+
+#if ENABLE(DATACUE_VALUE)
+    virtual void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
+    virtual void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+    virtual void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+#endif
+
+    virtual void addGenericCue(GenericCueData&);
+    virtual void updateGenericCue(GenericCueData&);
+    virtual void removeGenericCue(GenericCueData&);
+
+    virtual void parseWebVTTFileHeader(String&&);
+    virtual void parseWebVTTCueData(const char* data, unsigned length);
+    virtual void parseWebVTTCueData(ISOWebVTTCue&&);
+
+    // TrackPrivateBaseClient
+    void idChanged(const AtomString&) final;
+    void labelChanged(const AtomString&) final;
+    void languageChanged(const AtomString&) final;
+    void willRemove() final;
+
+    TextTrackPrivateRemoteConfiguration& configuration();
+    void configurationChanged();
+
+    RemoteMediaPlayerProxy& m_player;
+    TrackPrivateRemoteIdentifier m_identifier;
+    Ref<IPC::Connection> m_webProcessConnection;
+    Ref<InbandTextTrackPrivate> m_trackPrivate;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(GPU_PROCESS)
index 8c17e0d..bdb0eb0 100644 (file)
@@ -37,7 +37,7 @@ namespace WebKit {
 struct TrackPrivateRemoteConfiguration;
 
 class RemoteVideoTrackProxy final
-    : public ThreadSafeRefCounted<TrackPrivateBase, WTF::DestructionThread::Main>
+    : public ThreadSafeRefCounted<RemoteVideoTrackProxy, WTF::DestructionThread::Main>
     , private WebCore::VideoTrackPrivateClient {
 public:
     static Ref<RemoteVideoTrackProxy> create(RemoteMediaPlayerProxy& player, TrackPrivateRemoteIdentifier id, Ref<IPC::Connection>&& connection, VideoTrackPrivate& trackPrivate)
@@ -51,7 +51,6 @@ public:
 
 private:
     RemoteVideoTrackProxy(RemoteMediaPlayerProxy&, TrackPrivateRemoteIdentifier, Ref<IPC::Connection>&&, VideoTrackPrivate&);
-    ~RemoteVideoTrackProxy() = default;
 
     // VideoTrackPrivateClient
     void selectedChanged(bool) final;
diff --git a/Source/WebKit/GPUProcess/media/TextTrackPrivateRemoteConfiguration.h b/Source/WebKit/GPUProcess/media/TextTrackPrivateRemoteConfiguration.h
new file mode 100644 (file)
index 0000000..aa45b37
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(GPU_PROCESS)
+
+#include <WebCore/InbandTextTrackPrivate.h>
+#include <WebCore/TrackPrivateBase.h>
+#include <wtf/MediaTime.h>
+
+namespace WebKit {
+
+struct TextTrackPrivateRemoteConfiguration {
+    AtomString id;
+    AtomString label;
+    AtomString language;
+    AtomString inBandMetadataTrackDispatchType;
+    MediaTime startTimeVariance { MediaTime::zeroTime() };
+    int trackIndex;
+
+    WebCore::InbandTextTrackPrivate::CueFormat cueFormat { WebCore::InbandTextTrackPrivate::CueFormat::Generic };
+    WebCore::InbandTextTrackPrivate::Mode mode { WebCore::InbandTextTrackPrivate::Mode::Disabled };
+    WebCore::InbandTextTrackPrivate::Kind kind { WebCore::InbandTextTrackPrivate::Kind::None };
+
+    bool isClosedCaptions { false };
+    bool isSDH { false };
+    bool containsOnlyForcedSubtitles { false };
+    bool isMainProgramContent { true };
+    bool isEasyToRead { false };
+    bool isDefault { false };
+
+    template<class Encoder>
+    void encode(Encoder& encoder) const
+    {
+        encoder << id;
+        encoder << label;
+        encoder << language;
+        encoder << inBandMetadataTrackDispatchType;
+        encoder << startTimeVariance;
+        encoder << trackIndex;
+        encoder.encodeEnum(cueFormat);
+        encoder.encodeEnum(mode);
+        encoder.encodeEnum(kind);
+        encoder << isClosedCaptions;
+        encoder << isSDH;
+        encoder << containsOnlyForcedSubtitles;
+        encoder << isMainProgramContent;
+        encoder << isEasyToRead;
+        encoder << isDefault;
+    }
+
+    template <class Decoder>
+    static Optional<TextTrackPrivateRemoteConfiguration> decode(Decoder& decoder)
+    {
+        Optional<AtomString> id;
+        decoder >> id;
+        if (!id)
+            return WTF::nullopt;
+
+        Optional<AtomString> label;
+        decoder >> label;
+        if (!label)
+            return WTF::nullopt;
+
+        Optional<AtomString> language;
+        decoder >> language;
+        if (!language)
+            return WTF::nullopt;
+
+        Optional<AtomString> inBandMetadataTrackDispatchType;
+        decoder >> inBandMetadataTrackDispatchType;
+        if (!inBandMetadataTrackDispatchType)
+            return WTF::nullopt;
+
+        Optional<MediaTime> startTimeVariance;
+        decoder >> startTimeVariance;
+        if (!startTimeVariance)
+            return WTF::nullopt;
+
+        Optional<int> trackIndex;
+        decoder >> trackIndex;
+        if (!trackIndex)
+            return WTF::nullopt;
+
+        Optional<WebCore::InbandTextTrackPrivate::CueFormat> cueFormat;
+        decoder >> cueFormat;
+        if (!cueFormat)
+            return WTF::nullopt;
+
+        Optional<WebCore::InbandTextTrackPrivate::Mode> mode;
+        decoder >> mode;
+        if (!mode)
+            return WTF::nullopt;
+
+        Optional<WebCore::InbandTextTrackPrivate::Kind> kind;
+        decoder >> kind;
+        if (!kind)
+            return WTF::nullopt;
+
+        Optional<bool> isClosedCaptions;
+        decoder >> isClosedCaptions;
+        if (!isClosedCaptions)
+            return WTF::nullopt;
+
+        Optional<bool> isSDH;
+        decoder >> isSDH;
+        if (!isSDH)
+            return WTF::nullopt;
+
+        Optional<bool> containsOnlyForcedSubtitles;
+        decoder >> containsOnlyForcedSubtitles;
+        if (!containsOnlyForcedSubtitles)
+            return WTF::nullopt;
+
+        Optional<bool> isMainProgramContent;
+        decoder >> isMainProgramContent;
+        if (!isMainProgramContent)
+            return WTF::nullopt;
+
+        Optional<bool> isEasyToRead;
+        decoder >> isEasyToRead;
+        if (!isEasyToRead)
+            return WTF::nullopt;
+
+        Optional<bool> isDefault;
+        decoder >> isDefault;
+        if (!isDefault)
+            return WTF::nullopt;
+
+        return {{
+            WTFMove(*id),
+            WTFMove(*label),
+            WTFMove(*language),
+            WTFMove(*inBandMetadataTrackDispatchType),
+            WTFMove(*startTimeVariance),
+            *trackIndex,
+            *cueFormat,
+            *mode,
+            *kind,
+            *isClosedCaptions,
+            *isSDH,
+            *containsOnlyForcedSubtitles,
+            *isMainProgramContent,
+            *isEasyToRead,
+            *isDefault,
+        }};
+    }
+};
+
+
+} // namespace WebKit
+
+#endif
index 685a669..6e6a217 100644 (file)
@@ -32,6 +32,7 @@
 #include "MessageSender.h"
 #include "SampleBufferDisplayLayerIdentifier.h"
 #include <WebCore/SampleBufferDisplayLayer.h>
+#include <wtf/MediaTime.h>
 
 namespace WebCore {
 class ImageTransferSessionVT;
index 4b9be49..1b71b0c 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "Decoder.h"
 #include "RemoteSampleBufferDisplayLayer.h"
+#include <WebCore/IntSize.h>
 
 namespace WebKit {
 
@@ -47,7 +48,7 @@ void RemoteSampleBufferDisplayLayerManager::didReceiveLayerMessage(IPC::Connecti
 }
 
 // FIXME: We should refactor code to use an asynchronous IPC.
-void RemoteSampleBufferDisplayLayerManager::createLayer(SampleBufferDisplayLayerIdentifier identifier, bool hideRootLayer, IntSize size, Messages::RemoteSampleBufferDisplayLayerManager::CreateLayerDelayedReply&& reply)
+void RemoteSampleBufferDisplayLayerManager::createLayer(SampleBufferDisplayLayerIdentifier identifier, bool hideRootLayer, WebCore::IntSize size, Messages::RemoteSampleBufferDisplayLayerManager::CreateLayerDelayedReply&& reply)
 {
     ASSERT(!m_layers.contains(identifier));
     auto layer = RemoteSampleBufferDisplayLayer::create(identifier, m_connection.copyRef(), hideRootLayer, size);
index e38c5d6..940f743 100644 (file)
@@ -38,6 +38,10 @@ class Connection;
 class Decoder;
 }
 
+namespace WebCore {
+class IntSize;
+}
+
 namespace WebKit {
 
 class RemoteSampleBufferDisplayLayer;
index 4308c73..82db012 100644 (file)
@@ -620,6 +620,7 @@ def headers_for_type(type):
         'WebKit::WebTouchEvent': ['"WebEvent.h"'],
         'WebKit::WebWheelEvent': ['"WebEvent.h"'],
         'WebCore::MediaEngineSupportParameters': ['<WebCore/MediaPlayer.h>'],
+        'WebCore::ISOWebVTTCue': ['<WebCore/ISOVTTCue.h>'],
         'struct WebCore::ElementContext': ['<WebCore/ElementContext.h>'],
         'struct WebKit::WebUserScriptData': ['"WebUserContentControllerDataTypes.h"'],
         'struct WebKit::WebUserStyleSheetData': ['"WebUserContentControllerDataTypes.h"'],
index 5310920..74894bd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Apple Inc. All rights reserved.
+// Copyright (C) 2018-2020 Apple Inc. All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions
@@ -36,6 +36,7 @@ GPUProcess/media/RemoteMediaPlayerProxy.cpp
 GPUProcess/media/RemoteMediaResource.cpp
 GPUProcess/media/RemoteMediaResourceLoader.cpp
 GPUProcess/media/RemoteMediaResourceManager.cpp
+GPUProcess/media/RemoteTextTrackProxy.cpp
 GPUProcess/media/RemoteVideoTrackProxy.cpp
 
 NetworkProcess/AdClickAttributionManager.cpp
@@ -536,6 +537,7 @@ WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
 WebProcess/GPU/media/RemoteMediaPlayerManager.cpp
 WebProcess/GPU/media/RemoteMediaPlayerMIMETypeCache.cpp @no-unify
 WebProcess/GPU/media/RemoteMediaResourceProxy.cpp
+WebProcess/GPU/media/TextTrackPrivateRemote.cpp
 WebProcess/GPU/media/VideoTrackPrivateRemote.cpp
 WebProcess/GPU/webrtc/LibWebRTCCodecs.cpp
 WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp
index 131bd21..d4885b4 100644 (file)
                07E19EF823D401F00094FFB4 /* MediaPlayerPrivateRemoteMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateRemoteMessageReceiver.cpp; sourceTree = "<group>"; };
                07E19EF923D401F00094FFB4 /* MediaPlayerPrivateRemoteMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateRemoteMessages.h; sourceTree = "<group>"; };
                07E19EFA23D401F00094FFB4 /* MediaPlayerPrivateRemoteMessagesReplies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateRemoteMessagesReplies.h; sourceTree = "<group>"; };
+               07E19F0523D4DC880094FFB4 /* TextTrackPrivateRemoteConfiguration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextTrackPrivateRemoteConfiguration.h; sourceTree = "<group>"; };
+               07E19F0623D4DC880094FFB4 /* RemoteTextTrackProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RemoteTextTrackProxy.h; sourceTree = "<group>"; };
+               07E19F0723D4DC880094FFB4 /* RemoteTextTrackProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteTextTrackProxy.cpp; sourceTree = "<group>"; };
+               07E19F0823D533B90094FFB4 /* TextTrackPrivateRemote.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackPrivateRemote.cpp; sourceTree = "<group>"; };
+               07E19F0923D533BA0094FFB4 /* TextTrackPrivateRemote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextTrackPrivateRemote.h; sourceTree = "<group>"; };
                0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
                089C1667FE841158C02AAC07 /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
                0E97D74C200E8FF300BF6643 /* SafeBrowsingSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SafeBrowsingSPI.h; sourceTree = "<group>"; };
                                07B3B46F23AB2CB300BA5B12 /* RemoteMediaPlayerState.h */,
                                1D32F89D23A84C5B00B1EA6A /* RemoteMediaResourceProxy.cpp */,
                                1D32F89B23A84BA600B1EA6A /* RemoteMediaResourceProxy.h */,
+                               07E19F0823D533B90094FFB4 /* TextTrackPrivateRemote.cpp */,
+                               07E19F0923D533BA0094FFB4 /* TextTrackPrivateRemote.h */,
                                071BC58323CC2BD500680D7C /* VideoTrackPrivateRemote.cpp */,
                                071BC58223CC2BD300680D7C /* VideoTrackPrivateRemote.h */,
                        );
                                1DA4089E23A827780058C950 /* RemoteMediaResourceManager.cpp */,
                                1DA4089423A80A3E0058C950 /* RemoteMediaResourceManager.h */,
                                1D32F8A623A8601900B1EA6A /* RemoteMediaResourceManager.messages.in */,
+                               07E19F0723D4DC880094FFB4 /* RemoteTextTrackProxy.cpp */,
+                               07E19F0623D4DC880094FFB4 /* RemoteTextTrackProxy.h */,
                                071BC58423CC2C0900680D7C /* RemoteVideoTrackProxy.cpp */,
                                071BC58523CC2C0900680D7C /* RemoteVideoTrackProxy.h */,
+                               07E19F0523D4DC880094FFB4 /* TextTrackPrivateRemoteConfiguration.h */,
                                071BC57B23CA532400680D7C /* TrackPrivateRemoteConfiguration.h */,
                                071BC57D23CA56D200680D7C /* TrackPrivateRemoteIdentifier.h */,
                        );
index 4abc7bf..9dc0ebb 100644 (file)
@@ -33,6 +33,7 @@
 #include "RemoteMediaPlayerManagerProxyMessages.h"
 #include "RemoteMediaPlayerProxyMessages.h"
 #include "SandboxExtension.h"
+#include "TextTrackPrivateRemote.h"
 #include "VideoTrackPrivateRemote.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebProcess.h"
@@ -410,24 +411,79 @@ void MediaPlayerPrivateRemote::addRemoteAudioTrack(TrackPrivateRemoteIdentifier
     m_player->addAudioTrack(addResult.iterator->value);
 }
 
-void MediaPlayerPrivateRemote::removeRemoteAudioTrack(TrackPrivateRemoteIdentifier id)
+void MediaPlayerPrivateRemote::removeRemoteAudioTrack(TrackPrivateRemoteIdentifier identifier)
 {
-    ASSERT(m_audioTracks.contains(id));
+    ASSERT(m_audioTracks.contains(identifier));
 
-    if (auto* track = m_audioTracks.get(id)) {
+    if (auto* track = m_audioTracks.get(identifier)) {
         m_player->removeAudioTrack(*track);
-        m_audioTracks.remove(id);
+        m_audioTracks.remove(identifier);
     }
 }
 
-void MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged(TrackPrivateRemoteIdentifier id, TrackPrivateRemoteConfiguration&& configuration)
+void MediaPlayerPrivateRemote::remoteAudioTrackConfigurationChanged(TrackPrivateRemoteIdentifier identifier, TrackPrivateRemoteConfiguration&& configuration)
 {
-    ASSERT(m_audioTracks.contains(id));
+    ASSERT(m_audioTracks.contains(identifier));
 
-    if (const auto& track = m_audioTracks.get(id))
+    if (const auto& track = m_audioTracks.get(identifier))
         track->updateConfiguration(WTFMove(configuration));
 }
 
+void MediaPlayerPrivateRemote::addRemoteTextTrack(TrackPrivateRemoteIdentifier identifier, TextTrackPrivateRemoteConfiguration&& configuration)
+{
+    auto addResult = m_textTracks.ensure(identifier, [&] {
+        return TextTrackPrivateRemote::create(*this, identifier, WTFMove(configuration));
+    });
+    ASSERT(addResult.isNewEntry);
+
+    if (!addResult.isNewEntry)
+        return;
+
+    m_player->addTextTrack(addResult.iterator->value);
+}
+
+void MediaPlayerPrivateRemote::removeRemoteTextTrack(TrackPrivateRemoteIdentifier identifier)
+{
+    ASSERT(m_textTracks.contains(identifier));
+
+    if (auto* track = m_textTracks.get(identifier)) {
+        m_player->removeTextTrack(*track);
+        m_textTracks.remove(identifier);
+    }
+}
+
+void MediaPlayerPrivateRemote::remoteTextTrackConfigurationChanged(TrackPrivateRemoteIdentifier id, TextTrackPrivateRemoteConfiguration&& configuration)
+{
+    ASSERT(m_textTracks.contains(id));
+
+    if (const auto& track = m_textTracks.get(id))
+        track->updateConfiguration(WTFMove(configuration));
+}
+
+void MediaPlayerPrivateRemote::parseWebVTTFileHeader(TrackPrivateRemoteIdentifier identifier, String&& header)
+{
+    ASSERT(m_textTracks.contains(identifier));
+
+    if (const auto& track = m_textTracks.get(identifier))
+        track->parseWebVTTFileHeader(WTFMove(header));
+}
+
+void MediaPlayerPrivateRemote::parseWebVTTCueData(TrackPrivateRemoteIdentifier identifier, IPC::DataReference&& data)
+{
+    ASSERT(m_textTracks.contains(identifier));
+
+    if (const auto& track = m_textTracks.get(identifier))
+        track->parseWebVTTCueData(WTFMove(data));
+}
+
+void MediaPlayerPrivateRemote::parseWebVTTCueDataStruct(TrackPrivateRemoteIdentifier identifier, ISOWebVTTCue&& data)
+{
+    ASSERT(m_textTracks.contains(identifier));
+
+    if (const auto& track = m_textTracks.get(identifier))
+        track->parseWebVTTCueDataStruct(WTFMove(data));
+}
+
 void MediaPlayerPrivateRemote::addRemoteVideoTrack(TrackPrivateRemoteIdentifier identifier, TrackPrivateRemoteConfiguration&& configuration)
 {
     auto addResult = m_videoTracks.ensure(identifier, [&] {
index fa800c6..7f73904 100644 (file)
 #include <wtf/MediaTime.h>
 #include <wtf/WeakPtr.h>
 
+namespace WebCore {
+class ISOWebVTTCue;
+}
+
 namespace WebKit {
 
 class AudioTrackPrivateRemote;
+class TextTrackPrivateRemote;
 class VideoTrackPrivateRemote;
+struct TextTrackPrivateRemoteConfiguration;
 struct TrackPrivateRemoteConfiguration;
 
 class MediaPlayerPrivateRemote final
@@ -90,6 +96,14 @@ public:
     void removeRemoteVideoTrack(TrackPrivateRemoteIdentifier);
     void remoteVideoTrackConfigurationChanged(TrackPrivateRemoteIdentifier, TrackPrivateRemoteConfiguration&&);
 
+    void addRemoteTextTrack(TrackPrivateRemoteIdentifier, TextTrackPrivateRemoteConfiguration&&);
+    void removeRemoteTextTrack(TrackPrivateRemoteIdentifier);
+    void remoteTextTrackConfigurationChanged(TrackPrivateRemoteIdentifier, TextTrackPrivateRemoteConfiguration&&);
+
+    void parseWebVTTFileHeader(TrackPrivateRemoteIdentifier, String&&);
+    void parseWebVTTCueData(TrackPrivateRemoteIdentifier, IPC::DataReference&&);
+    void parseWebVTTCueDataStruct(TrackPrivateRemoteIdentifier, WebCore::ISOWebVTTCue&&);
+
     void requestResource(RemoteMediaResourceIdentifier, WebCore::ResourceRequest&&, WebCore::PlatformMediaResourceLoader::LoadOptions, CompletionHandler<void()>&&);
     void removeResource(RemoteMediaResourceIdentifier);
     void resourceNotSupported();
@@ -346,6 +360,7 @@ private:
     HashMap<RemoteMediaResourceIdentifier, RefPtr<WebCore::PlatformMediaResource>> m_mediaResources;
     HashMap<TrackPrivateRemoteIdentifier, Ref<AudioTrackPrivateRemote>> m_audioTracks;
     HashMap<TrackPrivateRemoteIdentifier, Ref<VideoTrackPrivateRemote>> m_videoTracks;
+    HashMap<TrackPrivateRemoteIdentifier, Ref<TextTrackPrivateRemote>> m_textTracks;
 
     double m_volume { 1 };
     double m_rate { 1 };
index fedc056..f459980 100644 (file)
@@ -42,6 +42,23 @@ messages -> MediaPlayerPrivateRemote NotRefCounted {
     RemoveRemoteAudioTrack(WebKit::TrackPrivateRemoteIdentifier trackID)
     RemoteAudioTrackConfigurationChanged(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TrackPrivateRemoteConfiguration configuration)
 
+    AddRemoteTextTrack(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TextTrackPrivateRemoteConfiguration configuration)
+    RemoveRemoteTextTrack(WebKit::TrackPrivateRemoteIdentifier trackID)
+    RemoteTextTrackConfigurationChanged(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TextTrackPrivateRemoteConfiguration configuration)
+
+    ParseWebVTTFileHeader(WebKit::TrackPrivateRemoteIdentifier trackID, String header)
+    ParseWebVTTCueData(WebKit::TrackPrivateRemoteIdentifier trackID, IPC::DataReference data)
+    ParseWebVTTCueDataStruct(WebKit::TrackPrivateRemoteIdentifier trackID, WebCore::ISOWebVTTCue cueData)
+
+    ## AddDataCue(MediaTime start, MediaTime end, IPC::DataReference data)
+    ## AddDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data, String type)
+    ## UpdateDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data)
+    ## RemoveDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data)
+
+    ## AddGenericCue(WebCore::GenericCueData cue)
+    ## UpdateGenericCue(WebCore::GenericCueData cue)
+    ## RemoveGenericCue(WebCore::GenericCueData cue)
+
     AddRemoteVideoTrack(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TrackPrivateRemoteConfiguration configuration)
     RemoveRemoteVideoTrack(WebKit::TrackPrivateRemoteIdentifier trackID)
     RemoteVideoTrackConfigurationChanged(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TrackPrivateRemoteConfiguration configuration)
diff --git a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp
new file mode 100644 (file)
index 0000000..b00040f
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+* Copyright (C) 2020 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config.h"
+#include "TextTrackPrivateRemote.h"
+
+#if ENABLE(GPU_PROCESS)
+
+#include "MediaPlayerPrivateRemote.h"
+#include "RemoteMediaPlayerProxyMessages.h"
+#include <WebCore/NotImplemented.h>
+
+namespace WebKit {
+
+TextTrackPrivateRemote::TextTrackPrivateRemote(MediaPlayerPrivateRemote& player, TrackPrivateRemoteIdentifier idendifier, TextTrackPrivateRemoteConfiguration&& configuration)
+    : WebCore::InbandTextTrackPrivate(configuration.cueFormat)
+    , m_player(player)
+    , m_idendifier(idendifier)
+{
+    updateConfiguration(WTFMove(configuration));
+}
+
+void TextTrackPrivateRemote::setMode(TextTrackMode mode)
+{
+    if (mode != m_mode)
+        m_player.connection().send(Messages::RemoteMediaPlayerProxy::TextTrackSetMode(m_idendifier, mode), m_player.itentifier());
+
+    InbandTextTrackPrivate::setMode(mode);
+}
+
+void TextTrackPrivateRemote::updateConfiguration(TextTrackPrivateRemoteConfiguration&& configuration)
+{
+    if (configuration.id != m_id) {
+        auto changed = !m_id.isEmpty();
+        m_id = configuration.id;
+        if (changed && client())
+            client()->idChanged(m_id);
+    }
+
+    if (configuration.label != m_label) {
+        auto changed = !m_label.isEmpty();
+        m_label = configuration.label;
+        if (changed && client())
+            client()->labelChanged(m_label);
+    }
+
+    if (configuration.language != m_language) {
+        auto changed = !m_language.isEmpty();
+        m_language = configuration.language;
+        if (changed && client())
+            client()->languageChanged(m_language);
+    }
+
+    m_trackIndex = configuration.trackIndex;
+    m_startTimeVariance = configuration.startTimeVariance;
+
+    m_format = configuration.cueFormat;
+    m_kind = configuration.kind;
+    m_mode = configuration.mode;
+    m_isClosedCaptions = configuration.isClosedCaptions;
+    m_isSDH = configuration.isSDH;
+    m_containsOnlyForcedSubtitles = configuration.containsOnlyForcedSubtitles;
+    m_isMainProgramContent = configuration.isMainProgramContent;
+    m_isEasyToRead = configuration.isEasyToRead;
+    m_isDefault = configuration.isDefault;
+}
+
+void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned)
+{
+    notImplemented();
+}
+
+#if ENABLE(DATACUE_VALUE)
+void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&)
+{
+    notImplemented();
+}
+
+void TextTrackPrivateRemote::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&)
+{
+    notImplemented();
+}
+
+void TextTrackPrivateRemote::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&)
+{
+    notImplemented();
+}
+
+#endif
+
+void TextTrackPrivateRemote::addGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+void TextTrackPrivateRemote::updateGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+void TextTrackPrivateRemote::removeGenericCue(GenericCueData&)
+{
+    notImplemented();
+}
+
+
+void TextTrackPrivateRemote::parseWebVTTFileHeader(String&& header)
+{
+    ASSERT(client());
+    if (auto* client = this->client())
+        client->parseWebVTTFileHeader(WTFMove(header));
+}
+
+void TextTrackPrivateRemote::parseWebVTTCueData(const IPC::DataReference& data)
+{
+    ASSERT(client());
+    if (auto* client = this->client())
+        client->parseWebVTTCueData(reinterpret_cast<const char*>(data.data()), data.size());
+}
+
+void TextTrackPrivateRemote::parseWebVTTCueDataStruct(ISOWebVTTCue&& cueData)
+{
+    ASSERT(client());
+    if (auto* client = this->client())
+        client->parseWebVTTCueData(WTFMove(cueData));
+}
+
+
+} // namespace WebKit
+
+#endif // ENABLE(GPU_PROCESS)
diff --git a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h
new file mode 100644 (file)
index 0000000..6cf3975
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+* Copyright (C) 2020 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+*
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#pragma once
+
+#if ENABLE(GPU_PROCESS)
+
+#include "TextTrackPrivateRemoteConfiguration.h"
+#include "TrackPrivateRemoteIdentifier.h"
+#include <WebCore/InbandTextTrackPrivate.h>
+
+namespace WebKit {
+
+class MediaPlayerPrivateRemote;
+
+class TextTrackPrivateRemote final : public WebCore::InbandTextTrackPrivate {
+    WTF_MAKE_NONCOPYABLE(TextTrackPrivateRemote)
+public:
+    static Ref<TextTrackPrivateRemote> create(MediaPlayerPrivateRemote& player, TrackPrivateRemoteIdentifier idendifier, TextTrackPrivateRemoteConfiguration&& configuration)
+    {
+        return adoptRef(*new TextTrackPrivateRemote(player, idendifier, WTFMove(configuration)));
+    }
+
+    void addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned);
+
+#if ENABLE(DATACUE_VALUE)
+    void addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformRepresentation>&&, const String&);
+    void updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+    void removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformRepresentation&);
+#endif
+
+    void addGenericCue(GenericCueData&);
+    void updateGenericCue(GenericCueData&);
+    void removeGenericCue(GenericCueData&);
+
+    void parseWebVTTFileHeader(String&&);
+    void parseWebVTTCueData(const IPC::DataReference&);
+    void parseWebVTTCueDataStruct(ISOWebVTTCue&&);
+
+    void updateConfiguration(TextTrackPrivateRemoteConfiguration&&);
+
+    AtomString id() const final { return m_id; }
+    AtomString label() const final { return m_label; }
+    AtomString language() const final { return m_language; }
+    int trackIndex() const final { return m_trackIndex; }
+
+    using TextTrackCueFormat = WebCore::InbandTextTrackPrivate::CueFormat;
+    TextTrackCueFormat cueFormat() const final { return m_format; }
+
+    using TextTrackKind = WebCore::InbandTextTrackPrivate::Kind;
+    TextTrackKind kind() const final { return m_kind; }
+
+    using TextTrackMode = WebCore::InbandTextTrackPrivate::Mode;
+    void setMode(TextTrackMode) final;
+    TextTrackMode mode() const final { return m_mode; }
+
+    bool isClosedCaptions() const final { return m_isClosedCaptions; }
+    bool isSDH() const final { return m_isSDH; }
+    bool containsOnlyForcedSubtitles() const final { return m_containsOnlyForcedSubtitles; }
+    bool isMainProgramContent() const final { return m_isMainProgramContent; }
+    bool isEasyToRead() const final { return m_isEasyToRead; }
+    bool isDefault() const final { return m_isDefault; }
+
+protected:
+    TextTrackPrivateRemote(MediaPlayerPrivateRemote&, TrackPrivateRemoteIdentifier, TextTrackPrivateRemoteConfiguration&&);
+
+    MediaPlayerPrivateRemote& m_player;
+    AtomString m_id;
+    AtomString m_label;
+    AtomString m_language;
+    int m_trackIndex { -1 };
+    MediaTime m_startTimeVariance { MediaTime::zeroTime() };
+    TrackPrivateRemoteIdentifier m_idendifier;
+
+    TextTrackCueFormat m_format { TextTrackCueFormat::Generic };
+    TextTrackKind m_kind { TextTrackKind::None };
+    TextTrackMode m_mode { TextTrackMode::Disabled };
+    bool m_isClosedCaptions { false };
+    bool m_isSDH { false };
+    bool m_containsOnlyForcedSubtitles { false };
+    bool m_isMainProgramContent { true };
+    bool m_isEasyToRead { false };
+    bool m_isDefault { false };
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.messages.in b/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.messages.in
new file mode 100644 (file)
index 0000000..e4919ce
--- /dev/null
@@ -0,0 +1,43 @@
+# Copyright (C) 2020 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(GPU_PROCESS)
+
+messages -> TextTrackPrivateRemote NotRefCounted {
+    ConfigurationChanged(WebKit::TrackPrivateRemoteIdentifier trackID, struct WebKit::TextTrackPrivateRemoteConfiguration configuration)
+
+    ParseWebVTTFileHeader(WebKit::TrackPrivateRemoteIdentifier trackID, String header)
+    ParseWebVTTCueData(WebKit::TrackPrivateRemoteIdentifier trackID, IPC::DataReference data)
+    ParseWebVTTCueDataStruct(WebKit::TrackPrivateRemoteIdentifier trackID, WebCore::ISOWebVTTCue cueData)
+
+    ## AddDataCue(MediaTime start, MediaTime end, IPC::DataReference data)
+    ## AddDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data, String type)
+    ## UpdateDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data)
+    ## RemoveDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformRepresentation data)
+
+    ## AddGenericCue(WebCore::GenericCueData cue)
+    ## UpdateGenericCue(WebCore::GenericCueData cue)
+    ## RemoveGenericCue(WebCore::GenericCueData cue)
+}
+
+#endif