Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: Source/WebCore/platform/chromium/support/WebMediaStream.cpp

Issue 12326102: Merge 142773 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/platform/chromium/support/WebMediaStream.cpp
===================================================================
--- Source/WebCore/platform/chromium/support/WebMediaStream.cpp (revision 143918)
+++ Source/WebCore/platform/chromium/support/WebMediaStream.cpp (working copy)
@@ -94,22 +94,22 @@
m_private->setExtraData(adoptRef(new ExtraDataContainer(extraData)));
}
-void WebMediaStream::audioSources(WebVector<WebMediaStreamTrack>& webSources) const
+void WebMediaStream::audioTracks(WebVector<WebMediaStreamTrack>& webTracks) const
{
- size_t numberOfSources = m_private->numberOfAudioComponents();
- WebVector<WebMediaStreamTrack> result(numberOfSources);
- for (size_t i = 0; i < numberOfSources; ++i)
+ size_t numberOfTracks = m_private->numberOfAudioComponents();
+ WebVector<WebMediaStreamTrack> result(numberOfTracks);
+ for (size_t i = 0; i < numberOfTracks; ++i)
result[i] = m_private->audioComponent(i);
- webSources.swap(result);
+ webTracks.swap(result);
}
-void WebMediaStream::videoSources(WebVector<WebMediaStreamTrack>& webSources) const
+void WebMediaStream::videoTracks(WebVector<WebMediaStreamTrack>& webTracks) const
{
- size_t numberOfSources = m_private->numberOfVideoComponents();
- WebVector<WebMediaStreamTrack> result(numberOfSources);
- for (size_t i = 0; i < numberOfSources; ++i)
+ size_t numberOfTracks = m_private->numberOfVideoComponents();
+ WebVector<WebMediaStreamTrack> result(numberOfTracks);
+ for (size_t i = 0; i < numberOfTracks; ++i)
result[i] = m_private->videoComponent(i);
- webSources.swap(result);
+ webTracks.swap(result);
}
WebMediaStream& WebMediaStream::operator=(const PassRefPtr<WebCore::MediaStreamDescriptor>& mediaStreamDescriptor)
@@ -130,18 +130,32 @@
void WebMediaStream::initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources)
{
- MediaStreamSourceVector audio, video;
+ MediaStreamComponentVector audio, video;
for (size_t i = 0; i < audioSources.size(); ++i) {
- MediaStreamSource* curr = audioSources[i];
- audio.append(curr);
+ MediaStreamSource* source = audioSources[i];
+ audio.append(MediaStreamComponent::create(source->id(), source));
}
for (size_t i = 0; i < videoSources.size(); ++i) {
- MediaStreamSource* curr = videoSources[i];
- video.append(curr);
+ MediaStreamSource* source = videoSources[i];
+ video.append(MediaStreamComponent::create(source->id(), source));
}
m_private = MediaStreamDescriptor::create(label, audio, video);
}
+void WebMediaStream::initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks)
+{
+ MediaStreamComponentVector audio, video;
+ for (size_t i = 0; i < audioTracks.size(); ++i) {
+ MediaStreamComponent* component = audioTracks[i];
+ audio.append(component);
+ }
+ for (size_t i = 0; i < videoTracks.size(); ++i) {
+ MediaStreamComponent* component = videoTracks[i];
+ video.append(component);
+ }
+ m_private = MediaStreamDescriptor::create(label, audio, video);
+}
+
void WebMediaStream::assign(const WebMediaStream& other)
{
m_private = other.m_private;

Powered by Google App Engine
This is Rietveld 408576698