Changeset 187005 in webkit


Ignore:
Timestamp:
Jul 18, 2015 6:36:50 PM (9 years ago)
Author:
mrajca@apple.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r187004 r187005  
     12015-07-16  Matt Rajca  <mrajca@apple.com>
     2
     3        Media Session: add support for telephony interruptions
     4        https://bugs.webkit.org/show_bug.cgi?id=147016
     5
     6        Reviewed by Eric Carlson.
     7
     8        * platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
     9        (WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
     10        (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
     11        (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
     12
    1132015-07-17  Matt Rajca  <mrajca@apple.com>
    214
  • trunk/Source/WebCore/platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm

    r186917 r187005  
    2929#if ENABLE(MEDIA_SESSION) && PLATFORM(MAC)
    3030
    31 #include "NotImplemented.h"
     31#include <CoreFoundation/CoreFoundation.h>
    3232
    3333namespace WebCore {
    3434
     35static const CFStringRef callDidBeginRingingNotification = CFSTR("CallDidBeginRinging");
     36
     37static void callDidBeginRinging(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef)
     38{
     39    ASSERT_ARG(observer, observer);
     40    MediaSessionInterruptionProvider* provider = (MediaSessionInterruptionProvider*)observer;
     41    provider->client().didReceiveStartOfInterruptionNotification(MediaSessionInterruptingCategory::Transient);
     42}
     43
    3544void MediaSessionInterruptionProviderMac::beginListeningForInterruptions()
    3645{
    37     notImplemented();
     46    CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(), this, callDidBeginRinging, callDidBeginRingingNotification, nullptr, CFNotificationSuspensionBehaviorDeliverImmediately);
    3847}
    3948
    4049void MediaSessionInterruptionProviderMac::stopListeningForInterruptions()
    4150{
    42     notImplemented();
     51    CFNotificationCenterRemoveObserver(CFNotificationCenterGetDistributedCenter(), this, callDidBeginRingingNotification, nullptr);
    4352}
    4453
Note: See TracChangeset for help on using the changeset viewer.