Changeset 179549 in webkit
- Timestamp:
- Feb 3, 2015 9:27:55 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r179543 r179549 1 2015-02-03 Jer Noble <jer.noble@apple.com> 2 3 [Mac] HLS audio is not correctly selected according to system language 4 https://bugs.webkit.org/show_bug.cgi?id=140398 5 rdar://problem/19218487 6 7 Reviewed by Darin Adler. 8 9 * http/tests/media/hls/hls-audio-tracks-locale-selection-expected.txt: Added. 10 * http/tests/media/hls/hls-audio-tracks-locale-selection.html: Added. 11 * http/tests/media/resources/hls/audio-tracks.m3u8: 12 1 13 2015-02-03 Piotr Krysiewicz <p.krysiewicz@samsung.com> 2 14 -
trunk/LayoutTests/http/tests/media/resources/hls/audio-tracks.m3u8
r174823 r179549 1 1 #EXTM3U 2 2 3 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="en g",NAME="English Sound",AUTOSELECT=YES,DEFAULT=YES4 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="fr e",NAME="French Sound",AUTOSELECT=NO,DEFAULT=NO,URI="french/prog_index.m3u8"5 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE=" spa",NAME="Spanish Sound",AUTOSELECT=NO,DEFAULT=NO,URI="spanish/prog_index.m3u8"3 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="en-US",NAME="English Sound",AUTOSELECT=YES,DEFAULT=YES 4 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="fr-FR",NAME="French Sound",AUTOSELECT=NO,DEFAULT=NO,URI="french/prog_index.m3u8" 5 #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="bipbop_audio",LANGUAGE="es-US",NAME="Spanish Sound",AUTOSELECT=NO,DEFAULT=NO,URI="spanish/prog_index.m3u8" 6 6 7 7 #EXT-X-STREAM-INF:BANDWIDTH=634451,CODECS="mp4a.40.2, avc1.4d401e",RESOLUTION=640x480,AUDIO="bipbop_audio" -
trunk/Source/WebCore/ChangeLog
r179548 r179549 1 2015-02-03 Jer Noble <jer.noble@apple.com> 2 3 [Mac] HLS audio is not correctly selected according to system language 4 https://bugs.webkit.org/show_bug.cgi?id=140398 5 rdar://problem/19218487 6 7 Reviewed by Darin Adler. 8 9 Test: http/tests/media/hls/hls-audio-tracks-locale-selection.html 10 11 When AVMediaSelectionOptions come and go and no explicit track selection choice has 12 been made, automatically pick the most appropriate track according to the user's 13 current preferred locale settings. 14 15 * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: 16 * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: 17 (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC): Set m_shouldSelectOptionAutomatically 18 to true by default. 19 (WebCore::MediaSelectionGroupAVFObjC::updateOptions): If m_shouldSelectOptionAutomatically is set 20 pick the most appropriate media selection option. 21 (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set m_shouldSelectOptionAutomatically to false. 22 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 23 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove these automatic selection 24 requests as they are ineffective when -appliesMediaSelectionCriteriaAutomatically is NO. 25 1 26 2015-02-03 Darin Adler <darin@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h
r176459 r179549 90 90 RetainPtr<AVMediaSelectionGroup> m_mediaSelectionGroup; 91 91 OptionContainer m_options; 92 MediaSelectionOptionAVFObjC* m_selectedOption ;92 MediaSelectionOptionAVFObjC* m_selectedOption { nullptr }; 93 93 Timer m_selectionTimer; 94 bool m_shouldSelectOptionAutomatically { true }; 94 95 }; 95 96 -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm
r179473 r179549 29 29 #if ENABLE(VIDEO_TRACK) 30 30 31 #import "Language.h" 31 32 #import "SoftLinking.h" 32 33 #import <AVFoundation/AVAsset.h> … … 36 37 #import <wtf/HashMap.h> 37 38 #import <wtf/HashSet.h> 39 #import <wtf/text/WTFString.h> 38 40 39 41 SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation) … … 89 91 : m_playerItem(item) 90 92 , m_mediaSelectionGroup(group) 91 , m_selectedOption(nullptr)92 93 , m_selectionTimer(*this, &MediaSelectionGroupAVFObjC::selectionTimerFired) 93 94 { … … 129 130 m_options.set(addedAVOption, addedOption.release()); 130 131 } 132 133 if (!m_shouldSelectOptionAutomatically) 134 return; 135 136 RetainPtr<NSMutableArray> nsLanguages = adoptNS([[NSMutableArray alloc] initWithCapacity:userPreferredLanguages().size()]); 137 for (auto& language : userPreferredLanguages()) 138 [nsLanguages addObject:(NSString*)language]; 139 NSArray* filteredOptions = [getAVMediaSelectionGroupClass() mediaSelectionOptionsFromArray:[m_mediaSelectionGroup options] filteredAndSortedAccordingToPreferredLanguages:nsLanguages.get()]; 140 141 if (![filteredOptions count]) 142 return; 143 144 AVMediaSelectionOption* preferredOption = [filteredOptions objectAtIndex:0]; 145 if (m_selectedOption && m_selectedOption->avMediaSelectionOption() == preferredOption) 146 return; 147 148 ASSERT(m_options.contains(preferredOption)); 149 m_selectedOption = m_options.get(preferredOption); 150 m_selectionTimer.startOneShot(0); 131 151 } 132 152 … … 136 156 return; 137 157 158 m_shouldSelectOptionAutomatically = false; 138 159 m_selectedOption = option; 139 160 if (m_selectionTimer.isActive()) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r179364 r179549 936 936 #endif 937 937 938 #if HAVE(AVFOUNDATION_MEDIA_SELECTION_GROUP) && HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)939 [m_avPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:safeMediaSelectionGroupForLegibleMedia()];940 [m_avPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:safeMediaSelectionGroupForAudibleMedia()];941 [m_avPlayerItem selectMediaOptionAutomaticallyInMediaSelectionGroup:safeMediaSelectionGroupForVisualMedia()];942 #endif943 944 938 #if ENABLE(WEB_AUDIO) && USE(MEDIATOOLBOX) 945 939 if (m_provider)
Note: See TracChangeset
for help on using the changeset viewer.