[GStreamer] Support audio and video tracks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Nov 2013 16:30:03 +0000 (16:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Nov 2013 16:30:03 +0000 (16:30 +0000)
commit5989d90316d549519d20147dd8a4ebdbdbb06277
tree6582a7c9fd25cc494d98457ad1aab760fd25a2bb
parent1f167c8eeecd1c5b368f55e3e55de50dd05b7727
[GStreamer] Support audio and video tracks
https://bugs.webkit.org/show_bug.cgi?id=117039

Patch by Brendan Long <b.long@cablelabs.com> on 2013-11-01
Reviewed by Philippe Normand.

Source/WebCore:

Tests: media/track/audio/audio-track-mkv-vorbis-addtrack.html
       media/track/audio/audio-track-mkv-vorbis-enabled.html
       media/track/audio/audio-track-mkv-vorbis-language.html
       media/track/in-band/track-in-band-kate-ogg-addtrack.html
       media/track/in-band/track-in-band-srt-mkv-addtrack.html
       media/track/video/video-track-mkv-theora-addtrack.html
       media/track/video/video-track-mkv-theora-language.html
       media/track/video/video-track-mkv-theora-selected.html

* GNUmakefile.list.am: Add audio and video track files.
* PlatformEfl.cmake: Same.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::audioTrackEnabledChanged): Schedule "change" event.
(WebCore::HTMLMediaElement::videoTrackSelectedChanged): Same.
* html/track/AudioTrack.cpp:
(WebCore::AudioTrack::setEnabled): Call m_private->setEnabled
(WebCore::AudioTrack::enabledChanged): Added callback.
(WebCore::AudioTrack::labelChanged): Same.
(WebCore::AudioTrack::languageChanged): Same.
(WebCore::AudioTrack::willRemoveAudioTrackPrivate): Use ASSERT_UNUSED for consistence.
* html/track/AudioTrack.h: Add new enabled, label and language callbacks.
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::setSelected): Call m_private->setEnabled
(WebCore::VideoTrack::selectedChanged): Added callback.
(WebCore::VideoTrack::labelChanged): Same.
(WebCore::VideoTrack::languageChanged): Same.
(WebCore::VideoTrack::willRemoveVideoTrackPrivate): Use ASSERT_UNUSED for consistence.
* html/track/VideoTrack.h: Add new selected, label and language callbacks.
* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::setEnabled): Call m_client->enabledChanged
* platform/graphics/VideoTrackPrivate.h:
(WebCore::VideoTrackPrivate::setSelected): Call m_client->selectedChanged
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::InbandTextTrackPrivateGStreamer): Add ASSERT(m_pad)
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfTagsChanged): Look at all tag events instead of just the first one.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::mediaPlayerPrivateVideoSinkCapsChangedCallback): Separated callback when caps change from callback when number of videos change.
(WebCore::mediaPlayerPrivateVideoCapsChangeTimeoutCallback): Same.
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Initialize m_videoCapsTimerHandler.
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Disconnect audio and video tracks and remove callbacks.
(WebCore::MediaPlayerPrivateGStreamer::videoCapsChanged): Separated callback when caps change from callback when number of videos change.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Create video tracks for each stream.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps): Separated callback when caps change from callback when number of videos change.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Create audio tracks for each stream.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add audio and video tracks, and a pointer to keep track of the default audio stream.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: Added.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Added.
* platform/graphics/gstreamer/GRefPtrGStreamer.cpp: Add GRefPtr<GstTagList>
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: Added, handles tags and "active" property of audio and video tracks.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Added.
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: Added.
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Added.

LayoutTests:

* media/content/two-audio-and-video-tracks.mkv: Added.
* media/in-band-tracks.js: Renamed from LayoutTests/media/in-band-cues.js.
(testAddTrack): Tests addtrack events.
(testAttribute): Added "type" parameter so we can use this for audio and video tracks.
(testTextTrackMode): Renamed to make it clear that this only applies to text tracks.
(testCueStyle): Same.
(testTextTrackOrder): Same.
* media/track/audio/audio-track-mkv-vorbis-addtrack-expected.txt: Added.
* media/track/audio/audio-track-mkv-vorbis-addtrack.html: Copied from LayoutTests/media/track/in-band/track-in-band-srt-mkv-track-order.html.
* media/track/audio/audio-track-mkv-vorbis-enabled-expected.txt: Added.
* media/track/audio/audio-track-mkv-vorbis-enabled.html: Added.
* media/track/audio/audio-track-mkv-vorbis-language-expected.txt: Added.
* media/track/audio/audio-track-mkv-vorbis-language.html: Copied from LayoutTests/media/track/in-band/track-in-band-kate-ogg-track-order.html.
* media/track/in-band/track-in-band-kate-ogg-addtrack-expected.txt: Added.
* media/track/in-band/track-in-band-kate-ogg-addtrack.html: Copied from LayoutTests/media/track/in-band/track-in-band-srt-mkv-track-order.html.
* media/track/in-band/track-in-band-kate-ogg-cues-added-once.html: Added.
* media/track/in-band/track-in-band-kate-ogg-kind.html: Added.
* media/track/in-band/track-in-band-kate-ogg-language.html: Added.
* media/track/in-band/track-in-band-kate-ogg-mode.html: Added.
* media/track/in-band/track-in-band-kate-ogg-style.html: Added.
* media/track/in-band/track-in-band-kate-ogg-track-order.html: Added.
* media/track/in-band/track-in-band-srt-mkv-addtrack-expected.txt: Added.
* media/track/in-band/track-in-band-srt-mkv-addtrack.html: Copied from LayoutTests/media/track/in-band/track-in-band-srt-mkv-track-order.html.
* media/track/in-band/track-in-band-srt-mkv-cues-added-once.html: Added.
* media/track/in-band/track-in-band-srt-mkv-kind.html: Added.
* media/track/in-band/track-in-band-srt-mkv-language.html: Added.
* media/track/in-band/track-in-band-srt-mkv-mode.html: Added.
* media/track/in-band/track-in-band-srt-mkv-style.html: Added.
* media/track/in-band/track-in-band-srt-mkv-track-order.html: Added.
* media/track/video/video-track-mkv-theora-addtrack-expected.txt: Added.
* media/track/video/video-track-mkv-theora-addtrack.html: Copied from LayoutTests/media/track/in-band/track-in-band-srt-mkv-track-order.html.
* media/track/video/video-track-mkv-theora-language-expected.txt: Added.
* media/track/video/video-track-mkv-theora-language.html: Copied from LayoutTests/media/track/in-band/track-in-band-kate-ogg-track-order.html.
* media/track/video/video-track-mkv-theora-selected-expected.txt: Added.
* media/track/video/video-track-mkv-theora-selected.html: Added.
* platform/mac/TestExpectations: Ignore audio and video track tests on mac.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
LayoutTests/ChangeLog
LayoutTests/media/content/two-audio-and-video-tracks.mkv [new file with mode: 0644]
LayoutTests/media/in-band-tracks.js [moved from LayoutTests/media/in-band-cues.js with 80% similarity]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-addtrack-expected.txt [new file with mode: 0644]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-addtrack.html [new file with mode: 0644]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-enabled-expected.txt [new file with mode: 0644]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-enabled.html [new file with mode: 0644]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-language-expected.txt [new file with mode: 0644]
LayoutTests/media/track/audio/audio-track-mkv-vorbis-language.html [new file with mode: 0644]
LayoutTests/media/track/in-band/track-in-band-kate-ogg-addtrack-expected.txt [new file with mode: 0644]
LayoutTests/media/track/in-band/track-in-band-kate-ogg-addtrack.html [new file with mode: 0644]
LayoutTests/media/track/in-band/track-in-band-kate-ogg-cues-added-once.html
LayoutTests/media/track/in-band/track-in-band-kate-ogg-kind.html
LayoutTests/media/track/in-band/track-in-band-kate-ogg-language.html
LayoutTests/media/track/in-band/track-in-band-kate-ogg-mode.html
LayoutTests/media/track/in-band/track-in-band-kate-ogg-style.html
LayoutTests/media/track/in-band/track-in-band-kate-ogg-track-order.html
LayoutTests/media/track/in-band/track-in-band-mkv-chapters.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-addtrack-expected.txt [new file with mode: 0644]
LayoutTests/media/track/in-band/track-in-band-srt-mkv-addtrack.html [new file with mode: 0644]
LayoutTests/media/track/in-band/track-in-band-srt-mkv-cues-added-once.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-kind.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-language.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-mode.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-style.html
LayoutTests/media/track/in-band/track-in-band-srt-mkv-track-order.html
LayoutTests/media/track/video/video-track-mkv-theora-addtrack-expected.txt [new file with mode: 0644]
LayoutTests/media/track/video/video-track-mkv-theora-addtrack.html [new file with mode: 0644]
LayoutTests/media/track/video/video-track-mkv-theora-language-expected.txt [new file with mode: 0644]
LayoutTests/media/track/video/video-track-mkv-theora-language.html [new file with mode: 0644]
LayoutTests/media/track/video/video-track-mkv-theora-selected-expected.txt [new file with mode: 0644]
LayoutTests/media/track/video/video-track-mkv-theora-selected.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/PlatformEfl.cmake
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/track/AudioTrack.cpp
Source/WebCore/html/track/AudioTrack.h
Source/WebCore/html/track/VideoTrack.cpp
Source/WebCore/html/track/VideoTrack.h
Source/WebCore/platform/graphics/AudioTrackPrivate.h
Source/WebCore/platform/graphics/VideoTrackPrivate.h
Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h [new file with mode: 0644]
Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.h
Source/WebCore/platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h [new file with mode: 0644]
Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h [new file with mode: 0644]