Changeset 230708 in webkit


Ignore:
Timestamp:
Apr 17, 2018 7:55:42 AM (6 years ago)
Author:
eric.carlson@apple.com
Message:

[iOS] AirPlay device name is sometimes wrong
https://bugs.webkit.org/show_bug.cgi?id=184543
<rdar://problem/39105498>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, this can only be tested with a specific hardware setup.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
when possible.

Source/WebCore/PAL:

  • pal/spi/mac/AVFoundationSPI.h: Declare more AVOutputContext SPI.
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r230706 r230708  
     12018-04-17  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] AirPlay device name is sometimes wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=184543
     5        <rdar://problem/39105498>
     6
     7        Reviewed by Jer Noble.
     8
     9        No new tests, this can only be tested with a specific hardware setup.
     10
     11        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     12        (WebCore::exernalDeviceDisplayNameForPlayer): Get the device name from the AVOutputContext
     13        when possible.
     14
    1152018-04-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    216
  • trunk/Source/WebCore/PAL/ChangeLog

    r230689 r230708  
     12018-04-17  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [iOS] AirPlay device name is sometimes wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=184543
     5        <rdar://problem/39105498>
     6
     7        Reviewed by Jer Noble.
     8
     9        * pal/spi/mac/AVFoundationSPI.h: Declare more AVOutputContext SPI.
     10
    1112018-04-16  Brent Fulgham  <bfulgham@apple.com>
    212
  • trunk/Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h

    r227552 r230708  
    3232
    3333#import <AVFoundation/AVAssetCache_Private.h>
    34 #import <AVFoundation/AVOutputContext.h>
     34#import <AVFoundation/AVOutputContext_Private.h>
    3535#import <AVFoundation/AVPlayerItem_Private.h>
    3636#import <AVFoundation/AVPlayerLayer_Private.h>
     
    5959#endif // (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000)
    6060
    61 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     61#if ENABLE(WIRELESS_PLAYBACK_TARGET) || PLATFORM(IOS)
    6262
    6363NS_ASSUME_NONNULL_BEGIN
    6464
    6565@class AVOutputContext;
     66@class AVOutputDevice;
    6667@interface AVOutputContext : NSObject <NSSecureCoding>
    6768@property (nonatomic, readonly) NSString *deviceName;
    6869+ (instancetype)outputContext;
    69 @end
    70 
     70+ (nullable AVOutputContext *)sharedAudioPresentationOutputContext;
     71@property (readonly) BOOL supportsMultipleOutputDevices;
     72@property (readonly) NSArray<AVOutputDevice *> *outputDevices;
     73@end
     74
     75#if !PLATFORM(IOS)
    7176@interface AVPlayer (AVPlayerExternalPlaybackSupportPrivate)
    7277@property (nonatomic, retain) AVOutputContext *outputContext;
    7378@end
    74 
    75 NS_ASSUME_NONNULL_END
    76 
    77 #endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     79#else
     80typedef NS_ENUM(NSInteger, AVPlayerExternalPlaybackType) {
     81    AVPlayerExternalPlaybackTypeNone,
     82    AVPlayerExternalPlaybackTypeAirPlay,
     83    AVPlayerExternalPlaybackTypeTVOut,
     84};
     85
     86@interface AVPlayer (AVPlayerExternalPlaybackSupportPrivate)
     87@property (nonatomic, readonly) AVPlayerExternalPlaybackType externalPlaybackType;
     88@end
     89#endif
     90
     91NS_ASSUME_NONNULL_END
     92
     93#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) || PLATFORM(IOS)
    7894
    7995#import <AVFoundation/AVAssetCache.h>
     
    95111
    96112#endif // PLATFORM(IOS) && !PLATFORM(IOS_SIMULATOR)
    97 
    98 #if PLATFORM(IOS)
    99 typedef NS_ENUM(NSInteger, AVPlayerExternalPlaybackType) {
    100     AVPlayerExternalPlaybackTypeNone,
    101     AVPlayerExternalPlaybackTypeAirPlay,
    102     AVPlayerExternalPlaybackTypeTVOut,
    103 };
    104 
    105 @interface AVPlayer (AVPlayerExternalPlaybackSupportPrivate)
    106 @property (nonatomic, readonly) AVPlayerExternalPlaybackType externalPlaybackType;
    107 @end
    108 #endif
    109113
    110114#if !PLATFORM(IOS)
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm

    r230177 r230708  
    3838#import <wtf/MainThread.h>
    3939
    40 typedef AVOutputContext AVOutputContextType;
    41 typedef AVOutputDeviceMenuController AVOutputDeviceMenuControllerType;
     40typedef AVOutputContext AVOutputContextWKType;
     41typedef AVOutputDeviceMenuController AVOutputDeviceMenuControllerWKType;
     42
    4243
    4344SOFTLINK_AVKIT_FRAMEWORK()
     
    8788}
    8889
    89 AVOutputDeviceMenuControllerType *MediaPlaybackTargetPickerMac::devicePicker()
     90AVOutputDeviceMenuControllerWKType *MediaPlaybackTargetPickerMac::devicePicker()
    9091{
    9192    if (!getAVOutputDeviceMenuControllerClass())
     
    9596        LOG(Media, "MediaPlaybackTargetPickerMac::devicePicker - allocating picker");
    9697
    97         RetainPtr<AVOutputContextType> context = adoptNS([allocAVOutputContextInstance() init]);
     98        RetainPtr<AVOutputContextWKType> context = adoptNS([allocAVOutputContextInstance() init]);
    9899        m_outputDeviceMenuController = adoptNS([allocAVOutputDeviceMenuControllerInstance() initWithOutputContext:context.get()]);
    99100
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r230265 r230708  
    223223SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionGroup)
    224224SOFT_LINK_CLASS(AVFoundation, AVMediaSelectionOption)
     225SOFT_LINK_CLASS(AVFoundation, AVOutputContext)
    225226
    226227SOFT_LINK_POINTER(AVFoundation, AVMediaCharacteristicLegible, NSString *)
     
    27882789{
    27892790#if HAVE(CELESTIAL)
    2790     NSString *displayName = nil;
    2791 
    27922791    if (!AVFoundationLibrary())
    27932792        return nil;
     2793
     2794#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
     2795    if ([getAVOutputContextClass() respondsToSelector:@selector(sharedAudioPresentationOutputContext)]) {
     2796        AVOutputContext *outputContext = [getAVOutputContextClass() sharedAudioPresentationOutputContext];
     2797
     2798        if (![outputContext respondsToSelector:@selector(supportsMultipleOutputDevices)]
     2799            || ![outputContext supportsMultipleOutputDevices]
     2800            || ![outputContext respondsToSelector:@selector(outputDevices)])
     2801            return [outputContext deviceName];
     2802
     2803        auto outputDeviceNames = adoptNS([[NSMutableArray alloc] init]);
     2804        for (AVOutputDevice *outputDevice in [outputContext outputDevices])
     2805            [outputDeviceNames addObject:[[outputDevice name] copy]];
     2806
     2807        return [outputDeviceNames componentsJoinedByString:@" + "];
     2808    }
     2809#endif
    27942810
    27952811    if (player.externalPlaybackType != AVPlayerExternalPlaybackTypeAirPlay)
     
    28002816        return nil;
    28012817
     2818    NSString *displayName = nil;
    28022819    for (NSDictionary *pickableRoute in pickableRoutes) {
    28032820        if (![pickableRoute[AVController_RouteDescriptionKey_RouteCurrentlyPicked] boolValue])
Note: See TracChangeset for help on using the changeset viewer.