WebKit Bugzilla
Attachment 360315 Details for
Bug 193889
: AVStreamSession isn't always available, make a HAVE compile flag for it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193889-20190127202422.patch (text/plain), 33.47 KB, created by
Eric Carlson
on 2019-01-27 20:24:23 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2019-01-27 20:24:23 PST
Size:
33.47 KB
patch
obsolete
>Subversion Revision: 240548 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 3ac1016e7c4f426c21d347f2920b177be5b6081d..7a10d0fe5b818161409f133e9ff051501008ee2d 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2019-01-25 Yusuke Suzuki <ysuzuki@apple.com> > > [JSC] NativeErrorConstructor should not have own IsoSubspace >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 6e84d9c1fcc59a99f414b93c6238f15e0e7d29a1..9d6aa77a8720bba6fdeb6dbccfc63562a249628b 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/FeatureDefines.h: >+ > 2019-01-25 Chris Dumez <cdumez@apple.com> > > [iOS] Add support for the download attribute >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f8099584ab8f69a4bf454e85977e532fb6556cfc..2a9ea581ae154db8ccc0c5f4f7d83b335f95d596 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,52 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, not functional change. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * page/Settings.yaml: >+ * page/SettingsBase.cpp: >+ (WebCore::SettingsBase::platformDefaultMediaSourceEnabled): >+ * page/SettingsBase.h: >+ * page/cocoa/SettingsBaseCocoa.mm: >+ (WebCore::SettingsBase::platformDefaultMediaSourceEnabled): >+ * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: >+ (WebCore::CDMPrivateMediaSourceAVFObjC::createSession): >+ * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h: >+ * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: >+ >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: >+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging. >+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): >+ >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: >+ * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: >+ >+ Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC. >+ >+ (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo >+ -> isEqualToString. >+ (WebCore::sourceBufferMap): >+ (WebCore::nextMapID): >+ (WebCore::bufferWasConsumedCallback): >+ (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): >+ (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): >+ (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID): >+ (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): >+ (WebCore::SourceBufferPrivateAVFObjC::append): >+ (WebCore::SourceBufferPrivateAVFObjC::destroyParser): >+ (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): >+ (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): >+ (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed): >+ (-[WebBufferConsumedContext initWithParent:]): Deleted. >+ (-[WebBufferConsumedContext parent]): Deleted. >+ > 2019-01-26 Zalan Bujtas <zalan@apple.com> > > [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0. >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index cd4dc6c23bc99b49099259826aaeb3c2b35909a7..a8101d5d519af5530faf3fc16a1777c26a8e8b70 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * pal/spi/mac/AVFoundationSPI.h: >+ > 2019-01-25 Alex Christensen <achristensen@webkit.org> > > Move logic from ChildProcess::setApplicationIsDaemon to NetworkProcess::initializeProcess >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6aae160ba07f1b6ecb14a86ac29d0a3111717493..de1b33e7459788207db479f3eb0d71688a24b129 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2019-01-25 Tim Horton <timothy_horton@apple.com> > > REGRESSION (r238818): Snapshot is removed too late after swiping back on Twitter >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 3c6d71db37f7ba5bc917c242e8aa5f098e327462..21b044ae020f7138a43ef5068431462cd888cfd1 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2019-01-25 Keith Rollin <krollin@apple.com> > > Update WebKitAdditions.xcconfig with correct order of variable definitions >diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; > >diff --git a/Source/WTF/wtf/FeatureDefines.h b/Source/WTF/wtf/FeatureDefines.h >index 7f177559519b215633658832992aed32b2668a22..7bbf97099b0b5eb65d4cd898ac6bae712e591a89 100644 >--- a/Source/WTF/wtf/FeatureDefines.h >+++ b/Source/WTF/wtf/FeatureDefines.h >@@ -177,6 +177,14 @@ the public iOS SDK. See <https://webkit.org/b/179167>. */ > #endif > #endif > >+#if !defined(HAVE_AVSTREAMSESSION) >+#define HAVE_AVSTREAMSESSION 0 >+#endif >+ >+#if !defined(ENABLE_MEDIA_SOURCE) >+#define ENABLE_MEDIA_SOURCE 0 >+#endif >+ > #endif /* PLATFORM(IOS_FAMILY) */ > > /* --------- Apple WATCHOS port --------- */ >@@ -255,6 +263,14 @@ the public iOS SDK. See <https://webkit.org/b/179167>. */ > #define ENABLE_WEBPROCESS_WINDOWSERVER_BLOCKING ENABLE_WEBPROCESS_NSRUNLOOP > #endif > >+#if !defined(HAVE_AVSTREAMSESSION) >+#define HAVE_AVSTREAMSESSION 1 >+#endif >+ >+#if !defined(ENABLE_MEDIA_SOURCE) >+#define ENABLE_MEDIA_SOURCE 1 >+#endif >+ > #endif /* PLATFORM(MAC) */ > > #if PLATFORM(COCOA) >diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; > >diff --git a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; > >diff --git a/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h b/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h >index fb30cc863daf8bf379abb0d0419a8fdda3e805d5..ff6bf8085e917918084e1d0db7615a9d4c8fe69c 100644 >--- a/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h >+++ b/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h >@@ -40,7 +40,7 @@ > #import <AVKit/AVPlayerViewController_WebKitOnly.h> > #endif > >-#if !PLATFORM(IOS_FAMILY) >+#if ENABLE(MEDIA_SOURCE) > #import <AVFoundation/AVStreamDataParser.h> > #endif > >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index ca4c57c869f4950881ba840d8bb649102eb3257e..4989faaa0efc3529e9ec129b126ecac605961ddd 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -450,7 +450,7 @@ useGiantTiles: > initial: false > > mediaSourceEnabled: >- initial: true >+ initial: platformDefaultMediaSourceEnabled() > conditional: MEDIA_SOURCE > > sourceBufferChangeTypeEnabled: >diff --git a/Source/WebCore/page/SettingsBase.cpp b/Source/WebCore/page/SettingsBase.cpp >index cd4c4e8118f151520a2c02b2b41343fcedd2e782..c318eceef55a4ff390e9118b700771517ef35553 100644 >--- a/Source/WebCore/page/SettingsBase.cpp >+++ b/Source/WebCore/page/SettingsBase.cpp >@@ -117,6 +117,13 @@ void SettingsBase::initializeDefaultFontFamilies() > } > #endif > >+#if ENABLE(MEDIA_SOURCE) && !PLATFORM(COCOA) >+bool SettingsBase::platformDefaultMediaSourceEnabled() >+{ >+ return true; >+} >+#endif >+ > const AtomicString& SettingsBase::standardFontFamily(UScriptCode script) const > { > return m_fontGenericFamilies->standardFontFamily(script); >diff --git a/Source/WebCore/page/SettingsBase.h b/Source/WebCore/page/SettingsBase.h >index d6471c24d9ebc70da937afab59bcbad01e119dfd..d74e34adeaf48fa48621cfc0d352c85bd5c89ac8 100644 >--- a/Source/WebCore/page/SettingsBase.h >+++ b/Source/WebCore/page/SettingsBase.h >@@ -116,6 +116,10 @@ public: > WEBCORE_EXPORT static float defaultMinimumZoomFontSize(); > WEBCORE_EXPORT static bool defaultDownloadableBinaryFontsEnabled(); > >+#if ENABLE(MEDIA_SOURCE) >+ static bool platformDefaultMediaSourceEnabled(); >+#endif >+ > static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 512; > static const unsigned defaultMaximumRenderTreeDepth = 512; > >diff --git a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >index 179742289bd22b1634c2589d2e7a560abf8f012c..57f825df99559f0935738a38b36917bd8f9e28e7 100644 >--- a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >+++ b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >@@ -90,6 +90,11 @@ void SettingsBase::initializeDefaultFontFamilies() > setSansSerifFontFamily("Helvetica", USCRIPT_COMMON); > } > >+bool SettingsBase::platformDefaultMediaSourceEnabled() >+{ >+ return true; >+} >+ > #else > > void SettingsBase::initializeDefaultFontFamilies() >diff --git a/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm >index a5cbf34b66151a2218ba8fead6d756251e30f292..54ec37de0adcb2a5d8ecf68970d35fbd2b4b8afc 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm >@@ -124,7 +124,11 @@ std::unique_ptr<LegacyCDMSession> CDMPrivateMediaSourceAVFObjC::createSession(Le > if (keySystemStringView.substring(14, 1).toInt() == 3 && CDMSessionAVContentKeySession::isAvailable()) > session = std::make_unique<CDMSessionAVContentKeySession>(protocolVersions, *this, client); > else >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > session = std::make_unique<CDMSessionAVStreamSession>(protocolVersions, *this, client); >+#else >+ return nullptr; >+#endif > > m_sessions.append(session.get()); > return WTFMove(session); >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h >index e1de72a872b47539ba0593abb9f48cc47562e520..0797ab2c7a4bcc483c8e751310b0588c53b68414 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h >@@ -31,7 +31,7 @@ > #include <wtf/RetainPtr.h> > #include <wtf/WeakPtr.h> > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(MEDIA_SOURCE) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(MEDIA_SOURCE) > > OBJC_CLASS AVStreamSession; > OBJC_CLASS WebCDMSessionAVStreamSessionObserver; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm >index c3573e5c6081c99b1404e0e41c50e049e291a22e..f3bc9c2191226cc9baf2eee034afee263ba065b1 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm >@@ -26,7 +26,7 @@ > #import "config.h" > #import "CDMSessionAVStreamSession.h" > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(MEDIA_SOURCE) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) && ENABLE(MEDIA_SOURCE) > > #import "CDMPrivateMediaSourceAVFObjC.h" > #import "LegacyCDM.h" >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >index 958a21885628707ef67cb0b81584b774f8fb29d1..f846adfe67302b4bbd39f4ce8f1abf41d0e64319 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >@@ -109,7 +109,7 @@ public: > void setTextTrackRepresentation(TextTrackRepresentation*) override; > void syncTextTrackBounds() override; > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > bool hasStreamSession() { return m_streamSession; } > AVStreamSession *streamSession(); > void setCDMSession(LegacyCDMSession*) override; >@@ -121,17 +121,17 @@ public: > void cdmInstanceDetached(CDMInstance&) final; > void attemptToDecryptWithInstance(CDMInstance&) final; > bool waitingForKey() const final; >- > void waitingForKeyChanged(); > #endif > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA) >- void keyNeeded(Uint8Array*); >- > void outputObscuredDueToInsufficientExternalProtectionChanged(bool); > void beginSimulatedHDCPError() override { outputObscuredDueToInsufficientExternalProtectionChanged(true); } > void endSimulatedHDCPError() override { outputObscuredDueToInsufficientExternalProtectionChanged(false); } >+ >+#if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA) >+ void keyNeeded(Uint8Array*); > #endif >+ > #if ENABLE(ENCRYPTED_MEDIA) > void initializationDataEncountered(const String&, RefPtr<ArrayBuffer>&&); > #endif >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >index c0374ca2d82acc0fd9a15844146b90b5f7a3c24d..4c18fcb4f6ca855ed2c93874d4069f8a5154ef6f 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >@@ -55,6 +55,7 @@ > #pragma mark - Soft Linking > > #import <pal/cf/CoreMediaSoftLink.h> >+#import "CoreVideoSoftLink.h" > > SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation) > >@@ -829,7 +830,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::durationChanged() > > weakThis->pauseInternal(); > if (now < duration) { >- LOG(MediaSource, " ERROR: boundary time observer called before duration!", weakThis.get()); >+ LOG(MediaSource, "MediaPlayerPrivateMediaSourceAVFObjC::durationChanged(%p) ERROR: boundary time observer called before duration!", weakThis.get()); > [weakThis->m_synchronizer setRate:0 time:PAL::toCMTime(duration)]; > } > weakThis->m_player->timeChanged(); >@@ -884,7 +885,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::flushPendingSizeChanges() > m_sizeChangeObserverWeakPtrFactory.revokeAll(); > } > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > AVStreamSession* MediaPlayerPrivateMediaSourceAVFObjC::streamSession() > { > if (!getAVStreamSessionClass() || ![getAVStreamSessionClass() instancesRespondToSelector:@selector(initWithStorageDirectoryAtURL:)]) >@@ -918,11 +919,14 @@ void MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession(LegacyCDMSession* sessi > for (auto& sourceBuffer : m_mediaSourcePrivate->sourceBuffers()) > sourceBuffer->setCDMSession(m_session.get()); > } >+#endif // HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > >+#if ENABLE(LEGACY_ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA) > void MediaPlayerPrivateMediaSourceAVFObjC::keyNeeded(Uint8Array* initData) > { > m_player->keyNeeded(initData); > } >+#endif > > void MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged(bool obscured) > { >@@ -933,7 +937,6 @@ void MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExtern > UNUSED_PARAM(obscured); > #endif > } >-#endif > > #if ENABLE(ENCRYPTED_MEDIA) > void MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached(CDMInstance& instance) >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >index d2d8bd5f817bcbeae04c086ea87f6cd745e4d375..f9866e02f976a931cb41ff800542d278530c894e 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h >@@ -77,7 +77,7 @@ public: > ALLOW_NEW_API_WITHOUT_GUARDS_END > }; > >-class SourceBufferPrivateAVFObjC final : public SourceBufferPrivate { >+class SourceBufferPrivateAVFObjC final : public SourceBufferPrivate, public CanMakeWeakPtr<SourceBufferPrivateAVFObjC> { > public: > static Ref<SourceBufferPrivateAVFObjC> create(MediaSourcePrivateAVFObjC*); > virtual ~SourceBufferPrivateAVFObjC(); >@@ -195,6 +195,7 @@ private: > bool m_waitingForKey { true }; > int m_enabledVideoTrackID { -1 }; > int m_protectedTrackID { -1 }; >+ uint64_t m_mapID; > }; > > } >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >index 85f257cacf27cd015c697bd37224c6742ad4b15d..3831c7ecafc9f8eacfe9d3d2940d4cbeea598bbd 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm >@@ -354,13 +354,13 @@ ALLOW_NEW_API_WITHOUT_GUARDS_END > RetainPtr<AVSampleBufferDisplayLayer> layer = (AVSampleBufferDisplayLayer *)object; > ASSERT(_layers.contains(layer.get())); > >- if ([keyPath isEqualTo:@"error"]) { >+ if ([keyPath isEqualToString:@"error"]) { > RetainPtr<NSError> error = [change valueForKey:NSKeyValueChangeNewKey]; > callOnMainThread([parent = _parent, layer = WTFMove(layer), error = WTFMove(error)] { > if (parent) > parent->layerDidReceiveError(layer.get(), error.get()); > }); >- } else if ([keyPath isEqualTo:@"outputObscuredDueToInsufficientExternalProtection"]) { >+ } else if ([keyPath isEqualToString:@"outputObscuredDueToInsufficientExternalProtection"]) { > callOnMainThread([parent = _parent, obscured = [[change valueForKey:NSKeyValueChangeNewKey] boolValue]] { > if (parent) > parent->outputObscuredDueToInsufficientExternalProtectionChanged(obscured); >@@ -375,7 +375,7 @@ ALLOW_NEW_API_WITHOUT_GUARDS_END > RetainPtr<NSError> error = [change valueForKey:NSKeyValueChangeNewKey]; > > ASSERT(_renderers.contains(renderer.get())); >- ASSERT([keyPath isEqualTo:@"error"]); >+ ASSERT([keyPath isEqualToString:@"error"]); > > callOnMainThread([parent = _parent, renderer = WTFMove(renderer), error = WTFMove(error)] { > if (parent) >@@ -398,30 +398,6 @@ ALLOW_NEW_API_WITHOUT_GUARDS_END > } > @end > >-#pragma mark - >- >-@interface WebBufferConsumedContext : NSObject { >- WeakPtr<WebCore::SourceBufferPrivateAVFObjC> _parent; >-} >-@property (readonly) WebCore::SourceBufferPrivateAVFObjC* parent; >-@end >- >-@implementation WebBufferConsumedContext >-- (id)initWithParent:(WeakPtr<WebCore::SourceBufferPrivateAVFObjC>)parent >-{ >- self = [super init]; >- if (self) >- _parent = parent; >- return self; >-} >- >-@dynamic parent; >-- (WebCore::SourceBufferPrivateAVFObjC*)parent >-{ >- return _parent.get(); >-} >-@end >- > namespace WebCore { > using namespace PAL; > >@@ -461,26 +437,39 @@ protected: > #pragma mark - > #pragma mark SourceBufferPrivateAVFObjC > >-static NSString *kBufferConsumedContext = @"BufferConsumedContext"; >+static HashMap<uint64_t, WeakPtr<SourceBufferPrivateAVFObjC>>& sourceBufferMap() >+{ >+ static NeverDestroyed<HashMap<uint64_t, WeakPtr<SourceBufferPrivateAVFObjC>>> map; >+ return map; >+} > >-static void bufferWasConsumedCallback(CMNotificationCenterRef, const void*, CFStringRef notificationName, const void*, CFTypeRef payload) >+static uint64_t nextMapID() > { >+ static uint64_t mapID = 0; >+ return ++mapID; >+} >+ >+static void bufferWasConsumedCallback(CMNotificationCenterRef, const void* listener, CFStringRef notificationName, const void*, CFTypeRef) >+{ >+ LOG(MediaSource, "bufferWasConsumedCallback - nofication %s", [(__bridge NSString *)notificationName UTF8String]); >+ >+ if (!CFEqual(kCMSampleBufferConsumerNotification_BufferConsumed, notificationName)) >+ return; >+ > if (!isMainThread()) { >- callOnMainThread([notificationName, payload = retainPtr(payload)] { >- bufferWasConsumedCallback(nullptr, nullptr, notificationName, nullptr, payload.get()); >+ callOnMainThread([notificationName, listener] { >+ bufferWasConsumedCallback(nullptr, listener, notificationName, nullptr, nullptr); > }); > return; > } > >- if (!CFEqual(kCMSampleBufferConsumerNotification_BufferConsumed, notificationName)) >- return; >- >- ASSERT(CFGetTypeID(payload) == CFDictionaryGetTypeID()); >- WebBufferConsumedContext *context = [(__bridge NSDictionary *)payload valueForKey:kBufferConsumedContext]; >- if (!context) >+ uint64_t mapID = reinterpret_cast<uint64_t>(listener); >+ if (!mapID) { >+ LOG(MediaSource, "bufferWasConsumedCallback - ERROR: didn't find ID %llu in map", mapID); > return; >+ } > >- if (auto sourceBuffer = context.parent) >+ if (auto sourceBuffer = sourceBufferMap().get(mapID).get()) > sourceBuffer->bufferWasConsumed(); > } > >@@ -495,14 +484,18 @@ SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC(MediaSourcePrivateAVFObjC > , m_errorListener(adoptNS([[WebAVSampleBufferErrorListener alloc] initWithParent:createWeakPtr()])) > , m_isAppendingGroup(adoptOSObject(dispatch_group_create())) > , m_mediaSource(parent) >+ , m_mapID(nextMapID()) > { >- CMNotificationCenterAddListener(CMNotificationCenterGetDefaultLocalCenter(), this, bufferWasConsumedCallback, kCMSampleBufferConsumerNotification_BufferConsumed, nullptr, 0); >+ CMNotificationCenterAddListener(CMNotificationCenterGetDefaultLocalCenter(), reinterpret_cast<void*>(m_mapID), bufferWasConsumedCallback, kCMSampleBufferConsumerNotification_BufferConsumed, nullptr, 0); > m_delegate.get().abortSemaphore = Box<Semaphore>::create(0); >+ >+ sourceBufferMap().add(m_mapID, makeWeakPtr(*this)); > } > > SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC() > { > ASSERT(!m_client); >+ sourceBufferMap().remove(m_mapID); > destroyParser(); > destroyRenderers(); > >@@ -628,7 +621,7 @@ void SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataF > > ASSERT(m_parser); > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > LOG(MediaSource, "SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d", this, trackID); > m_protectedTrackID = trackID; > >@@ -649,7 +642,7 @@ void SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataFo > if (!m_mediaSource) > return; > >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > LOG(MediaSource, "SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID(%p) - track:%d", this, trackID); > m_protectedTrackID = trackID; > auto initDataArray = Uint8Array::create([initData length]); >@@ -666,7 +659,6 @@ void SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataFo > #endif > > #if ENABLE(ENCRYPTED_MEDIA) && HAVE(AVCONTENTKEYSESSION) >- // > auto initDataBuffer = SharedBuffer::create(initData); > auto keyIDs = CDMPrivateFairPlayStreaming::extractKeyIDsSinf(initDataBuffer); > if (!keyIDs) >@@ -713,7 +705,7 @@ static dispatch_queue_t globalDataParserQueue() > > void SourceBufferPrivateAVFObjC::append(Vector<unsigned char>&& data) > { >- LOG(MediaSource, "SourceBufferPrivateAVFObjC::append(%p) - data:%p, length:%d", this, data.data(), data.size()); >+ LOG(MediaSource, "SourceBufferPrivateAVFObjC::append(%p) - data:%p, length:%d", this, data.data(), (int)data.size()); > > // FIXME: Avoid the data copy by wrapping around the Vector<> object. > RetainPtr<NSData> nsData = adoptNS([[NSData alloc] initWithBytes:data.data() length:data.size()]); >@@ -770,7 +762,7 @@ void SourceBufferPrivateAVFObjC::resetParserState() > > void SourceBufferPrivateAVFObjC::destroyParser() > { >-#if ENABLE(LEGACY_ENCRYPTED_MEDIA) >+#if HAVE(AVSTREAMSESSION) && ENABLE(LEGACY_ENCRYPTED_MEDIA) > if (m_mediaSource && m_mediaSource->player()->hasStreamSession()) > [m_mediaSource->player()->streamSession() removeStreamDataParser:m_parser.get()]; > #endif >@@ -988,7 +980,7 @@ void SourceBufferPrivateAVFObjC::unregisterForErrorNotifications(SourceBufferPri > > void SourceBufferPrivateAVFObjC::layerDidReceiveError(AVSampleBufferDisplayLayer *layer, NSError *error) > { >- LOG(MediaSource, "SourceBufferPrivateAVFObjC::layerDidReceiveError(%p): layer(%p), error(%@)", this, layer, [error description]); >+ LOG(MediaSource, "SourceBufferPrivateAVFObjC::layerDidReceiveError(%p): layer(%p), error(%s)", this, layer, [[error description] UTF8String]); > > // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved. > bool anyIgnored = false; >@@ -1025,7 +1017,7 @@ ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN > void SourceBufferPrivateAVFObjC::rendererDidReceiveError(AVSampleBufferAudioRenderer *renderer, NSError *error) > ALLOW_NEW_API_WITHOUT_GUARDS_END > { >- LOG(MediaSource, "SourceBufferPrivateAVFObjC::rendererDidReceiveError(%p): renderer(%p), error(%@)", this, renderer, [error description]); >+ LOG(MediaSource, "SourceBufferPrivateAVFObjC::rendererDidReceiveError(%p): renderer(%p), error(%s)", this, renderer, [[error description] UTF8String]); > > if ([error code] == 'HDCP') > m_hdcpError = error; >@@ -1098,7 +1090,7 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const > CMFormatDescriptionRef formatDescription = CMSampleBufferGetFormatDescription(platformSample.sample.cmSampleBuffer); > FloatSize formatSize = FloatSize(CMVideoFormatDescriptionGetPresentationDimensions(formatDescription, true, true)); > if (!m_cachedSize || formatSize != m_cachedSize.value()) { >- LOG(MediaSource, "SourceBufferPrivateAVFObjC::enqueueSample(%p) - size change detected: {width=%lf, height=%lf}", formatSize.width(), formatSize.height()); >+ LOG(MediaSource, "SourceBufferPrivateAVFObjC::enqueueSample(%p) - size change detected: {width=%lf, height=%lf}", this, formatSize.width(), formatSize.height()); > bool sizeWasNull = !m_cachedSize; > m_cachedSize = formatSize; > if (m_mediaSource) { >@@ -1114,11 +1106,10 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const > > if (m_displayLayer) { > if (m_mediaSource && !m_mediaSource->player()->hasAvailableVideoFrame() && !sample->isNonDisplaying()) { >- auto context = adoptNS([[WebBufferConsumedContext alloc] initWithParent:createWeakPtr()]); > CMSampleBufferRef rawSampleCopy; > CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy); > auto sampleCopy = adoptCF(rawSampleCopy); >- CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{kBufferConsumedContext: context.get()}, kCMAttachmentMode_ShouldNotPropagate); >+ CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @(YES) }, kCMAttachmentMode_ShouldNotPropagate); > [m_displayLayer enqueueSampleBuffer:sampleCopy.get()]; > } else > [m_displayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer]; >@@ -1133,6 +1124,8 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const > > void SourceBufferPrivateAVFObjC::bufferWasConsumed() > { >+ LOG(MediaSource, "SourceBufferPrivateAVFObjC::bufferWasConsumed(%p)", this); >+ > if (m_mediaSource) > m_mediaSource->player()->setHasAvailableVideoFrame(true); > } >diff --git a/Source/WebKit/Configurations/FeatureDefines.xcconfig b/Source/WebKit/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Source/WebKit/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKit/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; > >diff --git a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1cf82ac60f9c7a94dcf54da0f91b4891a015d5ba..e6a0211b8c880ebf9036ef4f9edfc4512311eebb 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-27 Eric Carlson <eric.carlson@apple.com> >+ >+ AVStreamSession isn't always available, make a HAVE compile flag for it >+ https://bugs.webkit.org/show_bug.cgi?id=193889 >+ <rdar://problem/47452863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: >+ > 2019-01-26 Zalan Bujtas <zalan@apple.com> > > [LFC] The default values for top/bottom in contentHeightForFormattingContextRoot should not be 0. >diff --git a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >index 9122a256e3655646b8b2aec2aa2598bb59084621..3960a86ac04f1fd41e2b84eb2b6b53879bdbcdc5 100644 >--- a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >+++ b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >@@ -262,8 +262,7 @@ ENABLE_MEDIA_CONTROLS_SCRIPT = ENABLE_MEDIA_CONTROLS_SCRIPT; > > ENABLE_MEDIA_SESSION = ; > >-ENABLE_MEDIA_SOURCE = $(ENABLE_MEDIA_SOURCE_$(WK_PLATFORM_NAME)); >-ENABLE_MEDIA_SOURCE_macosx = ENABLE_MEDIA_SOURCE; >+ENABLE_MEDIA_SOURCE = ENABLE_MEDIA_SOURCE; > > ENABLE_MEDIA_STATISTICS = ; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193889
:
360315
|
360347