Permalink
Browse files

[MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextT…

…rack.

https://bugs.webkit.org/show_bug.cgi?id=123374

Reviewed by Eric Carlson.

No tests added; tests will be added when Mock implementations are added in a future patch.

Add new partial interfaces for added methods on AudioTrack, TextTrack, and VideoTrack:
* Modules/mediasource/AudioTrackMediaSource.idl: Add read-only sourceBuffer attribute.
* Modules/mediasource/TextTrackMediaSource.idl: Ditto.
* Modules/mediasource/VideoTrackMediaSource.idl: Ditto.
* Modules/mediasource/AudioTrackMediaSource.h:
(WebCore::AudioTrackMediaSource::sourceBuffer): Added static wrapper around non-static sourceBuffer().
* Modules/mediasource/TextTrackMediaSource.h:
(WebCore::TextTrackMediaSource::sourceBuffer): Ditto.
* Modules/mediasource/VideoTrackMediaSource.h:
(WebCore::VideoTrackMediaSource::sourceBuffer): Ditto.

Add support for writable kind & language attributes through a custom setter:
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setKind):
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* html/track/AudioTrack.idl:
* html/track/TextTrack.idl:
* html/track/VideoTrack.idl:

Add setter methods to the implementation classes:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):
(WebCore::TextTrack::setKind):
(WebCore::TextTrack::setLanguage):
* html/track/TextTrack.h:
* html/track/TrackBase.cpp:
(WebCore::TrackBase::TrackBase):
(WebCore::TrackBase::setKind):
(WebCore::TrackBase::setKindInternal):
* html/track/TrackBase.h:
(WebCore::TrackBase::setLanguage):
(WebCore::TrackBase::sourceBuffer):
(WebCore::TrackBase::setSourceBuffer):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::setKind):
(WebCore::VideoTrack::setLanguage):
* html/track/VideoTrack.h:

Implement the unimplemented portions of MediaSource and SourceBuffer:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer):
* Modules/mediasource/MediaSourceBase.cpp:
(WebCore::MediaSourceBase::MediaSourceBase):
(WebCore::MediaSourceBase::setPrivateAndOpen):
(WebCore::MediaSourceBase::setReadyState):
(WebCore::MediaSourceBase::attachToElement):
* Modules/mediasource/MediaSourceBase.h:
(WebCore::MediaSourceBase::mediaElement):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::videoTracks):
(WebCore::SourceBuffer::audioTracks):
(WebCore::SourceBuffer::textTracks):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddAudioTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddVideoTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddTextTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidChangeActiveState):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:

Add new files to the project:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

And a smorgasbord of other utility changes:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource): Pass this when attaching.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
* html/HTMLMediaSource.h:
* html/track/TextTrackList.cpp:
(TextTrackList::item): Make const.
* html/track/TextTrackList.h:
(WebCore::TextTrackList::lastItem): Added.
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::create): Added.
(WebCore::MockSourceBufferPrivate::trackDidChangeEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information...
jer.noble@apple.com
jer.noble@apple.com committed Nov 7, 2013
1 parent 456c940 commit 9161ec367d01afa6fcbdca4c385066e32e75f92f
Showing with 1,783 additions and 62 deletions.
  1. +92 −0 Source/WebCore/ChangeLog
  2. +5 −0 Source/WebCore/DerivedSources.make
  3. +47 −0 Source/WebCore/Modules/mediasource/AudioTrackMediaSource.h
  4. +31 −0 Source/WebCore/Modules/mediasource/AudioTrackMediaSource.idl
  5. +239 −2 Source/WebCore/Modules/mediasource/MediaSource.cpp
  6. +4 −0 Source/WebCore/Modules/mediasource/MediaSource.h
  7. +6 −6 Source/WebCore/Modules/mediasource/MediaSourceBase.cpp
  8. +3 −3 Source/WebCore/Modules/mediasource/MediaSourceBase.h
  9. +702 −10 Source/WebCore/Modules/mediasource/SourceBuffer.cpp
  10. +58 −3 Source/WebCore/Modules/mediasource/SourceBuffer.h
  11. +5 −0 Source/WebCore/Modules/mediasource/SourceBuffer.idl
  12. +3 −0 Source/WebCore/Modules/mediasource/SourceBufferList.h
  13. +46 −0 Source/WebCore/Modules/mediasource/TextTrackMediaSource.h
  14. +31 −0 Source/WebCore/Modules/mediasource/TextTrackMediaSource.idl
  15. +46 −0 Source/WebCore/Modules/mediasource/VideoTrackMediaSource.h
  16. +30 −0 Source/WebCore/Modules/mediasource/VideoTrackMediaSource.idl
  17. +42 −9 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  18. +28 −0 Source/WebCore/bindings/js/JSAudioTrackCustom.cpp
  19. +28 −0 Source/WebCore/bindings/js/JSTextTrackCustom.cpp
  20. +28 −0 Source/WebCore/bindings/js/JSVideoTrackCustom.cpp
  21. +2 −1 Source/WebCore/html/HTMLMediaElement.cpp
  22. +2 −1 Source/WebCore/html/HTMLMediaSource.h
  23. +7 −2 Source/WebCore/html/TimeRanges.cpp
  24. +3 −1 Source/WebCore/html/TimeRanges.h
  25. +1 −1 Source/WebCore/html/track/AudioTrack.h
  26. +2 −2 Source/WebCore/html/track/AudioTrack.idl
  27. +51 −1 Source/WebCore/html/track/TextTrack.cpp
  28. +6 −0 Source/WebCore/html/track/TextTrack.h
  29. +2 −2 Source/WebCore/html/track/TextTrack.idl
  30. +1 −1 Source/WebCore/html/track/TextTrackList.cpp
  31. +3 −1 Source/WebCore/html/track/TextTrackList.h
  32. +8 −0 Source/WebCore/html/track/TrackBase.cpp
  33. +15 −1 Source/WebCore/html/track/TrackBase.h
  34. +10 −0 Source/WebCore/html/track/TrackListBase.cpp
  35. +2 −0 Source/WebCore/html/track/TrackListBase.h
  36. +54 −7 Source/WebCore/html/track/VideoTrack.cpp
  37. +10 −0 Source/WebCore/html/track/VideoTrack.h
  38. +2 −2 Source/WebCore/html/track/VideoTrack.idl
  39. +45 −0 Source/WebCore/platform/MediaDescription.h
  40. +65 −0 Source/WebCore/platform/MediaSample.h
  41. +10 −4 Source/WebCore/platform/graphics/InbandTextTrackPrivate.h
  42. +4 −0 Source/WebCore/platform/graphics/MediaSourcePrivate.h
  43. +4 −2 Source/WebCore/platform/graphics/SourceBufferPrivate.h
View
@@ -1,3 +1,95 @@
2013-10-25 Jer Noble <jer.noble@apple.com>
[MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextTrack.
https://bugs.webkit.org/show_bug.cgi?id=123374
Reviewed by Eric Carlson.
No tests added; tests will be added when Mock implementations are added in a future patch.
Add new partial interfaces for added methods on AudioTrack, TextTrack, and VideoTrack:
* Modules/mediasource/AudioTrackMediaSource.idl: Add read-only sourceBuffer attribute.
* Modules/mediasource/TextTrackMediaSource.idl: Ditto.
* Modules/mediasource/VideoTrackMediaSource.idl: Ditto.
* Modules/mediasource/AudioTrackMediaSource.h:
(WebCore::AudioTrackMediaSource::sourceBuffer): Added static wrapper around non-static sourceBuffer().
* Modules/mediasource/TextTrackMediaSource.h:
(WebCore::TextTrackMediaSource::sourceBuffer): Ditto.
* Modules/mediasource/VideoTrackMediaSource.h:
(WebCore::VideoTrackMediaSource::sourceBuffer): Ditto.
Add support for writable kind & language attributes through a custom setter:
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setKind):
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* html/track/AudioTrack.idl:
* html/track/TextTrack.idl:
* html/track/VideoTrack.idl:
Add setter methods to the implementation classes:
* html/track/TextTrack.cpp:
(WebCore::TextTrack::TextTrack):
(WebCore::TextTrack::setKind):
(WebCore::TextTrack::setLanguage):
* html/track/TextTrack.h:
* html/track/TrackBase.cpp:
(WebCore::TrackBase::TrackBase):
(WebCore::TrackBase::setKind):
(WebCore::TrackBase::setKindInternal):
* html/track/TrackBase.h:
(WebCore::TrackBase::setLanguage):
(WebCore::TrackBase::sourceBuffer):
(WebCore::TrackBase::setSourceBuffer):
* html/track/VideoTrack.cpp:
(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::setKind):
(WebCore::VideoTrack::setLanguage):
* html/track/VideoTrack.h:
Implement the unimplemented portions of MediaSource and SourceBuffer:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::removeSourceBuffer):
* Modules/mediasource/MediaSourceBase.cpp:
(WebCore::MediaSourceBase::MediaSourceBase):
(WebCore::MediaSourceBase::setPrivateAndOpen):
(WebCore::MediaSourceBase::setReadyState):
(WebCore::MediaSourceBase::attachToElement):
* Modules/mediasource/MediaSourceBase.h:
(WebCore::MediaSourceBase::mediaElement):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::videoTracks):
(WebCore::SourceBuffer::audioTracks):
(WebCore::SourceBuffer::textTracks):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddAudioTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddVideoTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidAddTextTrack):
(WebCore::SourceBuffer::sourceBufferPrivateDidChangeActiveState):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
Add new files to the project:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
And a smorgasbord of other utility changes:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource): Pass this when attaching.
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
* html/HTMLMediaSource.h:
* html/track/TextTrackList.cpp:
(TextTrackList::item): Make const.
* html/track/TextTrackList.h:
(WebCore::TextTrackList::lastItem): Added.
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::create): Added.
(WebCore::MockSourceBufferPrivate::trackDidChangeEnabled):
2013-11-06 Vani Hegde <vani.hegde@samsung.com>
Applied background color is not retained after typing a characters
@@ -94,9 +94,14 @@ BINDING_IDLS = \
$(WebCore)/Modules/indieui/UIRequestEvent.idl \
$(WebCore)/Modules/mediacontrols/MediaControlsHost.idl \
$(WebCore)/Modules/mediasource/DOMURLMediaSource.idl \
$(WebCore)/Modules/mediasource/AudioTrackMediaSource.idl \
$(WebCore)/Modules/mediasource/MediaSource.idl \
$(WebCore)/Modules/mediasource/SourceBuffer.idl \
$(WebCore)/Modules/mediasource/SourceBufferList.idl \
$(WebCore)/Modules/mediasource/SourceBuffer.idl \
$(WebCore)/Modules/mediasource/SourceBufferList.idl \
$(WebCore)/Modules/mediasource/TextTrackMediaSource.idl \
$(WebCore)/Modules/mediasource/VideoTrackMediaSource.idl \
$(WebCore)/Modules/mediastream/AllVideoCapabilities.idl \
$(WebCore)/Modules/mediastream/AllAudioCapabilities.idl \
$(WebCore)/Modules/mediastream/AudioStreamTrack.idl \
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AudioTrackMediaSource_h
#define AudioTrackMediaSource_h
#if ENABLE(MEDIA_SOURCE) && ENABLE(VIDEO_TRACK)
#include "AudioTrack.h"
namespace WebCore {
class SourceBuffer;
class AudioTrackMediaSource {
public:
static SourceBuffer* sourceBuffer(AudioTrack* track) { return track->sourceBuffer(); }
};
}
#endif
#endif
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
Conditional=MEDIA_SOURCE&VIDEO_TRACK,
]
partial interface AudioTrack {
readonly attribute SourceBuffer sourceBuffer;
};
Oops, something went wrong.

0 comments on commit 9161ec3

Please sign in to comment.