Changeset 175826 in webkit


Ignore:
Timestamp:
Nov 10, 2014 12:43:50 PM (9 years ago)
Author:
jer.noble@apple.com
Message:

REGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks are available
https://bugs.webkit.org/show_bug.cgi?id=137882

Reviewed by Eric Carlson.

Source/WebCore:

For HLS streams with only one video, audio, or text track, there will be no media selection group
for that media characteristic. When culling out AVPlayerItemTracks in tracksDidChange(), do not skip
tracks for which there is no matching AVMediaSelectionGroup.

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

(WebCore::MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups): Refactored.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): Call above.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):

LayoutTests:

  • platform/mac/TestExpectations:
  • platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r175824 r175826  
     12014-11-04  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks are available
     4        https://bugs.webkit.org/show_bug.cgi?id=137882
     5
     6        Reviewed by Eric Carlson.
     7
     8        * platform/mac/TestExpectations:
     9        * platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt:
     10
    1112014-11-10  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/LayoutTests/platform/mac/TestExpectations

    r175579 r175826  
    15031503[ Yosemite ] inspector/protocol-promise-result.html [ Failure Crash ]
    15041504
    1505 webkit.org/b/137882 http/tests/media/hls/video-controls-live-stream.html [ Failure ]
    1506 webkit.org/b/137882 http/tests/media/track-in-band-hls-metadata.html [ Failure ]
    1507 webkit.org/b/137882 media/track/audio-track.html [ Pass Failure ]
     1505webkit.org/b/138394 media/track/audio-track.html [ Pass Failure ]
    15081506
    15091507# Specific to Yosemite's font fallback
  • trunk/LayoutTests/platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt

    r171595 r175826  
    33EXPECTED (video.duration == 'Infinity') OK
    44-webkit-media-text-track-container: classes: [hidden]
    5 -webkit-media-controls-panel-composited-parent: classes: []
    65-webkit-media-controls-panel: classes: [paused]
    76-webkit-media-controls-play-button: classes: [paused]
  • trunk/Source/WebCore/ChangeLog

    r175824 r175826  
     12014-11-04  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION(r174823): Several tests fail due to canplaythrough firing before tracks are available
     4        https://bugs.webkit.org/show_bug.cgi?id=137882
     5
     6        Reviewed by Eric Carlson.
     7
     8        For HLS streams with only one video, audio, or text track, there will be no media selection group
     9        for that media characteristic. When culling out AVPlayerItemTracks in tracksDidChange(), do not skip
     10        tracks for which there is no matching AVMediaSelectionGroup.
     11
     12        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
     13        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     14        (WebCore::MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups): Refactored.
     15        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia): Call above.
     16        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia): Ditto.
     17        (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia): Ditto.
     18        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
     19
    1202014-11-10  Commit Queue  <commit-queue@webkit.org>
    221
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h

    r174823 r175826  
    246246#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
    247247    void processMediaSelectionOptions();
     248    bool hasLoadedMediaSelectionGroups();
     249
    248250    AVMediaSelectionGroup* safeMediaSelectionGroupForLegibleMedia();
    249251    AVMediaSelectionGroup* safeMediaSelectionGroupForAudibleMedia();
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r175741 r175826  
    23292329
    23302330#if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP)
     2331bool MediaPlayerPrivateAVFoundationObjC::hasLoadedMediaSelectionGroups()
     2332{
     2333    if (!m_avAsset)
     2334        return false;
     2335
     2336    if ([m_avAsset.get() statusOfValueForKey:@"availableMediaCharacteristicsWithMediaSelectionOptions" error:NULL] != AVKeyValueStatusLoaded)
     2337        return false;
     2338
     2339    return true;
     2340}
     2341
    23312342AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia()
    23322343{
    2333     if (!m_avAsset)
     2344    if (!hasLoadedMediaSelectionGroups())
    23342345        return nil;
    2335    
    2336     if ([m_avAsset.get() statusOfValueForKey:@"availableMediaCharacteristicsWithMediaSelectionOptions" error:NULL] != AVKeyValueStatusLoaded)
     2346
     2347    return [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
     2348}
     2349
     2350AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia()
     2351{
     2352    if (!hasLoadedMediaSelectionGroups())
    23372353        return nil;
    2338    
    2339     return [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicLegible];
    2340 }
    2341 
    2342 AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia()
    2343 {
    2344     if (!m_avAsset)
    2345         return nil;
    2346 
    2347     if ([m_avAsset.get() statusOfValueForKey:@"availableMediaCharacteristicsWithMediaSelectionOptions" error:NULL] != AVKeyValueStatusLoaded)
    2348         return nil;
    23492354
    23502355    return [m_avAsset.get() mediaSelectionGroupForMediaCharacteristic:AVMediaCharacteristicAudible];
     
    23532358AVMediaSelectionGroupType* MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia()
    23542359{
    2355     if (!m_avAsset)
    2356         return nil;
    2357 
    2358     if ([m_avAsset.get() statusOfValueForKey:@"availableMediaCharacteristicsWithMediaSelectionOptions" error:NULL] != AVKeyValueStatusLoaded)
     2360    if (!hasLoadedMediaSelectionGroups())
    23592361        return nil;
    23602362
     
    27542756    NSArray *assetTracks = [m_avAsset tracks];
    27552757
    2756     // Tracks which are not present in the AVAsset are streaming tracks, and will instead be represented by
    2757     // AVMediaSelectionOptions.
    27582758    m_cachedTracks = [tracks objectsAtIndexes:[tracks indexesOfObjectsPassingTest:^(id obj, NSUInteger, BOOL*) {
    2759         return [assetTracks containsObject:[obj assetTrack]];
     2759        AVAssetTrack* assetTrack = [obj assetTrack];
     2760
     2761        if ([assetTracks containsObject:assetTrack])
     2762            return YES;
     2763
     2764        // Track is a streaming track. Omit if it belongs to a valid AVMediaSelectionGroup.
     2765        if (!hasLoadedMediaSelectionGroups())
     2766            return NO;
     2767
     2768        if ([assetTrack hasMediaCharacteristic:AVMediaCharacteristicAudible] && safeMediaSelectionGroupForAudibleMedia())
     2769            return NO;
     2770
     2771        if ([assetTrack hasMediaCharacteristic:AVMediaCharacteristicVisual] && safeMediaSelectionGroupForVisualMedia())
     2772            return NO;
     2773
     2774        if ([assetTrack hasMediaCharacteristic:AVMediaCharacteristicLegible] && safeMediaSelectionGroupForLegibleMedia())
     2775            return NO;
     2776
     2777        return YES;
    27602778    }]];
    27612779
Note: See TracChangeset for help on using the changeset viewer.