Changeset 257125 in webkit
- Timestamp:
- Feb 20, 2020 7:35:50 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 32 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r257101 r257125 1 2020-02-20 Eric Carlson <eric.carlson@apple.com> 2 3 Support in-band metadata cues when loading media in the GPU Process 4 https://bugs.webkit.org/show_bug.cgi?id=207904 5 <rdar://problem/59561647> 6 7 Reviewed by Dean Jackson. 8 9 * gpu-process/TestExpectations: 10 1 11 2020-02-20 Jason Lawrence <lawrence.j@apple.com> 2 12 -
trunk/LayoutTests/gpu-process/TestExpectations
r256353 r257125 230 230 http/tests/media/track/track-webvtt-slow-loading-2.html [ Pass ] 231 231 http/tests/media/hls/hls-webvtt-tracks.html [ Pass ] 232 http/tests/media/track-in-band-hls-metadata.html [ Pass ] 233 http/tests/media/track-in-band-hls-metadata-crash.html [ Pass ] 232 234 233 235 accessibility/media-element.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r257123 r257125 1 2020-02-20 Eric Carlson <eric.carlson@apple.com> 2 3 Support in-band metadata cues when loading media in the GPU Process 4 https://bugs.webkit.org/show_bug.cgi?id=207904 5 <rdar://problem/59561647> 6 7 Reviewed by Dean Jackson. 8 9 No new tests, unskipped existing tests. 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * html/HTMLMediaElement.cpp: 13 (WebCore::HTMLMediaElement::selectMediaResource): 14 (WebCore::HTMLMediaElement::play): 15 (WebCore::HTMLMediaElement::mediaEngineWasUpdated): 16 (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): 17 * html/track/InbandDataTextTrack.cpp: 18 (WebCore::InbandDataTextTrack::addDataCue): 19 (WebCore::InbandDataTextTrack::findIncompleteCue): 20 (WebCore::InbandDataTextTrack::updateDataCue): 21 (WebCore::InbandDataTextTrack::removeDataCue): 22 (WebCore::InbandDataTextTrack::removeCue): 23 * html/track/InbandDataTextTrack.h: 24 * html/track/TextTrack.cpp: 25 (WebCore::TextTrack::addCue): 26 * html/track/TextTrack.h: 27 (WebCore::TextTrack::cuesInternal const): 28 * html/track/TextTrackCue.cpp: 29 (WebCore::TextTrackCue::cueIndex const): 30 * platform/SerializedPlatformDataCue.h: 31 (WebCore::SerializedPlatformDataCue::deserialize const): 32 (WebCore::SerializedPlatformDataCue::data const): 33 (WebCore::SerializedPlatformDataCue::isEqual const): 34 (WebCore::SerializedPlatformDataCue::platformType const): 35 (WebCore::SerializedPlatformDataCue::encodingRequiresPlatformData const): 36 (WebCore::SerializedPlatformDataCue::encodableValue const): 37 * platform/graphics/MediaPlayer.cpp: 38 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 39 (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): 40 * platform/mac/SerializedPlatformDataCueMac.h: 41 * platform/mac/SerializedPlatformDataCueMac.mm: 42 (WebCore::SerializedPlatformDataCue::create): 43 (WebCore::SerializedPlatformDataCueMac::SerializedPlatformDataCueMac): 44 (WebCore::SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac): 45 (WebCore::SerializedPlatformDataCueMac::isEqual const): 46 (WebCore::toSerializedPlatformDataCueMac): 47 (WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues): 48 (WebCore::SerializedPlatformDataCueMac::encodableValue const): 49 (WebCore::jsValueWithAVMetadataItemInContext): 50 (WebCore::NSDictionaryWithAVMetadataItem): 51 (WebCore::SerializedPlatformDataCueMac::create): Deleted. 52 1 53 2020-02-20 Sunny He <sunny_he@apple.com> 2 54 -
trunk/Source/WebCore/Headers.cmake
r256892 r257125 999 999 platform/SearchPopupMenu.h 1000 1000 platform/SerializedPlatformDataCue.h 1001 platform/SerializedPlatformDataCueValue.h 1001 1002 platform/SharedBuffer.h 1002 1003 platform/SharedStringHash.h -
trunk/Source/WebCore/Sources.txt
r256892 r257125 1765 1765 platform/ScrollbarTheme.cpp 1766 1766 platform/ScrollbarThemeComposite.cpp 1767 platform/SerializedPlatformDataCue.cpp 1767 1768 platform/SharedBuffer.cpp 1768 1769 platform/SharedBufferChunkReader.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r256892 r257125 136 136 076970861463AD8700F502CF /* TextTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076970841463AD8700F502CF /* TextTrackList.cpp */; }; 137 137 076970871463AD8700F502CF /* TextTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = 076970851463AD8700F502CF /* TextTrackList.h */; }; 138 076D1C1F23F6EB5B00D95B06 /* SerializedPlatformDataCueValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 138 139 076F0D0E12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 076F0D0A12B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.h */; }; 139 140 077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; }; 140 141 077AF14018F4AE400001ED61 /* SerializedPlatformDataCue.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */; settings = {ATTRIBUTES = (Private, ); }; }; 141 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */; };142 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 077AF14118F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; 142 143 077B64131B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64111B94F12E003E9AD5 /* MediaPlaybackTargetPickerMock.h */; settings = {ATTRIBUTES = (Private, ); }; }; 143 144 077B64171B95F703003E9AD5 /* MediaPlaybackTargetMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 077B64151B95F703003E9AD5 /* MediaPlaybackTargetMock.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5474 5475 076970841463AD8700F502CF /* TextTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextTrackList.cpp; sourceTree = "<group>"; }; 5475 5476 076970851463AD8700F502CF /* TextTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackList.h; sourceTree = "<group>"; }; 5477 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SerializedPlatformDataCueValue.h; sourceTree = "<group>"; }; 5476 5478 076E11BE1F683E0D00177395 /* TrackPrivateBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TrackPrivateBase.cpp; sourceTree = "<group>"; }; 5477 5479 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaPlayerPrivateAVFoundation.cpp; sourceTree = "<group>"; }; … … 5491 5493 07846341145B151A00A58DF1 /* JSTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackEvent.h; sourceTree = "<group>"; }; 5492 5494 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackCustom.h; sourceTree = "<group>"; }; 5495 078633D723FE09640087AE21 /* SerializedPlatformDataCue.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SerializedPlatformDataCue.cpp; sourceTree = "<group>"; }; 5493 5496 0787C4671BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaTrackSupportedConstraints.cpp; sourceTree = "<group>"; }; 5494 5497 0787C4681BFBDF6F006DCD7F /* JSMediaTrackSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaTrackSupportedConstraints.h; sourceTree = "<group>"; }; … … 25995 25998 BC6D6E2509AF943500F59759 /* ScrollView.h */, 25996 25999 AB7170880B3118080017123E /* SearchPopupMenu.h */, 26000 078633D723FE09640087AE21 /* SerializedPlatformDataCue.cpp */, 25997 26001 077AF13E18F4AE400001ED61 /* SerializedPlatformDataCue.h */, 26002 076D1C1D23F6D9D800D95B06 /* SerializedPlatformDataCueValue.h */, 25998 26003 1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */, 25999 26004 1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */, … … 32255 32260 077AF14018F4AE400001ED61 /* SerializedPlatformDataCue.h in Headers */, 32256 32261 077AF14318F4B1BB0001ED61 /* SerializedPlatformDataCueMac.h in Headers */, 32262 076D1C1F23F6EB5B00D95B06 /* SerializedPlatformDataCueValue.h in Headers */, 32257 32263 A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */, 32258 32264 516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */, -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r257039 r257125 1333 1333 ASSERT(m_player); 1334 1334 if (!m_player) { 1335 ERROR_LOG(logSiteIdentifier, " 1335 ERROR_LOG(logSiteIdentifier, "has srcAttr but m_player is not created"); 1336 1336 return; 1337 1337 } … … 3474 3474 if (success.value() == MediaPlaybackDenialReason::UserGestureRequired) 3475 3475 setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); 3476 ERROR_LOG(LOGIDENTIFIER, "rejecting promise: ", success.value()); 3476 3477 promise.reject(NotAllowedError); 3477 3478 return; … … 3479 3480 3480 3481 if (m_error && m_error->code() == MediaError::MEDIA_ERR_SRC_NOT_SUPPORTED) { 3482 ERROR_LOG(LOGIDENTIFIER, "rejecting promise because of error"); 3481 3483 promise.reject(NotSupportedError, "The operation is not supported."); 3482 3484 return; … … 3496 3498 auto success = m_mediaSession->playbackPermitted(); 3497 3499 if (!success) { 3500 ERROR_LOG(LOGIDENTIFIER, "playback not permitted: ", success.value()); 3498 3501 if (success.value() == MediaPlaybackDenialReason::UserGestureRequired) 3499 3502 setAutoplayEventPlaybackState(AutoplayEventPlaybackState::PreventedAutoplay); … … 5095 5098 void HTMLMediaElement::mediaEngineWasUpdated() 5096 5099 { 5097 INFO_LOG(LOGIDENTIFIER); 5100 ALWAYS_LOG(LOGIDENTIFIER); 5101 5098 5102 beginProcessingMediaPlayerCallback(); 5099 5103 updateRenderer(); … … 5130 5134 void HTMLMediaElement::mediaPlayerEngineUpdated() 5131 5135 { 5132 INFO_LOG(LOGIDENTIFIER );5136 INFO_LOG(LOGIDENTIFIER, m_player->engineDescription()); 5133 5137 5134 5138 #if ENABLE(MEDIA_SOURCE) -
trunk/Source/WebCore/html/track/InbandDataTextTrack.cpp
r256536 r257125 60 60 void InbandDataTextTrack::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& platformValue, const String& type) 61 61 { 62 if ( m_incompleteCueMap.contains(platformValue.ptr()))62 if (findIncompleteCue(platformValue)) 63 63 return; 64 64 … … 71 71 if (end.isPositiveInfinite() && mediaElement()) { 72 72 cue->setEndTime(mediaElement()->durationMediaTime()); 73 m_incompleteCueMap.a dd(WTFMove(platformValue), cue.copyRef());73 m_incompleteCueMap.append(&cue.get()); 74 74 } 75 75 … … 79 79 } 80 80 81 RefPtr<DataCue> InbandDataTextTrack::findIncompleteCue(const SerializedPlatformDataCue& cueToFind) 82 { 83 auto index = m_incompleteCueMap.findMatching([&](const auto& cue) { 84 return cueToFind.isEqual(*cue->platformValue()); 85 }); 86 87 if (index == notFound) 88 return nullptr; 89 90 return m_incompleteCueMap[index]; 91 } 92 81 93 void InbandDataTextTrack::updateDataCue(const MediaTime& start, const MediaTime& inEnd, SerializedPlatformDataCue& platformValue) 82 94 { 83 RefPtr<DataCue> cue = m_incompleteCueMap.get(&platformValue);95 auto cue = findIncompleteCue(platformValue); 84 96 if (!cue) 85 97 return; … … 91 103 end = mediaElement()->durationMediaTime(); 92 104 else 93 m_incompleteCueMap.remove (&platformValue);105 m_incompleteCueMap.removeFirst(cue); 94 106 95 107 INFO_LOG(LOGIDENTIFIER, "was start = ", cue->startMediaTime(), ", end = ", cue->endMediaTime(), ", will be start = ", start, ", end = ", end); … … 103 115 void InbandDataTextTrack::removeDataCue(const MediaTime&, const MediaTime&, SerializedPlatformDataCue& platformValue) 104 116 { 105 if (auto cue = m_incompleteCueMap.take(&platformValue)) {117 if (auto cue = findIncompleteCue(platformValue)) { 106 118 INFO_LOG(LOGIDENTIFIER, "removing: ", *cue); 119 m_incompleteCueMap.removeFirst(cue); 107 120 InbandTextTrack::removeCue(*cue); 108 121 } … … 113 126 ASSERT(cue.cueType() == TextTrackCue::Data); 114 127 115 m_incompleteCueMap.remove(const_cast<SerializedPlatformDataCue*>(toDataCue(&cue)->platformValue())); 128 if (auto platformValue = const_cast<SerializedPlatformDataCue*>(toDataCue(&cue)->platformValue())) 129 removeDataCue({ }, { }, *platformValue); 116 130 117 131 return InbandTextTrack::removeCue(cue); -
trunk/Source/WebCore/html/track/InbandDataTextTrack.h
r256536 r257125 56 56 ExceptionOr<void> removeCue(TextTrackCue&) final; 57 57 58 HashMap<RefPtr<SerializedPlatformDataCue>, RefPtr<DataCue>> m_incompleteCueMap; 58 RefPtr<DataCue> findIncompleteCue(const SerializedPlatformDataCue&); 59 60 Vector<RefPtr<DataCue>> m_incompleteCueMap; 59 61 #endif 60 62 }; -
trunk/Source/WebCore/html/track/TextTrack.h
r256353 r257125 97 97 TextTrackCueList* activeCues() const; 98 98 99 TextTrackCueList* cuesInternal() const { return m_cues.get(); } 100 99 101 void clearClient() override { m_client = nullptr; } 100 102 TextTrackClient* client() { return m_client; } -
trunk/Source/WebCore/html/track/TextTrackCue.cpp
r254767 r257125 342 342 unsigned TextTrackCue::cueIndex() const 343 343 { 344 ASSERT(m_track && m_track->cues ());345 if (!m_track || !m_track->cues ())344 ASSERT(m_track && m_track->cuesInternal()); 345 if (!m_track || !m_track->cuesInternal()) 346 346 return std::numeric_limits<unsigned>::max(); 347 347 348 return m_track->cues ()->cueIndex(*this);348 return m_track->cuesInternal()->cueIndex(*this); 349 349 } 350 350 -
trunk/Source/WebCore/platform/SerializedPlatformDataCue.cpp
r257124 r257125 1 1 /* 2 * Copyright (C) 20 17-2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include " TrackPrivateBase.h"27 #include "SerializedPlatformDataCue.h" 28 28 29 #if ENABLE(VIDEO_TRACK) 30 31 #include "Logging.h" 32 #include <wtf/LoggerHelper.h> 29 #if ENABLE(VIDEO_TRACK) && ENABLE(DATACUE_VALUE) 33 30 34 31 namespace WebCore { 35 32 36 static uint64_t s_uniqueId = 0; 37 38 #if !RELEASE_LOG_DISABLED 39 void TrackPrivateBase::setLogger(const Logger& logger, const void* logIdentifier) 33 #if !PLATFORM(COCOA) 34 Ref<SerializedPlatformDataCue> SerializedPlatformDataCue::create(SerializedPlatformDataCueValue&&) 40 35 { 41 m_logger = &logger; 42 m_logIdentifier = childLogIdentifier(logIdentifier, ++s_uniqueId); 43 } 44 45 WTFLogChannel& TrackPrivateBase::logChannel() const 46 { 47 return LogMedia; 36 return adoptRef(*new SerializedPlatformDataCue()); 48 37 } 49 38 #endif -
trunk/Source/WebCore/platform/SerializedPlatformDataCue.h
r256536 r257125 28 28 #if ENABLE(VIDEO) 29 29 30 #include "SerializedPlatformDataCueValue.h" 30 31 #include <JavaScriptCore/JSCInlines.h> 31 32 #include <wtf/RefCounted.h> … … 35 36 class SerializedPlatformDataCue : public RefCounted<SerializedPlatformDataCue> { 36 37 public: 38 WEBCORE_EXPORT static Ref<SerializedPlatformDataCue> create(SerializedPlatformDataCueValue&&); 39 37 40 virtual ~SerializedPlatformDataCue() = default; 38 41 39 virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const = 0;40 virtual RefPtr<JSC::ArrayBuffer> data() const = 0;41 virtual bool isEqual(const SerializedPlatformDataCue&) const = 0;42 virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const { return JSC::jsNull(); } 43 virtual RefPtr<JSC::ArrayBuffer> data() const { return { }; } 44 virtual bool isEqual(const SerializedPlatformDataCue&) const { return false; } 42 45 43 enum PlatformType { 46 enum class PlatformType { 47 None, 44 48 ObjC, 45 49 }; 46 virtual PlatformType platformType() const = 0; 50 virtual PlatformType platformType() const { return PlatformType::None; } 51 52 virtual bool encodingRequiresPlatformData() const { return false; } 53 54 virtual SerializedPlatformDataCueValue encodableValue() const { return { }; } 47 55 48 56 protected: -
trunk/Source/WebCore/platform/SerializedPlatformDataCueValue.h
r257124 r257125 1 1 /* 2 * Copyright (C) 20 14-2020 Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 28 28 #if ENABLE(VIDEO) 29 29 30 #include <JavaScriptCore/JSCInlines.h> 31 #include <wtf/RefCounted.h> 30 #include <wtf/IsoMalloc.h> 31 #include <wtf/RetainPtr.h> 32 33 #if !defined(__OBJC__) 34 typedef struct objc_object *id; 35 #endif 36 37 #if PLATFORM(COCOA) 38 using PlatformNativeValue = id; 39 #else 40 using PlatformNativeValue = void*; 41 #endif 32 42 33 43 namespace WebCore { 34 44 35 class SerializedPlatformDataCue : public RefCounted<SerializedPlatformDataCue> { 45 class SerializedPlatformDataCueValue { 46 WTF_MAKE_ISO_ALLOCATED(SerializedPlatformDataCueValue); 36 47 public: 37 virtual ~SerializedPlatformDataCue() = default; 38 39 virtual JSC::JSValue deserialize(JSC::JSGlobalObject*) const = 0; 40 virtual RefPtr<JSC::ArrayBuffer> data() const = 0; 41 virtual bool isEqual(const SerializedPlatformDataCue&) const = 0; 42 43 enum PlatformType { 48 enum class PlatformType { 49 None, 44 50 ObjC, 45 51 }; 46 virtual PlatformType platformType() const = 0; 52 53 SerializedPlatformDataCueValue(PlatformType platformType, PlatformNativeValue nativeValue) 54 : m_nativeValue(nativeValue) 55 , m_type(platformType) 56 { 57 } 58 SerializedPlatformDataCueValue() = default; 59 ~SerializedPlatformDataCueValue() = default; 60 61 PlatformType platformType() const { return m_type; } 62 63 PlatformNativeValue nativeValue() const { return m_nativeValue; } 64 65 bool encodingRequiresPlatformData() const { return m_type == PlatformType::ObjC; } 47 66 48 67 protected: 49 SerializedPlatformDataCue() = default; 68 PlatformNativeValue m_nativeValue { nullptr }; 69 PlatformType m_type { PlatformType::None }; 50 70 }; 51 71 -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r254964 r257125 110 110 void pause() final { } 111 111 112 String engineDescription() const final { return "NullMediaPlayer"; } 113 112 114 PlatformLayer* platformLayer() const final { return nullptr; } 113 115 -
trunk/Source/WebCore/platform/graphics/TrackPrivateBase.cpp
r256353 r257125 34 34 namespace WebCore { 35 35 36 #if !RELEASE_LOG_DISABLED 37 36 38 static uint64_t s_uniqueId = 0; 37 39 38 #if !RELEASE_LOG_DISABLED39 40 void TrackPrivateBase::setLogger(const Logger& logger, const void* logIdentifier) 40 41 { -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r256839 r257125 3075 3075 type = metadataType(item.keySpace); 3076 3076 3077 m_metadataTrack->addDataCue(start, end, SerializedPlatformDataCue Mac::create(item), type);3077 m_metadataTrack->addDataCue(start, end, SerializedPlatformDataCue::create({ WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC, item }), type); 3078 3078 } 3079 3079 #endif -
trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.h
r256536 r257125 30 30 #include "SerializedPlatformDataCue.h" 31 31 32 #if USE(FOUNDATION) && !defined(__OBJC__)33 typedef struct objc_object *id;34 #endif35 36 32 namespace WebCore { 37 33 38 34 class SerializedPlatformDataCueMac final : public SerializedPlatformDataCue { 39 35 public: 40 virtual ~SerializedPlatformDataCueMac();41 static Ref<SerializedPlatformDataCue> create(id);36 SerializedPlatformDataCueMac(SerializedPlatformDataCueValue&&); 37 virtual ~SerializedPlatformDataCueMac() = default; 42 38 43 39 JSC::JSValue deserialize(JSC::JSGlobalObject*) const final; 44 40 RefPtr<ArrayBuffer> data() const final; 41 bool isEqual(const SerializedPlatformDataCue&) const final; 42 PlatformType platformType() const final { return PlatformType::ObjC; } 43 bool encodingRequiresPlatformData() const final { return true; } 45 44 46 bool isEqual(const SerializedPlatformDataCue&) const final; 47 48 PlatformType platformType() const final { return SerializedPlatformDataCue::ObjC; } 45 WEBCORE_EXPORT SerializedPlatformDataCueValue encodableValue() const final; 49 46 50 47 id nativeValue() const { return m_nativeValue.get(); } 51 48 49 WEBCORE_EXPORT static NSArray *allowedClassesForNativeValues(); 50 52 51 private: 53 explicit SerializedPlatformDataCueMac(id nativeValue);54 52 55 53 RetainPtr<id> m_nativeValue; -
trunk/Source/WebCore/platform/mac/SerializedPlatformDataCueMac.mm
r256536 r257125 49 49 static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *, JSContext *); 50 50 static JSValue *jsValueWithValueInContext(id, JSContext *); 51 #endif 52 53 SerializedPlatformDataCueMac::SerializedPlatformDataCueMac(id nativeValue) 51 static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *); 52 #endif 53 54 Ref<SerializedPlatformDataCue> SerializedPlatformDataCue::create(SerializedPlatformDataCueValue&& value) 55 { 56 return adoptRef(*new SerializedPlatformDataCueMac(WTFMove(value))); 57 } 58 59 SerializedPlatformDataCueMac::SerializedPlatformDataCueMac(SerializedPlatformDataCueValue&& value) 54 60 : SerializedPlatformDataCue() 55 , m_nativeValue(nativeValue) 56 { 57 } 58 59 SerializedPlatformDataCueMac::~SerializedPlatformDataCueMac() 60 { 61 } 62 63 Ref<SerializedPlatformDataCue> SerializedPlatformDataCueMac::create(id nativeValue) 64 { 65 return adoptRef(*new SerializedPlatformDataCueMac(nativeValue)); 61 , m_nativeValue(value.nativeValue()) 62 { 63 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(value.platformType() == SerializedPlatformDataCueValue::PlatformType::ObjC); 66 64 } 67 65 … … 90 88 bool SerializedPlatformDataCueMac::isEqual(const SerializedPlatformDataCue& other) const 91 89 { 92 if (other.platformType() != SerializedPlatformDataCue::ObjC)90 if (other.platformType() != PlatformType::ObjC) 93 91 return false; 94 92 … … 108 106 const SerializedPlatformDataCueMac* toSerializedPlatformDataCueMac(const SerializedPlatformDataCue* rep) 109 107 { 110 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformDataCue:: ObjC);108 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(rep->platformType() == SerializedPlatformDataCue::PlatformType::ObjC); 111 109 return static_cast<const SerializedPlatformDataCueMac*>(rep); 110 } 111 112 NSArray *SerializedPlatformDataCueMac::allowedClassesForNativeValues() 113 { 114 static NeverDestroyed<RetainPtr<NSArray>> allowedClasses(@[ [NSString class], [NSNumber class], [NSLocale class], [NSDictionary class], [NSArray class], [NSData class] ]); 115 return allowedClasses.get().get(); 116 } 117 118 SerializedPlatformDataCueValue SerializedPlatformDataCueMac::encodableValue() const 119 { 120 if ([m_nativeValue.get() isKindOfClass:PAL::getAVMetadataItemClass()]) 121 return { SerializedPlatformDataCueValue::PlatformType::ObjC, NSDictionaryWithAVMetadataItem(m_nativeValue.get()) }; 122 123 return { SerializedPlatformDataCueValue::PlatformType::ObjC, m_nativeValue.get() }; 112 124 } 113 125 … … 194 206 195 207 static JSValue *jsValueWithAVMetadataItemInContext(AVMetadataItem *item, JSContext *context) 208 { 209 return jsValueWithDictionaryInContext(NSDictionaryWithAVMetadataItem(item), context); 210 } 211 212 static NSDictionary *NSDictionaryWithAVMetadataItem(AVMetadataItem *item) 196 213 { 197 214 NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; … … 231 248 [dictionary setObject:item.value forKey:@"data"]; 232 249 233 return jsValueWithDictionaryInContext(dictionary, context);250 return dictionary; 234 251 } 235 252 #endif -
trunk/Source/WebKit/ChangeLog
r257106 r257125 1 2020-02-20 Eric Carlson <eric.carlson@apple.com> 2 3 Support in-band metadata cues when loading media in the GPU Process 4 https://bugs.webkit.org/show_bug.cgi?id=207904 5 <rdar://problem/59561647> 6 7 Reviewed by Dean Jackson. 8 9 * GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in: 10 * GPUProcess/media/RemoteTextTrackProxy.cpp: 11 (WebKit::RemoteTextTrackProxy::addDataCue): 12 (WebKit::RemoteTextTrackProxy::updateDataCue): 13 (WebKit::RemoteTextTrackProxy::removeDataCue): 14 * Shared/WebCoreArgumentCoders.cpp: 15 (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode): 16 (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode): 17 * Shared/WebCoreArgumentCoders.h: 18 * Shared/mac/WebCoreArgumentCodersMac.mm: 19 (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData): 20 (IPC::ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData): 21 * WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp: 22 (WebKit::MediaPlayerPrivateRemote::MediaPlayerPrivateRemote): 23 (WebKit::MediaPlayerPrivateRemote::setConfiguration): 24 (WebKit::MediaPlayerPrivateRemote::addDataCue): 25 (WebKit::MediaPlayerPrivateRemote::addDataCueWithType): 26 (WebKit::MediaPlayerPrivateRemote::updateDataCue): 27 (WebKit::MediaPlayerPrivateRemote::removeDataCue): 28 * WebProcess/GPU/media/MediaPlayerPrivateRemote.h: 29 * WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in: 30 * WebProcess/GPU/media/RemoteMediaPlayerManager.cpp: 31 (WebKit::RemoteMediaPlayerManager::createRemoteMediaPlayer): 32 * WebProcess/GPU/media/RemoteMediaPlayerManager.h: 33 * WebProcess/GPU/media/TextTrackPrivateRemote.cpp: 34 (WebKit::TextTrackPrivateRemote::addGenericCue): 35 (WebKit::TextTrackPrivateRemote::updateGenericCue): 36 (WebKit::TextTrackPrivateRemote::removeGenericCue): 37 (WebKit::TextTrackPrivateRemote::parseWebVTTFileHeader): 38 (WebKit::TextTrackPrivateRemote::parseWebVTTCueData): 39 (WebKit::TextTrackPrivateRemote::parseWebVTTCueDataStruct): 40 (WebKit::TextTrackPrivateRemote::addDataCue): 41 (WebKit::TextTrackPrivateRemote::addDataCueWithType): 42 (WebKit::TextTrackPrivateRemote::updateDataCue): 43 (WebKit::TextTrackPrivateRemote::removeDataCue): 44 * WebProcess/GPU/media/TextTrackPrivateRemote.h: 45 1 46 2020-02-20 John Wilander <wilander@apple.com> 2 47 -
trunk/Source/WebKit/GPUProcess/media/RemoteMediaPlayerManagerProxy.messages.in
r254784 r257125 25 25 26 26 messages -> RemoteMediaPlayerManagerProxy NotRefCounted { 27 CreateMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id, enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, struct WebKit::RemoteMediaPlayerProxyConfiguration proxyConfiguration) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Synchronous28 DeleteMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id)27 CreateMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id, enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, struct WebKit::RemoteMediaPlayerProxyConfiguration proxyConfiguration) -> (struct WebKit::RemoteMediaPlayerConfiguration playerConfiguration) Async 28 DeleteMediaPlayer(WebKit::MediaPlayerPrivateRemoteIdentifier id) 29 29 30 30 GetSupportedTypes(enum:uint8_t WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier) -> (Vector<String> types) Synchronous -
trunk/Source/WebKit/GPUProcess/media/RemoteTextTrackProxy.cpp
r256536 r257125 97 97 } 98 98 99 void RemoteTextTrackProxy::addDataCue(const MediaTime& , const MediaTime&, const void*, unsigned)99 void RemoteTextTrackProxy::addDataCue(const MediaTime& start, const MediaTime& end, const void* data, unsigned length) 100 100 { 101 notImplemented();101 m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::AddDataCue(m_identifier, start, end, IPC::DataReference(reinterpret_cast<const uint8_t*>(data), length)), m_player.idendifier()); 102 102 } 103 103 104 104 #if ENABLE(DATACUE_VALUE) 105 void RemoteTextTrackProxy::addDataCue(const MediaTime& , const MediaTime&, Ref<SerializedPlatformDataCue>&&, const String&)105 void RemoteTextTrackProxy::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&& cueData, const String& type) 106 106 { 107 notImplemented();107 m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::AddDataCueWithType(m_identifier, start, end, cueData->encodableValue(), type), m_player.idendifier()); 108 108 } 109 109 110 void RemoteTextTrackProxy::updateDataCue(const MediaTime& , const MediaTime&, SerializedPlatformDataCue&)110 void RemoteTextTrackProxy::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue& cueData) 111 111 { 112 notImplemented();112 m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::UpdateDataCue(m_identifier, start, end, cueData.encodableValue()), m_player.idendifier()); 113 113 } 114 114 115 void RemoteTextTrackProxy::removeDataCue(const MediaTime& , const MediaTime&, SerializedPlatformDataCue&)115 void RemoteTextTrackProxy::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue& cueData) 116 116 { 117 notImplemented();117 m_webProcessConnection->send(Messages::MediaPlayerPrivateRemote::RemoveDataCue(m_identifier, start, end, cueData.encodableValue()), m_player.idendifier()); 118 118 } 119 119 #endif -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp
r255785 r257125 76 76 #include <WebCore/SecurityOrigin.h> 77 77 #include <WebCore/SerializedAttachmentData.h> 78 #include <WebCore/SerializedPlatformDataCueValue.h> 78 79 #include <WebCore/ServiceWorkerClientData.h> 79 80 #include <WebCore/ServiceWorkerClientIdentifier.h> … … 3175 3176 #endif // ENABLE(ATTACHMENT_ELEMENT) 3176 3177 3178 #if ENABLE(VIDEO) 3179 void ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encode(Encoder& encoder, const SerializedPlatformDataCueValue& value) 3180 { 3181 bool hasPlatformData = value.encodingRequiresPlatformData(); 3182 encoder << hasPlatformData; 3183 3184 encoder.encodeEnum(value.platformType()); 3185 if (hasPlatformData) 3186 encodePlatformData(encoder, value); 3187 } 3188 3189 Optional<SerializedPlatformDataCueValue> ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decode(IPC::Decoder& decoder) 3190 { 3191 bool hasPlatformData; 3192 if (!decoder.decode(hasPlatformData)) 3193 return WTF::nullopt; 3194 3195 WebCore::SerializedPlatformDataCueValue::PlatformType type; 3196 if (!decoder.decodeEnum(type)) 3197 return WTF::nullopt; 3198 3199 if (hasPlatformData) 3200 return decodePlatformData(decoder, type); 3201 3202 return {{ }}; 3203 } 3204 #endif 3205 3177 3206 } // namespace IPC -
trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h
r254817 r257125 38 38 #include <WebCore/RealtimeMediaSource.h> 39 39 #include <WebCore/ScrollSnapOffsetsInfo.h> 40 #include <WebCore/SerializedPlatformDataCueValue.h> 40 41 #include <WebCore/ServiceWorkerTypes.h> 41 42 #include <WebCore/StoredCredentialsPolicy.h> … … 820 821 #endif // ENABLE(ATTACHMENT_ELEMENT) 821 822 823 #if ENABLE(VIDEO) 824 template<> struct ArgumentCoder<WebCore::SerializedPlatformDataCueValue> { 825 static void encode(Encoder&, const WebCore::SerializedPlatformDataCueValue&); 826 static Optional<WebCore::SerializedPlatformDataCueValue> decode(Decoder&); 827 static void encodePlatformData(Encoder&, const WebCore::SerializedPlatformDataCueValue&); 828 static Optional<WebCore::SerializedPlatformDataCueValue> decodePlatformData(Decoder&, WebCore::SerializedPlatformDataCueValue::PlatformType); 829 }; 830 #endif 831 822 832 } // namespace IPC 823 833 -
trunk/Source/WebKit/Shared/curl/WebCoreArgumentCodersCurl.cpp
r254202 r257125 247 247 } 248 248 249 } 249 #if ENABLE(VIDEO) 250 void ArgumentCoder<SerializedPlatformDataCueValue>::encodePlatformData(Encoder& encoder, const SerializedPlatformDataCueValue& value) 251 { 252 ASSERT_NOT_REACHED(); 253 } 254 255 Optional<SerializedPlatformDataCueValue> ArgumentCoder<SerializedPlatformDataCueValue>::decodePlatformData(Decoder& decoder, WebCore::SerializedPlatformDataCueValue::PlatformType platformType) 256 { 257 ASSERT_NOT_REACHED(); 258 return WTF::nullopt; 259 } 260 #endif 261 262 } -
trunk/Source/WebKit/Shared/mac/WebCoreArgumentCodersMac.mm
r255784 r257125 38 38 #import <WebCore/ResourceError.h> 39 39 #import <WebCore/ResourceRequest.h> 40 #import <WebCore/SerializedPlatformDataCueMac.h> 40 41 #import <pal/spi/cf/CFNetworkSPI.h> 41 42 #import <wtf/MachSendRight.h> … … 670 671 #endif 671 672 673 #if ENABLE(VIDEO) 674 void ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::encodePlatformData(Encoder& encoder, const WebCore::SerializedPlatformDataCueValue& value) 675 { 676 ASSERT(value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC); 677 if (value.platformType() == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC) 678 encodeObject(encoder, value.nativeValue()); 679 } 680 681 Optional<WebCore::SerializedPlatformDataCueValue> ArgumentCoder<WebCore::SerializedPlatformDataCueValue>::decodePlatformData(Decoder& decoder, WebCore::SerializedPlatformDataCueValue::PlatformType platformType) 682 { 683 ASSERT(platformType == WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC); 684 685 if (platformType != WebCore::SerializedPlatformDataCueValue::PlatformType::ObjC) 686 return WTF::nullopt; 687 688 auto object = decodeObject(decoder, WebCore::SerializedPlatformDataCueMac::allowedClassesForNativeValues()); 689 if (!object) 690 return WTF::nullopt; 691 692 return WebCore::SerializedPlatformDataCueValue { platformType, object.value().get() }; 693 } 694 #endif 695 672 696 } // namespace IPC -
trunk/Source/WebKit/Shared/soup/WebCoreArgumentCodersSoup.cpp
r254202 r257125 264 264 } 265 265 266 } 267 266 #if ENABLE(VIDEO) 267 void ArgumentCoder<SerializedPlatformDataCueValue>::encodePlatformData(Encoder& encoder, const SerializedPlatformDataCueValue& value) 268 { 269 ASSERT_NOT_REACHED(); 270 } 271 272 Optional<SerializedPlatformDataCueValue> ArgumentCoder<SerializedPlatformDataCueValue>::decodePlatformData(Decoder& decoder, WebCore::SerializedPlatformDataCueValue::PlatformType platformType) 273 { 274 ASSERT_NOT_REACHED(); 275 return WTF::nullopt; 276 } 277 #endif 278 279 } 280 -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
r256353 r257125 68 68 #endif 69 69 70 MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager , const RemoteMediaPlayerConfiguration& configuration)70 MediaPlayerPrivateRemote::MediaPlayerPrivateRemote(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier engineIdentifier, MediaPlayerPrivateRemoteIdentifier playerIdentifier, RemoteMediaPlayerManager& manager) 71 71 : m_player(player) 72 72 , m_mediaResourceLoader(player->createResourceLoader()) … … 74 74 , m_remoteEngineIdentifier(engineIdentifier) 75 75 , m_id(playerIdentifier) 76 , m_configuration(configuration)77 76 #if !RELEASE_LOG_DISABLED 78 77 , m_logger(&player->mediaPlayerLogger()) … … 81 80 { 82 81 INFO_LOG(LOGIDENTIFIER); 82 } 83 84 void MediaPlayerPrivateRemote::setConfiguration(RemoteMediaPlayerConfiguration&& configuration) 85 { 86 m_configuration = WTFMove(configuration); 87 m_player->mediaEngineUpdated(); 83 88 } 84 89 … … 485 490 } 486 491 492 void MediaPlayerPrivateRemote::addDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, IPC::DataReference&& data) 493 { 494 ASSERT(m_textTracks.contains(identifier)); 495 496 if (const auto& track = m_textTracks.get(identifier)) 497 track->addDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); 498 } 499 500 #if ENABLE(DATACUE_VALUE) 501 void MediaPlayerPrivateRemote::addDataCueWithType(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data, String&& type) 502 { 503 ASSERT(m_textTracks.contains(identifier)); 504 505 if (const auto& track = m_textTracks.get(identifier)) 506 track->addDataCueWithType(WTFMove(start), WTFMove(end), WTFMove(data), WTFMove(type)); 507 } 508 509 void MediaPlayerPrivateRemote::updateDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data) 510 { 511 ASSERT(m_textTracks.contains(identifier)); 512 513 if (const auto& track = m_textTracks.get(identifier)) 514 track->updateDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); 515 } 516 517 void MediaPlayerPrivateRemote::removeDataCue(TrackPrivateRemoteIdentifier identifier, MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& data) 518 { 519 ASSERT(m_textTracks.contains(identifier)); 520 521 if (const auto& track = m_textTracks.get(identifier)) 522 track->removeDataCue(WTFMove(start), WTFMove(end), WTFMove(data)); 523 } 524 #endif 525 487 526 void MediaPlayerPrivateRemote::addRemoteVideoTrack(TrackPrivateRemoteIdentifier identifier, TrackPrivateRemoteConfiguration&& configuration) 488 527 { -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
r256353 r257125 41 41 namespace WebCore { 42 42 class ISOWebVTTCue; 43 class SerializedPlatformDataCueValue; 43 44 } 44 45 … … 47 48 class AudioTrackPrivateRemote; 48 49 class TextTrackPrivateRemote; 50 class UserData; 49 51 class VideoTrackPrivateRemote; 50 52 struct TextTrackPrivateRemoteConfiguration; … … 60 62 { 61 63 public: 62 static std::unique_ptr<MediaPlayerPrivateRemote> create(WebCore::MediaPlayer* player, WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, MediaPlayerPrivateRemoteIdentifier identifier, RemoteMediaPlayerManager& manager , const RemoteMediaPlayerConfiguration& configuration)64 static std::unique_ptr<MediaPlayerPrivateRemote> create(WebCore::MediaPlayer* player, WebCore::MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier, MediaPlayerPrivateRemoteIdentifier identifier, RemoteMediaPlayerManager& manager) 63 65 { 64 return makeUnique<MediaPlayerPrivateRemote>(player, remoteEngineIdentifier, identifier, manager , configuration);66 return makeUnique<MediaPlayerPrivateRemote>(player, remoteEngineIdentifier, identifier, manager); 65 67 } 66 68 67 MediaPlayerPrivateRemote(WebCore::MediaPlayer*, WebCore::MediaPlayerEnums::MediaEngineIdentifier, MediaPlayerPrivateRemoteIdentifier, RemoteMediaPlayerManager& , const RemoteMediaPlayerConfiguration&);69 MediaPlayerPrivateRemote(WebCore::MediaPlayer*, WebCore::MediaPlayerEnums::MediaEngineIdentifier, MediaPlayerPrivateRemoteIdentifier, RemoteMediaPlayerManager&); 68 70 ~MediaPlayerPrivateRemote(); 71 72 void setConfiguration(RemoteMediaPlayerConfiguration&&); 69 73 70 74 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final; … … 105 109 void parseWebVTTCueDataStruct(TrackPrivateRemoteIdentifier, WebCore::ISOWebVTTCue&&); 106 110 111 void addDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, IPC::DataReference&&); 112 #if ENABLE(DATACUE_VALUE) 113 void addDataCueWithType(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&, String&&); 114 void updateDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&); 115 void removeDataCue(TrackPrivateRemoteIdentifier, MediaTime&& start, MediaTime&& end, WebCore::SerializedPlatformDataCueValue&&); 116 #endif 117 107 118 void requestResource(RemoteMediaResourceIdentifier, WebCore::ResourceRequest&&, WebCore::PlatformMediaResourceLoader::LoadOptions, CompletionHandler<void()>&&); 108 119 void removeResource(RemoteMediaResourceIdentifier); -
trunk/Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
r256536 r257125 51 51 ParseWebVTTCueDataStruct(WebKit::TrackPrivateRemoteIdentifier trackID, WebCore::ISOWebVTTCue cueData) 52 52 53 ## AddDataCue(MediaTime start, MediaTime end, IPC::DataReference data) 54 ## AddDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data, String type) 55 ## UpdateDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data) 56 ## RemoveDataCue(MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCue data) 53 AddDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, IPC::DataReference data) 54 #if ENABLE(DATACUE_VALUE) 55 AddDataCueWithType(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData, String type) 56 UpdateDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData) 57 RemoveDataCue(WebKit::TrackPrivateRemoteIdentifier trackID, MediaTime start, MediaTime end, WebCore::SerializedPlatformDataCueValue cueData) 58 #endif 57 59 58 60 ## AddGenericCue(WebCore::GenericCueData cue) -
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.cpp
r255346 r257125 145 145 std::unique_ptr<MediaPlayerPrivateInterface> RemoteMediaPlayerManager::createRemoteMediaPlayer(MediaPlayer* player, MediaPlayerEnums::MediaEngineIdentifier remoteEngineIdentifier) 146 146 { 147 auto id = MediaPlayerPrivateRemoteIdentifier::generate();148 147 149 148 RemoteMediaPlayerProxyConfiguration proxyConfiguration; … … 160 159 proxyConfiguration.isVideo = player->isVideoPlayer(); 161 160 161 auto identifier = MediaPlayerPrivateRemoteIdentifier::generate(); 162 162 RemoteMediaPlayerConfiguration playerConfiguration; 163 bool sendSucceeded = gpuProcessConnection().connection().sendSync(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(id, remoteEngineIdentifier, proxyConfiguration), Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer::Reply(playerConfiguration), 0); 164 if (!sendSucceeded) { 165 WTFLogAlways("Failed to create remote media player."); 166 return nullptr; 167 } 168 169 auto remotePlayer = MediaPlayerPrivateRemote::create(player, remoteEngineIdentifier, id, *this, playerConfiguration); 170 m_players.add(id, makeWeakPtr(*remotePlayer)); 163 gpuProcessConnection().connection().sendWithAsyncReply(Messages::RemoteMediaPlayerManagerProxy::CreateMediaPlayer(identifier, remoteEngineIdentifier, proxyConfiguration), [this, weakThis = makeWeakPtr(this), identifier](auto&& playerConfiguration) { 164 if (!weakThis) 165 return; 166 167 if (const auto& player = m_players.get(identifier)) 168 player->setConfiguration(WTFMove(playerConfiguration)); 169 }, 0); 170 171 auto remotePlayer = MediaPlayerPrivateRemote::create(player, remoteEngineIdentifier, identifier, *this); 172 m_players.add(identifier, makeWeakPtr(*remotePlayer)); 173 171 174 return remotePlayer; 172 175 } -
trunk/Source/WebKit/WebProcess/GPU/media/RemoteMediaPlayerManager.h
r254809 r257125 52 52 53 53 class RemoteMediaPlayerManager 54 : public WebProcessSupplement { 54 : public WebProcessSupplement 55 , public CanMakeWeakPtr<RemoteMediaPlayerManager> { 55 56 WTF_MAKE_FAST_ALLOCATED; 56 57 public: -
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.cpp
r256536 r257125 89 89 } 90 90 91 void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, const void*, unsigned)92 {93 notImplemented();94 }95 96 #if ENABLE(DATACUE_VALUE)97 void TextTrackPrivateRemote::addDataCue(const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&)98 {99 notImplemented();100 }101 102 void TextTrackPrivateRemote::updateDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&)103 {104 notImplemented();105 }106 107 void TextTrackPrivateRemote::removeDataCue(const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&)108 {109 notImplemented();110 }111 112 #endif113 114 91 void TextTrackPrivateRemote::addGenericCue(GenericCueData&) 115 92 { … … 149 126 } 150 127 128 void TextTrackPrivateRemote::addDataCue(MediaTime&& start, MediaTime&& end, IPC::DataReference&& data) 129 { 130 ASSERT(client()); 131 if (auto* client = this->client()) 132 client->addDataCue(WTFMove(start), WTFMove(end), reinterpret_cast<const char*>(data.data()), data.size()); 133 } 134 135 #if ENABLE(DATACUE_VALUE) 136 void TextTrackPrivateRemote::addDataCueWithType(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue, String&& type) 137 { 138 ASSERT(client()); 139 if (auto* client = this->client()) 140 client->addDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue)), type); 141 } 142 143 void TextTrackPrivateRemote::updateDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue) 144 { 145 ASSERT(client()); 146 if (auto* client = this->client()) 147 client->updateDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue))); 148 } 149 150 void TextTrackPrivateRemote::removeDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&& dataValue) 151 { 152 ASSERT(client()); 153 if (auto* client = this->client()) 154 client->removeDataCue(WTFMove(start), WTFMove(end), SerializedPlatformDataCue::create(WTFMove(dataValue))); 155 } 156 #endif 151 157 152 158 } // namespace WebKit -
trunk/Source/WebKit/WebProcess/GPU/media/TextTrackPrivateRemote.h
r256536 r257125 33 33 #include <WebCore/InbandTextTrackPrivate.h> 34 34 35 namespace WebCore { 36 class GenericCueData; 37 class ISOWebVTTCue; 38 } 39 35 40 namespace WebKit { 36 41 … … 45 50 } 46 51 47 void addDataCue( const MediaTime& start, const MediaTime& end, const void*, unsigned);52 void addDataCue(MediaTime&& start, MediaTime&& end, IPC::DataReference&&); 48 53 49 54 #if ENABLE(DATACUE_VALUE) 50 void addDataCue (const MediaTime& start, const MediaTime& end, Ref<SerializedPlatformDataCue>&&, const String&);51 void updateDataCue( const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&);52 void removeDataCue( const MediaTime& start, const MediaTime& end, SerializedPlatformDataCue&);55 void addDataCueWithType(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&, String&&); 56 void updateDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&); 57 void removeDataCue(MediaTime&& start, MediaTime&& end, SerializedPlatformDataCueValue&&); 53 58 #endif 54 59 55 void addGenericCue( GenericCueData&);56 void updateGenericCue( GenericCueData&);57 void removeGenericCue( GenericCueData&);60 void addGenericCue(WebCore::GenericCueData&); 61 void updateGenericCue(WebCore::GenericCueData&); 62 void removeGenericCue(WebCore::GenericCueData&); 58 63 59 64 void parseWebVTTFileHeader(String&&); 60 65 void parseWebVTTCueData(const IPC::DataReference&); 61 void parseWebVTTCueDataStruct( ISOWebVTTCue&&);66 void parseWebVTTCueDataStruct(WebCore::ISOWebVTTCue&&); 62 67 63 68 void updateConfiguration(TextTrackPrivateRemoteConfiguration&&);
Note: See TracChangeset
for help on using the changeset viewer.