Changeset 202429 in webkit


Ignore:
Timestamp:
Jun 24, 2016 10:46:15 AM (8 years ago)
Author:
jer.noble@apple.com
Message:

[MSE] Adopt +[AVStreamDataParser outputMIMECodecParameterForInputMIMECodecParameter:]
https://bugs.webkit.org/show_bug.cgi?id=158312

Reviewed by Eric Carlson.

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

(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):

Move the declaration of AVStreamDataParser into AVFoundationSPI.h:

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

(WebCore::CDMSessionAVStreamSession::update):

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
  • platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:

(-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):

  • platform/spi/mac/AVFoundationSPI.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202427 r202429  
     12016-06-02  Jer Noble  <jer.noble@apple.com>
     2
     3        [MSE] Adopt +[AVStreamDataParser outputMIMECodecParameterForInputMIMECodecParameter:]
     4        https://bugs.webkit.org/show_bug.cgi?id=158312
     5
     6        Reviewed by Eric Carlson.
     7
     8        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
     9        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
     10
     11        Move the declaration of AVStreamDataParser into AVFoundationSPI.h:
     12
     13        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
     14        (WebCore::CDMSessionAVStreamSession::update):
     15        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
     16        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
     17        (-[WebAVStreamDataParserListener streamDataParser:didProvideMediaData:forTrackID:mediaType:flags:]):
     18        * platform/spi/mac/AVFoundationSPI.h:
     19
    1202016-06-24  Eric Carlson  <eric.carlson@apple.com>
    221
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm

    r195452 r202429  
    2929#if ENABLE(ENCRYPTED_MEDIA_V2) && ENABLE(MEDIA_SOURCE)
    3030
     31#import "AVFoundationSPI.h"
    3132#import "CDM.h"
    3233#import "CDMPrivateMediaSourceAVFObjC.h"
     
    5152SOFT_LINK_CONSTANT_MAY_FAIL(AVFoundation, AVStreamSessionContentProtectionSessionIdentifierChangedNotification, NSString *)
    5253
    53 @interface AVStreamDataParser : NSObject
    54 - (void)processContentKeyResponseData:(NSData *)contentKeyResponseData forTrackID:(CMPersistentTrackID)trackID;
    55 - (void)processContentKeyResponseError:(NSError *)error forTrackID:(CMPersistentTrackID)trackID;
    56 - (void)renewExpiringContentKeyResponseDataForTrackID:(CMPersistentTrackID)trackID;
    57 - (NSData *)streamingContentKeyRequestDataForApp:(NSData *)appIdentifier contentIdentifier:(NSData *)contentIdentifier trackID:(CMPersistentTrackID)trackID options:(NSDictionary *)options error:(NSError **)outError;
    58 @end
    59 
    6054@interface AVStreamSession : NSObject
    6155- (void)addStreamDataParser:(AVStreamDataParser *)streamDataParser;
     
    248242
    249243        NSError* error = nil;
     244#pragma clang diagnostic push
     245#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    250246        RetainPtr<NSData> request = [protectedSourceBuffer->parser() streamingContentKeyRequestDataForApp:certificateData.get() contentIdentifier:initData.get() trackID:protectedSourceBuffer->protectedTrackID() options:options.get() error:&error];
     247#pragma clang diagnostic pop
    251248
    252249        if (![protectedSourceBuffer->parser() respondsToSelector:@selector(contentProtectionSessionIdentifier)])
     
    270267    systemCode = 0;
    271268    RetainPtr<NSData> keyData = adoptNS([[NSData alloc] initWithBytes:key->data() length:key->length()]);
     269#pragma clang diagnostic push
     270#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    272271    [protectedSourceBuffer->parser() processContentKeyResponseData:keyData.get() forTrackID:protectedSourceBuffer->protectedTrackID()];
     272#pragma clang diagnostic pop
    273273
    274274    return true;
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm

    r202350 r202429  
    3030
    3131#import "AVFoundationMIMETypeCache.h"
     32#import "AVFoundationSPI.h"
    3233#import "CDMSessionAVStreamSession.h"
    3334#import "CDMSessionMediaSourceAVFObjC.h"
     
    245246        return MediaPlayer::MayBeSupported;
    246247
    247     NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)parameters.type, (NSString *)parameters.codecs];
     248    NSString *outputCodecs = parameters.codecs;
     249    if ([getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
     250        outputCodecs = [getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
     251
     252    NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)parameters.type, (NSString *)outputCodecs];
    248253    return [getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
    249254}
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm

    r202242 r202429  
    2929#if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
    3030
     31#import "AVFoundationSPI.h"
    3132#import "CDMSessionAVContentKeySession.h"
    3233#import "CDMSessionMediaSourceAVFObjC.h"
     
    9798
    9899#pragma mark -
    99 #pragma mark AVStreamDataParser
    100 
    101 @interface AVStreamDataParser : NSObject
    102 - (void)setDelegate:(id)delegate;
    103 - (void)appendStreamData:(NSData *)data;
    104 - (void)setShouldProvideMediaData:(BOOL)shouldProvideMediaData forTrackID:(CMPersistentTrackID)trackID;
    105 - (BOOL)shouldProvideMediaDataForTrackID:(CMPersistentTrackID)trackID;
    106 - (void)providePendingMediaData;
    107 - (void)processContentKeyResponseData:(NSData *)contentKeyResponseData forTrackID:(CMPersistentTrackID)trackID;
    108 - (void)processContentKeyResponseError:(NSError *)error forTrackID:(CMPersistentTrackID)trackID;
    109 - (void)renewExpiringContentKeyResponseDataForTrackID:(CMPersistentTrackID)trackID;
    110 - (NSData *)streamingContentKeyRequestDataForApp:(NSData *)appIdentifier contentIdentifier:(NSData *)contentIdentifier trackID:(CMPersistentTrackID)trackID options:(NSDictionary *)options error:(NSError **)outError;
    111 @end
    112 
    113 #pragma mark -
    114100#pragma mark AVSampleBufferDisplayLayer
    115101
     
    220206}
    221207
    222 - (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideMediaData:(CMSampleBufferRef)sample forTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)nsMediaType flags:(NSUInteger)flags
     208- (void)streamDataParser:(AVStreamDataParser *)streamDataParser didProvideMediaData:(CMSampleBufferRef)sample forTrackID:(CMPersistentTrackID)trackID mediaType:(NSString *)nsMediaType flags:(AVStreamDataParserOutputMediaDataFlags)flags
    223209{
    224210#if ASSERT_DISABLED
  • trunk/Source/WebCore/platform/spi/mac/AVFoundationSPI.h

    r201633 r202429  
    100100#endif // PLATFORM(IOS)
    101101
    102 // FIXME: Wrap in a #if USE(APPLE_INTERNAL_SDK) once this SPI lands
     102#pragma mark -
     103#pragma mark AVStreamDataParser
     104
     105#if USE(APPLE_INTERNAL_SDK)
     106#import <AVFoundation/AVStreamDataParser.h>
     107#else
     108
     109typedef int32_t CMPersistentTrackID;
     110
     111NS_ASSUME_NONNULL_BEGIN
     112typedef NS_ENUM(NSUInteger, AVStreamDataParserOutputMediaDataFlags) {
     113    AVStreamDataParserOutputMediaDataReserved = 1 << 0
     114};
     115
     116@interface AVStreamDataParser : NSObject
     117- (void)setDelegate:(nullable id)delegate;
     118- (void)appendStreamData:(NSData *)data;
     119- (void)setShouldProvideMediaData:(BOOL)shouldProvideMediaData forTrackID:(CMPersistentTrackID)trackID;
     120- (BOOL)shouldProvideMediaDataForTrackID:(CMPersistentTrackID)trackID;
     121- (void)providePendingMediaData;
     122- (void)processContentKeyResponseData:(NSData *)contentKeyResponseData forTrackID:(CMPersistentTrackID)trackID;
     123- (void)processContentKeyResponseError:(NSError *)error forTrackID:(CMPersistentTrackID)trackID;
     124- (void)renewExpiringContentKeyResponseDataForTrackID:(CMPersistentTrackID)trackID;
     125- (NSData *)streamingContentKeyRequestDataForApp:(NSData *)appIdentifier contentIdentifier:(NSData *)contentIdentifier trackID:(CMPersistentTrackID)trackID options:(NSDictionary *)options error:(NSError **)outError;
     126@end
     127NS_ASSUME_NONNULL_END
     128#endif
     129
     130// FIXME: Wrap in a #if USE(APPLE_INTERNAL_SDK) once these SPI land
    103131#import <AVFoundation/AVAssetResourceLoader.h>
    104132
     
    111139@end
    112140
     141@interface AVStreamDataParser (AVStreamDataParserPrivate)
     142+ (NSString *)outputMIMECodecParameterForInputMIMECodecParameter:(NSString *)inputMIMECodecParameter;
     143@end
     144
    113145NS_ASSUME_NONNULL_END
Note: See TracChangeset for help on using the changeset viewer.