Adding platform implementation of MediaStreamTrack
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 17:35:20 +0000 (17:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2013 17:35:20 +0000 (17:35 +0000)
commit073dbf04be2ac445e110707b2be41bb57de7307e
treec07a0efbb264c67e2e3ed95c9411602f11ed8f95
parentcea5d71a884bd4fd9881177b6156ec974fb05dff
Adding platform implementation of MediaStreamTrack
https://bugs.webkit.org/show_bug.cgi?id=123301

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-10-25
Reviewed by Eric Carlson.

No new tests needed.

* CMakeLists.txt:
* Modules/mediastream/AudioStreamTrack.cpp:
(WebCore::AudioStreamTrack::create): Create method now receives a MediaStreamTrackPrivate as parameter.

(WebCore::AudioStreamTrack::AudioStreamTrack):
* Modules/mediastream/AudioStreamTrack.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Constructor now iterates through a set of MediaStreamTrackPrivate
instances to create each MediaStreamTrack of MediaStream.

(WebCore::MediaStream::addRemoteSource): Calling AudioStreamTrack and VideoStreamTrack with
MediaStreamTrackPrivate as parameter.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack): Constructor now receives a MediaStreamTrackPrivate, instead of a
MediaStreamSource.

(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::kind): Calling method from MediaStreamTrackPrivate.

(WebCore::MediaStreamTrack::setSource): Ditto.

(WebCore::MediaStreamTrack::id): Ditto.

(WebCore::MediaStreamTrack::label): Ditto.

(WebCore::MediaStreamTrack::enabled): Ditto.

(WebCore::MediaStreamTrack::setEnabled): Ditto.

(WebCore::MediaStreamTrack::muted): Ditto.

(WebCore::MediaStreamTrack::readonly): Ditto.

(WebCore::MediaStreamTrack::remote): Ditto.

(WebCore::MediaStreamTrack::readyState): Ditto.

(WebCore::MediaStreamTrack::states):
(WebCore::MediaStreamTrack::capabilities):
(WebCore::MediaStreamTrack::clone):
(WebCore::MediaStreamTrack::stopProducingData):
(WebCore::MediaStreamTrack::ended): Ditto.

(WebCore::MediaStreamTrack::sourceStateChanged): Ditto.

(WebCore::MediaStreamTrack::sourceMutedChanged): Ditto.

(WebCore::MediaStreamTrack::sourceEnabledChanged): Ditto.
(WebCore::MediaStreamTrack::configureTrackRendering):
(WebCore::MediaStreamTrack::stopped): Ditto.

(WebCore::MediaStreamTrack::trackDidEnd): Setting Ended ready state in MediaStreamTrackPrivate.

(WebCore::MediaStreamTrack::trackReadyStateChanged): Dispatches Live or Ended event.

(WebCore::MediaStreamTrack::trackMutedChanged): Dispatches Muted event.

* Modules/mediastream/MediaStreamTrack.h: Now inheriting from MediaStreamTrackPrivateClient.

(WebCore::MediaStreamTrack::source): Calling method from MediaStreamTrackPrivate.
(WebCore::MediaStreamTrack::privateTrack):
* Modules/mediastream/VideoStreamTrack.cpp:
(WebCore::VideoStreamTrack::create):
(WebCore::VideoStreamTrack::VideoStreamTrack): Create method now receives a MediaStreamTrackPrivate as parameter.
* Modules/mediastream/VideoStreamTrack.h:
* platform/mediastream/MediaStreamDescriptor.cpp:
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor): Stores the private tracks in a Vector (property of
MediaStreamDescriptor class).

(WebCore::MediaStreamDescriptor::addTrack): Adds a private track to the tracks' Vector

(WebCore::MediaStreamDescriptor::removeTrack): Removes a private track from the tracks' Vector

* platform/mediastream/MediaStreamDescriptor.h:
(WebCore::MediaStreamDescriptor::numberOfAudioSources): Renamed from numberOfAudioStreams.

(WebCore::MediaStreamDescriptor::audioSources): Renamed from audioStreams.

(WebCore::MediaStreamDescriptor::numberOfVideoSources): Renamed from numberOfVideoStreams.

(WebCore::MediaStreamDescriptor::videoSources): Renamed from videoStreams.

(WebCore::MediaStreamDescriptor::numberOfAudioTracks): Returns the number of audio tracks this MediaStreamDescriptor
has.

(WebCore::MediaStreamDescriptor::audioTracks): Returns a audio track, given an index

(WebCore::MediaStreamDescriptor::numberOfVideoTracks): Returns the number of video tracks this MediaStreamDescriptor
has.
(WebCore::MediaStreamDescriptor::videoTracks): Returns a video track, given an index
* platform/mediastream/MediaStreamTrackPrivate.cpp: Added.
* platform/mediastream/MediaStreamTrackPrivate.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/AudioStreamTrack.cpp
Source/WebCore/Modules/mediastream/AudioStreamTrack.h
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/VideoStreamTrack.cpp
Source/WebCore/Modules/mediastream/VideoStreamTrack.h
Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp
Source/WebCore/platform/mediastream/MediaStreamDescriptor.h
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp [new file with mode: 0644]
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h [new file with mode: 0644]