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

Side by Side Diff: Source/WebCore/platform/mediastream/MediaStreamDescriptor.h

Issue 13844006: MediaStream API: Moving Add/Remove track from WebMediaStreamCenterClient to WebMediaStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 size_t pos = m_audioComponents.find(component); 80 size_t pos = m_audioComponents.find(component);
81 if (pos != notFound) 81 if (pos != notFound)
82 m_audioComponents.remove(pos); 82 m_audioComponents.remove(pos);
83 } 83 }
84 84
85 unsigned numberOfVideoComponents() const { return m_videoComponents.size(); } 85 unsigned numberOfVideoComponents() const { return m_videoComponents.size(); }
86 MediaStreamComponent* videoComponent(unsigned index) const { return m_videoC omponents[index].get(); } 86 MediaStreamComponent* videoComponent(unsigned index) const { return m_videoC omponents[index].get(); }
87 void addVideoComponent(PassRefPtr<MediaStreamComponent> component) { m_video Components.append(component); } 87 void addVideoComponent(PassRefPtr<MediaStreamComponent> component) { m_video Components.append(component); }
88 void removeVideoComponent(MediaStreamComponent* component) 88 void removeVideoComponent(MediaStreamComponent* component)
89 { 89 {
90 size_t pos = m_audioComponents.find(component); 90 size_t pos = m_videoComponents.find(component);
91 if (pos != notFound) 91 if (pos != notFound)
92 m_audioComponents.remove(pos); 92 m_videoComponents.remove(pos);
93 }
94
95 void addRemoteTrack(MediaStreamComponent* component)
96 {
97 if (m_client)
98 m_client->addRemoteTrack(component);
99 }
100
101 void removeRemoteTrack(MediaStreamComponent* component)
102 {
103 if (m_client)
104 m_client->removeRemoteTrack(component);
93 } 105 }
94 106
95 bool ended() const { return m_ended; } 107 bool ended() const { return m_ended; }
96 void setEnded() { m_ended = true; } 108 void setEnded() { m_ended = true; }
97 109
98 PassRefPtr<ExtraData> extraData() const { return m_extraData; } 110 PassRefPtr<ExtraData> extraData() const { return m_extraData; }
99 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; } 111 void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData ; }
100 112
101 private: 113 private:
102 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio Sources, const MediaStreamSourceVector& videoSources) 114 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio Sources, const MediaStreamSourceVector& videoSources)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 RefPtr<ExtraData> m_extraData; 149 RefPtr<ExtraData> m_extraData;
138 }; 150 };
139 151
140 typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector; 152 typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector;
141 153
142 } // namespace WebCore 154 } // namespace WebCore
143 155
144 #endif // ENABLE(MEDIA_STREAM) 156 #endif // ENABLE(MEDIA_STREAM)
145 157
146 #endif // MediaStreamDescriptor_h 158 #endif // MediaStreamDescriptor_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698