Index: Source/WebCore/platform/mediastream/MediaStreamDescriptor.h |
=================================================================== |
--- Source/WebCore/platform/mediastream/MediaStreamDescriptor.h (revision 143918) |
+++ Source/WebCore/platform/mediastream/MediaStreamDescriptor.h (working copy) |
@@ -61,6 +61,11 @@ |
return adoptRef(new MediaStreamDescriptor(id, audioSources, videoSources)); |
} |
+ static PassRefPtr<MediaStreamDescriptor> create(const String& id, const MediaStreamComponentVector& audioComponents, const MediaStreamComponentVector& videoComponents) |
+ { |
+ return adoptRef(new MediaStreamDescriptor(id, audioComponents, videoComponents)); |
+ } |
+ |
MediaStreamDescriptorClient* client() const { return m_client; } |
void setClient(MediaStreamDescriptorClient* client) { m_client = client; } |
@@ -98,6 +103,7 @@ |
, m_id(id) |
, m_ended(false) |
{ |
+ ASSERT(m_id.length()); |
for (size_t i = 0; i < audioSources.size(); i++) |
m_audioComponents.append(MediaStreamComponent::create(this, audioSources[i])); |
@@ -105,6 +111,22 @@ |
m_videoComponents.append(MediaStreamComponent::create(this, videoSources[i])); |
} |
+ MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& audioComponents, const MediaStreamComponentVector& videoComponents) |
+ : m_client(0) |
+ , m_id(id) |
+ , m_ended(false) |
+ { |
+ ASSERT(m_id.length()); |
+ for (MediaStreamComponentVector::const_iterator iter = audioComponents.begin(); iter != audioComponents.end(); ++iter) { |
+ (*iter)->setStream(this); |
+ m_audioComponents.append((*iter)); |
+ } |
+ for (MediaStreamComponentVector::const_iterator iter = videoComponents.begin(); iter != videoComponents.end(); ++iter) { |
+ (*iter)->setStream(this); |
+ m_videoComponents.append((*iter)); |
+ } |
+ } |
+ |
MediaStreamDescriptorClient* m_client; |
String m_id; |
Vector<RefPtr<MediaStreamComponent> > m_audioComponents; |