1. 01 Oct, 2013 1 commit
    • jer.noble@apple.com's avatar
      Unreviewed build fix; The addedFunction and removedFunction arguments to... · 1c81affb
      jer.noble@apple.com authored
      Unreviewed build fix; The addedFunction and removedFunction arguments to determineChangedTracksFromNewTracksAndOldItems
      were reversed, exposing an underlying, existing bug in AudioTrackPrivate and VideoTrack private. Give a default (null)
      value to AudioTrackPrivate::m_client and VideoTrackPrivate::m_client and fix the ordering of arguments in
      determineChangedTracksFromNewTracksAndOldItems.
      
      * platform/graphics/AudioTrackPrivate.h:
      (WebCore::AudioTrackPrivate::AudioTrackPrivate):
      * platform/graphics/VideoTrackPrivate.h:
      (WebCore::VideoTrackPrivate::VideoTrackPrivate):
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::determineChangedTracksFromNewTracksAndOldItems):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1c81affb
  2. 19 Apr, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Add interfaces and stubs for audio and video tracks · 159869e5
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=113965
      
      Patch by Brendan Long <b.long@cablelabs.com> on 2013-04-19
      Reviewed by Jer Noble.
      
      No new tests because there's no implementations, so there's nothing
      interesting to test.
      
      * CMakeLists.txt: Add AudioTrack, VideoTrack, AudioTrackList and VideoTrackList.
      * DerivedSources.cpp: Same.
      * DerivedSources.make: Same.
      * DerivedSources.pri: Same.
      * GNUmakefile.list.am: Same.
      * Target.pri: Same.
      * UseJSC.cmake: Same.
      * WebCore.vcproj/WebCore.vcproj: Same.
      * WebCore.xcodeproj/project.pbxproj: Same.
      * bindings/gobject/GNUmakefile.am: Same.
      * bindings/js/JSAudioTrackCustom.cpp: Added, based on JSTestTrackCustom
      * bindings/js/JSAudioTrackListCustom.cpp: Same.
      * bindings/js/JSBindingsAllInOne.cpp: Add AudioTrack, VideoTrack, AudioTrackList and VideoTrackList.
      * bindings/js/JSVideoTrackCustom.cpp: Added, based on JSTestTrackCustom
      * bindings/js/JSVideoTrackListCustom.cpp: Same.
      * dom/EventTarget.h: Make AudioTrackList and VideoTrackList event targets.
      * dom/EventTargetFactory.in: Same.
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): Add m_audioTracks and m_videoTracks
      (WebCore::HTMLMediaElement::~HTMLMediaElement): Clear clients for audio and video tracks
      (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Added.
      (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Added.
      (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Added, based on mediaPlayerDidAddTextTrack
      (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Same.
      (WebCore::HTMLMediaElement::mediaPlayerDidRemoveAudioTrack): Added, based on mediaPlayerDidRemoveTextTrack
      (WebCore::HTMLMediaElement::mediaPlayerDidRemoveVideoTrack): Same.
      (WebCore::HTMLMediaElement::addAudioTrack): Added, based on addTextTrack
      (WebCore::HTMLMediaElement::addVideoTrack): Same.
      (WebCore::HTMLMediaElement::removeAudioTrack): Added, based on removeTextTrack
      (WebCore::HTMLMediaElement::removeVideoTrack): Added, based on removeTextTrack
      (WebCore::HTMLMediaElement::removeAllInbandTracks): Remove audio and video tracks too
      (WebCore::HTMLMediaElement::audioTracks): Added, based on textTracks
      (WebCore::HTMLMediaElement::videoTracks): Added, based on textTracks
      (WebCore::HTMLMediaElement::reportMemoryUsage): Add audio and video tracks
      * html/HTMLMediaElement.h: Add audioTracks and videoTracks and related functions
      * html/HTMLMediaElement.idl: Add audioTracks and videoTracks
      * html/track/AudioTrack.cpp: Added, based on TextTrack and InbandTextTrack.
      * html/track/AudioTrack.h: Same.
      * html/track/AudioTrack.idl: Added.
      * html/track/AudioTrackList.cpp: Added, based on TextTrackList
      * html/track/AudioTrackList.h: Same.
      * html/track/AudioTrackList.idl: Added.
      * html/track/TextTrackList.h: Add missing OVERRIDE on interfaceName()
      * html/track/VideoTrack.cpp: Added, based on TextTrack and InbandTextTrack.
      * html/track/VideoTrack.h: Same.
      * html/track/VideoTrack.idl: Added.
      * html/track/VideoTrackList.cpp: Added, based on TextTrackList
      * html/track/VideoTrackList.h: Same.
      * html/track/VideoTrackList.idl: Added.
      * platform/graphics/AudioTrackPrivate.h: Added, based on InbandTextTrackPrivate.h
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::addAudioTrack): Added, based on addTextTrack
      (WebCore::MediaPlayer::removeAudioTrack): Added, based on removeTextTrack
      (WebCore::MediaPlayer::addVideoTrack): Added, based on addTextTrack
      (WebCore::MediaPlayer::removeVideoTrack): Added, based on removeTextTrack
      * platform/graphics/MediaPlayer.h:
      (WebCore::MediaPlayerClient::mediaPlayerDidAddAudioTrack): Added, based on mediaPlayerDidAddTextTrack
      (WebCore::MediaPlayerClient::mediaPlayerDidAddVideoTrack): Same
      (WebCore::MediaPlayerClient::mediaPlayerDidRemoveAudioTrack): Added, based on mediaPlayerDidRemoveTextTrack
      (WebCore::MediaPlayerClient::mediaPlayerDidRemoveVideoTrack): Same
      * platform/graphics/VideoTrackPrivate.h: Added, based on InbandTextTrackPrivate.h
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      159869e5
  3. 12 Apr, 2013 1 commit
    • eric.carlson@apple.com's avatar
      Support "forced" subtitles · 502400bb
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114460
      
      Reviewed by Jer Noble.
      
      Source/WebCore: 
      
      Test: media/track/track-forced-subtitles.html
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::configureTextTrackGroup): Enable a forced track if nothing else is enabled.
      (WebCore::HTMLMediaElement::configureTextTracks): Include forced tracks with captions+subtitles.
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::InbandTextTrack): Deal with kind=forced.
      
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::forcedKeyword): New keyword.
      (WebCore::TextTrack::isValidKindKeyword): Include forced.
      (WebCore::TextTrack::platformTextTrack): Ditto.
      * html/track/TextTrack.h:
      
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::primaryAudioTrackLanguageOverride): New override to support testing.
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Support forced tracks.
      * platform/graphics/InbandTextTrackPrivate.h:
      
      * platform/graphics/PlatformTextTrack.h: Add Forced, minor cleanup.
      
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
      (WebCore::InbandTextTrackPrivateAVF::processCue): Drive-by enhancement: log cue position.
      
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateAVFObjC::kind): Support forced.
      (WebCore::InbandTextTrackPrivateAVFObjC::label): Drive-by cleanup.
      
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processTextTracks): Don't filter out forced tracks.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Log the language returned.
      
      * testing/Internals.cpp:
      (WebCore::Internals::setPrimaryAudioTrackLanguageOverride): New.
      (WebCore::Internals::setCaptionDisplayMode): New.
      * testing/Internals.h:
      * testing/Internals.idl:
      
      LayoutTests: 
      
      * media/content/CC+Subtitles.m4v: Added.
      * media/track/track-forced-subtitles-in-band-expected.txt: Added.
      * media/track/track-forced-subtitles-in-band.html: Added.
      * media/trackmenu-test.js:
      
      * platform/efl/TestExpectations: Skip new test.
      * platform/gtk/TestExpectations: Ditto.
      * platform/mac/TestExpectations: Ditto.
      * platform/qt/TestExpectations: Ditto.
      * platform/win/TestExpectations: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      502400bb
  4. 20 Mar, 2013 1 commit
    • eric.carlson@apple.com's avatar
      Allow ports specific text track menu · 62bb7dc9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=112800
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      No new tests, existing tests updated for changes.
      
      * English.lproj/Localizable.strings: Add localizable strings for text track names.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::HTMLMediaElement): userPrefersCaptions -> shouldShowCaptions.
      (WebCore::HTMLMediaElement::setSelectedTextTrack): toggleTrackAtIndex -> setSelectedTextTrack.
      (WebCore::HTMLMediaElement::userPrefersCaptions): userPrefersCaptions -> shouldShowCaptions.
      (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Get preferences from CaptionUserPreferences
          instead of from Settings.
      (WebCore::HTMLMediaElement::setSelectedTextTrack): Renamed from toggleTrackAtIndex. Now takes
          a TextTrack* instead of an int.
      (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't force a recalculation unless 
          captions are enabled/disabled to avoid unnecessary thrash.
      * html/HTMLMediaElement.h:
      
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): Use the menu to track
          map instead of just the track index.
      (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Build and configure the
          menu from the menu to track map.
      (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu): Start with a list
          of tracks already sorted according to platform specific rules. Build a menu to track map
          so tracks are retained while the menu is visible.
      * html/shadow/MediaControlElements.h:
      
      * html/shadow/MediaControls.cpp:
      (WebCore::MediaControls::textTrackPreferencesChanged): Call closedCaptionTracksChanged so the
          track menu will be rebuilt before it is shown again.
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::containsOnlyForcedSubtitles): New, passthrough to the private track.
      (WebCore::InbandTextTrack::isMainProgramContent): Ditto.
      (WebCore::InbandTextTrack::isEasyToRead): Ditto.
      * html/track/InbandTextTrack.h:
      * html/track/TextTrack.h:
      
      * html/track/TextTrackList.cpp:
      (WebCore::TextTrackList::contains): New.
      * html/track/TextTrackList.h:
      
      * page/CaptionUserPreferences.cpp:
      (WebCore::CaptionUserPreferences::CaptionUserPreferences): Pull in from .h ditto.
      (WebCore::CaptionUserPreferences::~CaptionUserPreferences): Ditto.
      (WebCore::CaptionUserPreferences::shouldShowCaptions): Renamed from userPrefersCaptions. 
      (WebCore::CaptionUserPreferences::setShouldShowCaptions): New.
      (WebCore::CaptionUserPreferences::userPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersCaptions): Ditto.
      (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersSubtitles): Ditto.
      (WebCore::CaptionUserPreferences::userPrefersTextDescriptions): Ditto.
      (WebCore::CaptionUserPreferences::setUserPrefersTextDescriptions): Ditto.
      (WebCore::CaptionUserPreferences::displayNameForTrack): Ditto.
      (WebCore::CaptionUserPreferences::sortedTrackListForMenu): Ditto.
      * page/CaptionUserPreferences.h:
      
      * page/CaptionUserPreferencesMac.h:
      * page/CaptionUserPreferencesMac.mm:
      (WebCore::CaptionUserPreferencesMac::shouldShowCaptions): Renamed from userPrefersCaptions. 
      (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): New.
      (WebCore::CaptionUserPreferences::userPrefersSubtitles): Ditto.
      (WebCore::trackDisplayName): Update logic used to build track title.
      (WebCore::CaptionUserPreferencesMac::displayNameForTrack): Call trackDisplayName.
      (WebCore::textTrackCompare): Text track title sort comparison function.
      (WebCore::CaptionUserPreferencesMac::sortedTrackListForMenu): New. Sort the list of tracks
          according to title, language, and user preferences.
      
      * platform/Language.cpp:
      (WebCore::displayNameForLanguageLocale): Don't leak the CFLocale.
              
      * platform/LocalizedStrings.cpp:
      (WebCore::textTrackCountryAndLanguageMenuItemText): New.
      (WebCore::textTrackLanguageMenuItemText): Ditto.
      (WebCore::closedCaptionTrackMenuItemText): Ditto.
      (WebCore::sdhTrackMenuItemText): Ditto.
      (WebCore::easyReaderTrackMenuItemText): Ditto.
      * platform/LocalizedStrings.h:
      
      * platform/graphics/InbandTextTrackPrivate.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateAVFObjC::containsOnlyForcedSubtitles): New, return AVFoundation property.
      (WebCore::InbandTextTrackPrivateAVFObjC::isMainProgramContent): Ditto.
      (WebCore::InbandTextTrackPrivateAVFObjC::isEasyToRead): Ditto.
      
      * testing/InternalSettings.cpp:
      (WebCore::InternalSettings::setShouldDisplayTrackKind): Set setting via CaptionUserPreferences
          instead of from Settings.
      (WebCore::InternalSettings::shouldDisplayTrackKind): Get setting from CaptionUserPreferences
          instead of from Settings.
      
      Source/WebKit: 
      
      * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Add new exports.
      * win/WebKit.vcproj/WebKitExports.def.in: Ditto.
      
      LayoutTests: 
      
      * media/track/track-user-preferences-expected.txt:
      * media/track/track-user-preferences.html:
      * media/video-controls-captions-trackmenu-localized.html:
      * media/video-controls-captions-trackmenu-sorted.html:
      * media/video-controls-captions-trackmenu.html:
      * platform/mac/media/video-controls-captions-trackmenu-expected.txt:
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
      * platform/mac/media/video-controls-captions-trackmenu-sorted-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62bb7dc9
  5. 05 Feb, 2013 1 commit
    • eric.carlson@apple.com's avatar
      [Mac] Complete plumbing so captions menu can indicate track type · eb3dd61d
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108994
      
      Reviewed by Dean Jackson.
      
      Source/WebCore: 
      
      Plumb "isClosedCaptions" through to the Mac media engine.
      
      Updated media/video-controls-captions-trackmenu-localized.html and results.
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::isClosedCaptions): New, pass the call through to the private track.
      * html/track/InbandTextTrack.h:
      (InbandTextTrack):
      * html/track/TextTrack.cpp:
      (WebCore::TextTrack::TextTrack): Lose the member variable, this won't be accessed often enough
          to make it worth caching the value.
      * html/track/TextTrack.h:
      (WebCore::TextTrack::isClosedCaptions): Make virtual so derived classes can oveerride.
      * platform/graphics/InbandTextTrackPrivate.h:
      (WebCore::InbandTextTrackPrivate::isClosedCaptions): New.
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateAVFObjC::isClosedCaptions): New.
      
      LayoutTests: 
      
      Update test results now that the Mac media engine identifies CC tracks.
      
      * media/video-controls-captions-trackmenu-localized.html:
      * platform/mac/media/video-controls-captions-trackmenu-localized-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      eb3dd61d
  6. 10 Dec, 2012 2 commits
    • adamk@chromium.org's avatar
      In InbandTextTrackPrivate, return emptyAtoms instead of emptyString() by default. · 023a48ce
      adamk@chromium.org authored
      Unreviewed build fix.
      
      * platform/graphics/InbandTextTrackPrivate.h:
      (WebCore::InbandTextTrackPrivate::label):
      (WebCore::InbandTextTrackPrivate::language):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      023a48ce
    • eric.carlson@apple.com's avatar
      Add support for in-band text tracks to Mac port · 134ccfc9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=103663
      
      Reviewed by Sam Weinig.
      
      Source/WebCore: 
      
      Test: media/track/track-in-band.html
      
      * GNUmakefile.list.am: Move InbandTextTrackPrivate.h to platform/graphics. Add InbandTextTrackPrivateClient.h.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      
      * WebCore.xcodeproj/project.pbxproj: Add new files.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::setReadyState): No need to call processInbandTextTracks, in-band tracks
          are now registered by the media engine as they are discovered.
      (WebCore::HTMLMediaElement::mediaPlayerDidAddTrack): New, called by the media player when a new
          in-band track is found.
      (WebCore::HTMLMediaElement::mediaPlayerDidRemoveTrack): New, called by the media player when an
          in-band track goes away.
      * html/HTMLMediaElement.h:
      
      * html/track/InbandTextTrack.cpp:
      (WebCore::InbandTextTrack::InbandTextTrack): Use m_private instead of tracksPrivate because
          it is zeroed during assignment.
      
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::addTextTrack): New MediaPlayerClient method to allow MediaPlayerPrivate subclasses
          to add a new in-band track.
      (WebCore::MediaPlayer::removeTextTrack): New MediaPlayerClient method to allow MediaPlayerPrivate subclasses
          to remove a new in-band track.
      * platform/graphics/MediaPlayer.h:
      * platform/graphics/MediaPlayerPrivate.h:
      
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Added.
      (WebCore::InbandTextTrackPrivateAVF::InbandTextTrackPrivateAVF):
      (WebCore::InbandTextTrackPrivateAVF::~InbandTextTrackPrivateAVF):
      (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Convert an attribute string into WebVTT 
          cue setting and content strings.
      (WebCore::InbandTextTrackPrivateAVF::processCue): Process a new cue.
      (WebCore::InbandTextTrackPrivateAVF::disconnect): Clear member variables.
      (WebCore::InbandTextTrackPrivateAVF::resetCueValues): Reset cue values to defaults.
      (WebCore::InbandTextTrackPrivateAVF::setMode): Set track mode and call player's trackModeChanged.
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Added.
      
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: Initialize 
          m_inbandTrackConfigurationPending.
      (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
      (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Flush the currently accumulating
          cue so it doesn't get the wrong duration.
      (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Handle InbandTracksNeedConfiguration.
      (WebCore::MediaPlayerPrivateAVFoundation::flushCurrentCue): New, pass the current cue up to the client.
      (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Configure in-band tracks.
      (WebCore::MediaPlayerPrivateAVFoundation::trackModeChanged): Schedule a call to configureInbandTracks.
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
      
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h: Added.
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Added.
      (WebCore::InbandTextTrackPrivateAVFObjC::InbandTextTrackPrivateAVFObjC):
      (WebCore::InbandTextTrackPrivateAVFObjC::disconnect):
      (WebCore::InbandTextTrackPrivateAVFObjC::kind): Return track kind.
      (WebCore::InbandTextTrackPrivateAVFObjC::label): Return track label.
      (WebCore::InbandTextTrackPrivateAVFObjC::language): Return track language.
      (WebCore::InbandTextTrackPrivateAVFObjC::isDefault): 
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      (MediaPlayerPrivateAVFoundationObjC):
      (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItem):
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize m_currentTrack.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear m_legibleOutput.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Create and initialize m_legibleOutput.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processTextTracks): Called when the player item's
          "tracks" changes, add and remove in-band text tracks as necessary.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Pass an attributed string to the current 
          track to be processed.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Tell AVFoundation to select an in-band track.
      (WebCore::MediaPlayerPrivateAVFoundationObjC::currentTrack): Return the current track.
      (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): Legible
          output delegate.
      
      Source/WTF: 
      
      * wtf/Platform.h: Define HAVE_AVFOUNDATION_TEXT_TRACK_SUPPORT.
      
      LayoutTests: 
      
      Test for initial support for in-band text tracks. New test skipped on all ports that don't 
      have support in the media engine.
      
      * media/content/counting-subtitled.m4v: Added.
      * media/track/track-in-band-expected.txt: Added.
      * media/track/track-in-band.html: Added.
      * platform/chromium/TestExpectations:
      * platform/efl/TestExpectations:
      * platform/gtk/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win/TestExpectations:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      134ccfc9
  7. 21 Nov, 2012 1 commit
    • eric.carlson@apple.com's avatar
      In-band text tracks infrastructure · 243e33e9
      eric.carlson@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102830
      
      Reviewed by Philippe Normand.
      
      Add the infrastructure necessary to allow a port-specific media engine to expose in-band text
      tracks.
      
      No new tests, this patch only adds plumbing. Existing tests verify that these changes don't
      break existing functionality.
      
      * CMakeLists.txt: Add new project files.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::setReadyState): Call processInbandTextTracks when readyState reaches
          HAVE_METADATA
      (WebCore::HTMLMediaElement::processInbandTextTracks): Fetch the in-band text tracks from the 
          media player and processes them.
      * html/HTMLMediaElement.h:
      
      * html/track/InbandTextTrack.cpp: Added.
      * html/track/InbandTextTrack.h: Added.
      * html/track/InbandTextTrackPrivate.h: Added.
      
      * html/track/TextTrack.h:
      (TextTrack):
      (WebCore::TextTrack::clearClient): Remove virtual, it is unnecessary
      (WebCore::TextTrack::mode): Make virtual so derived classes can override.
      (WebCore::TextTrack::setMode): Ditto.
      
      * html/track/TextTrackList.cpp:
      (TextTrackList::length): Update to deal with in-band tracks.
      (TextTrackList::getTrackIndex): Ditto.
      (TextTrackList::getTrackIndexRelativeToRenderedTracks): Ditto.
      (TextTrackList::item): Ditto.
      (TextTrackList::invalidateTrackIndexesAfterTrack): New, invalidate the cached track indexes of
          all tracks after another.
      (TextTrackList::append): Update to deal with in-band tracks.
      (TextTrackList::remove): Update to deal with in-band tracks.
      (TextTrackList::scheduleAddTrackEvent): Remove typo.
      * html/track/TextTrackList.h:
      
      * platform/graphics/MediaPlayer.cpp:
      (WebCore::MediaPlayer::getTextTracks): New, pass through to the media engine.
      (WebCore::MediaPlayer::setTextTrackClient):
      * platform/graphics/MediaPlayer.h:
      
      * platform/graphics/MediaPlayerPrivate.h:
      (WebCore::MediaPlayerPrivateInterface::setPreload): Cleanup.
      (WebCore::MediaPlayerPrivateInterface::sourceEndOfStream): Ditto.
      (WebCore::MediaPlayerPrivateInterface::getTextTracks): New client method.
      (WebCore::MediaPlayerPrivateInterface::setTextTrackClient): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      243e33e9