MediaStreamTrack now tracks its own state
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 21:14:37 +0000 (21:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 21:14:37 +0000 (21:14 +0000)
commitf37f218704fa8c6b59bec298ea67f38c57c2c51b
tree538b151021beda1b7c27d9b945683246c2246a71
parent9ee6a8ff4b760aa1d251862fffde0225eb40ac9d
MediaStreamTrack now tracks its own state
https://bugs.webkit.org/show_bug.cgi?id=123025

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-10-21
Reviewed by Jer Noble.

The spec says that a MediaStreamSource can be shared by different tracks,
so a track must have its own state tracking, synchronizing with its MediaStreamSource when
the underlying MediaStreamSource changes the readyState.
In the old implementation if a user invoked the stop method, its readyState method was still
returning the MediaStreamSource state, which was wrong.
This also adds a setEnabled method, which can be used to set the state of a track when a
remote peer ends it, for instance.

No new tests needed.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::readyState):
(WebCore::MediaStreamTrack::setState):
(WebCore::MediaStreamTrack::stopProducingData):
(WebCore::MediaStreamTrack::ended):
(WebCore::MediaStreamTrack::sourceStateChanged):
(WebCore::MediaStreamTrack::trackDidEnd):
* Modules/mediastream/MediaStreamTrack.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h