| Index: third_party/WebKit/Source/platform/exported/WebMediaStream.cpp
|
| diff --git a/third_party/WebKit/Source/platform/exported/WebMediaStream.cpp b/third_party/WebKit/Source/platform/exported/WebMediaStream.cpp
|
| index 42f9cbca1e285e6dd0156bc87114255ff50367da..942518a410e0f7313662d8d5193add770f7d5430 100644
|
| --- a/third_party/WebKit/Source/platform/exported/WebMediaStream.cpp
|
| +++ b/third_party/WebKit/Source/platform/exported/WebMediaStream.cpp
|
| @@ -24,16 +24,17 @@
|
|
|
| #include "public/platform/WebMediaStream.h"
|
|
|
| +#include <memory>
|
| #include "platform/UUID.h"
|
| #include "platform/mediastream/MediaStreamComponent.h"
|
| #include "platform/mediastream/MediaStreamDescriptor.h"
|
| #include "platform/mediastream/MediaStreamSource.h"
|
| +#include "platform/wtf/PtrUtil.h"
|
| +#include "platform/wtf/Vector.h"
|
| +#include "platform/wtf/text/WTFString.h"
|
| #include "public/platform/WebMediaStreamSource.h"
|
| #include "public/platform/WebMediaStreamTrack.h"
|
| #include "public/platform/WebString.h"
|
| -#include "wtf/PtrUtil.h"
|
| -#include "wtf/Vector.h"
|
| -#include <memory>
|
|
|
| namespace blink {
|
|
|
| @@ -93,6 +94,32 @@ void WebMediaStream::videoTracks(
|
| webTracks.swap(result);
|
| }
|
|
|
| +WebMediaStreamTrack WebMediaStream::getAudioTrack(
|
| + const WebString& trackId) const {
|
| + size_t numberOfTracks = m_private->numberOfAudioComponents();
|
| + String id = trackId;
|
| + for (size_t i = 0; i < numberOfTracks; ++i) {
|
| + MediaStreamComponent* audioComponent = m_private->audioComponent(i);
|
| + DCHECK(audioComponent);
|
| + if (audioComponent->id() == id)
|
| + return m_private->audioComponent(i);
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| +WebMediaStreamTrack WebMediaStream::getVideoTrack(
|
| + const WebString& trackId) const {
|
| + size_t numberOfTracks = m_private->numberOfVideoComponents();
|
| + String id = trackId;
|
| + for (size_t i = 0; i < numberOfTracks; ++i) {
|
| + MediaStreamComponent* videoComponent = m_private->videoComponent(i);
|
| + DCHECK(videoComponent);
|
| + if (videoComponent->id() == id)
|
| + return m_private->videoComponent(i);
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| void WebMediaStream::addTrack(const WebMediaStreamTrack& track) {
|
| ASSERT(!isNull());
|
| m_private->addRemoteTrack(track);
|
|
|