[Mac] some track language tags are not recognized
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 22:44:15 +0000 (22:44 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 22:44:15 +0000 (22:44 +0000)
commitee54207dfc558c8b5dd3cdfd0436101e437ec86b
tree4ec30e22a366fb39ed1fe4c11795bff9534a0142
parent2810846a7994618ed36fcce36d6501aec7202097
[Mac] some track language tags are not recognized
https://bugs.webkit.org/show_bug.cgi?id=119643

Source/WebCore:

Reviewed by Jere Noble.

No new tests, existing tests updated.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings
    if possible.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences
    say captions should be disabled. Don't disable an already visible track if we don't find
    a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage ->
    m_subtitleTrackLanguage.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary
    audio track changes, only kick off a text track recalc if caption preference are set to "automatic".
* html/HTMLMediaElement.h:

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged
    and m_delayCharacteristicsChangedNotification.
(WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged.
(WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce
    calls to the media player when we know several characteristics may change.
(WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or
    disable notification delay.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
    a track may have changed so we may have a new language.
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
    if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
    QuickTime language code.

LayoutTests:

Reviewed by Jer Noble.

Explicitly set caption mode to "Automatic" so the track 'default' attribute works.

* media/track/text-track-cue-is-reachable.html:
* media/track/text-track-is-reachable.html:
* media/track/track-active-cues.html:
* media/track/track-cue-overlap-snap-to-lines-not-set.html:
* media/track/track-cue-rendering-horizontal.html:
* media/track/track-cue-rendering-vertical.html:
* media/track/track-kind.html:
* media/track/track-large-timestamp.html:
* media/track/track-mode.html:
* media/track/track-text-track-cue-list.html:
* media/track/track-webvtt-tc000-empty.html:
* media/track/track-webvtt-tc002-bom.html:
* media/track/track-webvtt-tc010-no-timings.html:
* media/track/track-webvtt-tc027-empty-cue.html:
* media/track/track-webvtt-tc028-unsupported-markup.html:
* media/track/track-word-breaking.html:
* media/video-test.js:
(setCaptionDisplayMode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/media/track/text-track-cue-is-reachable.html
LayoutTests/media/track/text-track-is-reachable.html
LayoutTests/media/track/track-active-cues.html
LayoutTests/media/track/track-cue-overlap-snap-to-lines-not-set.html
LayoutTests/media/track/track-cue-rendering-horizontal.html
LayoutTests/media/track/track-cue-rendering-vertical.html
LayoutTests/media/track/track-kind.html
LayoutTests/media/track/track-large-timestamp.html
LayoutTests/media/track/track-mode.html
LayoutTests/media/track/track-text-track-cue-list.html
LayoutTests/media/track/track-webvtt-tc000-empty.html
LayoutTests/media/track/track-webvtt-tc002-bom.html
LayoutTests/media/track/track-webvtt-tc010-no-timings.html
LayoutTests/media/track/track-webvtt-tc027-empty-cue.html
LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html
LayoutTests/media/track/track-word-breaking.html
LayoutTests/media/video-test.js
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm