Title: [187005] trunk/Source/WebCore
- Revision
- 187005
- Author
- [email protected]
- Date
- 2015-07-18 18:36:50 -0700 (Sat, 18 Jul 2015)
Log Message
Media Session: add support for telephony interruptions
https://bugs.webkit.org/show_bug.cgi?id=147016
Reviewed by Eric Carlson.
* platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
(WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
(WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
(WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (187004 => 187005)
--- trunk/Source/WebCore/ChangeLog 2015-07-19 01:30:44 UTC (rev 187004)
+++ trunk/Source/WebCore/ChangeLog 2015-07-19 01:36:50 UTC (rev 187005)
@@ -1,3 +1,15 @@
+2015-07-16 Matt Rajca <[email protected]>
+
+ Media Session: add support for telephony interruptions
+ https://bugs.webkit.org/show_bug.cgi?id=147016
+
+ Reviewed by Eric Carlson.
+
+ * platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
+ (WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
+ (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
+ (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
+
2015-07-17 Matt Rajca <[email protected]>
Media Session: add infrastructure for testing interruptions
Modified: trunk/Source/WebCore/platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm (187004 => 187005)
--- trunk/Source/WebCore/platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm 2015-07-19 01:30:44 UTC (rev 187004)
+++ trunk/Source/WebCore/platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm 2015-07-19 01:36:50 UTC (rev 187005)
@@ -28,18 +28,27 @@
#if ENABLE(MEDIA_SESSION) && PLATFORM(MAC)
-#include "NotImplemented.h"
+#include <CoreFoundation/CoreFoundation.h>
namespace WebCore {
+static const CFStringRef callDidBeginRingingNotification = CFSTR("CallDidBeginRinging");
+
+static void callDidBeginRinging(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
+{
+ ASSERT_ARG(observer, observer);
+ MediaSessionInterruptionProvider* provider = (MediaSessionInterruptionProvider*)observer;
+ provider->client().didReceiveStartOfInterruptionNotification(MediaSessionInterruptingCategory::Transient);
+}
+
void MediaSessionInterruptionProviderMac::beginListeningForInterruptions()
{
- notImplemented();
+ CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), this, callDidBeginRinging, callDidBeginRingingNotification, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
}
void MediaSessionInterruptionProviderMac::stopListeningForInterruptions()
{
- notImplemented();
+ CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), this, callDidBeginRingingNotification, nullptr);
}
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes