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

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

Issue 14188039: MediaStream API: Remove LocalMediaStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed tests 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
« no previous file with comments | « Source/core/dom/EventTargetFactory.in ('k') | Source/modules/mediastream/LocalMediaStream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef MediaStreamDescriptor_h 32 #ifndef MediaStreamDescriptor_h
33 #define MediaStreamDescriptor_h 33 #define MediaStreamDescriptor_h
34 34
35 #if ENABLE(MEDIA_STREAM) 35 #if ENABLE(MEDIA_STREAM)
36 36
37 #include "MediaStreamComponent.h" 37 #include "core/platform/UUID.h"
38 #include <wtf/RefCounted.h> 38 #include "core/platform/mediastream/MediaStreamComponent.h"
39 #include <wtf/Vector.h> 39 #include "wtf/RefCounted.h"
40 #include "wtf/Vector.h"
40 41
41 namespace WebCore { 42 namespace WebCore {
42 43
43 class MediaStreamDescriptorClient { 44 class MediaStreamDescriptorClient {
44 public: 45 public:
45 virtual ~MediaStreamDescriptorClient() { } 46 virtual ~MediaStreamDescriptorClient() { }
46 47
47 virtual void trackEnded() = 0; 48 virtual void trackEnded() = 0;
48 virtual void streamEnded() = 0; 49 virtual void streamEnded() = 0;
49 virtual void addRemoteTrack(MediaStreamComponent*) = 0; 50 virtual void addRemoteTrack(MediaStreamComponent*) = 0;
50 virtual void removeRemoteTrack(MediaStreamComponent*) = 0; 51 virtual void removeRemoteTrack(MediaStreamComponent*) = 0;
51 }; 52 };
52 53
53 class MediaStreamDescriptor : public RefCounted<MediaStreamDescriptor> { 54 class MediaStreamDescriptor : public RefCounted<MediaStreamDescriptor> {
54 public: 55 public:
55 class ExtraData : public RefCounted<ExtraData> { 56 class ExtraData : public RefCounted<ExtraData> {
56 public: 57 public:
57 virtual ~ExtraData() { } 58 virtual ~ExtraData() { }
58 }; 59 };
59 60
60 static PassRefPtr<MediaStreamDescriptor> create(const String& id, const Medi aStreamSourceVector& audioSources, const MediaStreamSourceVector& videoSources) 61 static PassRefPtr<MediaStreamDescriptor> create(const MediaStreamSourceVecto r& audioSources, const MediaStreamSourceVector& videoSources)
61 { 62 {
62 return adoptRef(new MediaStreamDescriptor(id, audioSources, videoSources )); 63 return adoptRef(new MediaStreamDescriptor(createCanonicalUUIDString(), a udioSources, videoSources));
63 } 64 }
64 65
65 static PassRefPtr<MediaStreamDescriptor> create(const String& id, const Medi aStreamComponentVector& audioComponents, const MediaStreamComponentVector& video Components) 66 static PassRefPtr<MediaStreamDescriptor> create(const String& id, const Medi aStreamComponentVector& audioComponents, const MediaStreamComponentVector& video Components)
66 { 67 {
67 return adoptRef(new MediaStreamDescriptor(id, audioComponents, videoComp onents)); 68 return adoptRef(new MediaStreamDescriptor(id, audioComponents, videoComp onents));
68 } 69 }
69 70
70 MediaStreamDescriptorClient* client() const { return m_client; } 71 MediaStreamDescriptorClient* client() const { return m_client; }
71 void setClient(MediaStreamDescriptorClient* client) { m_client = client; } 72 void setClient(MediaStreamDescriptorClient* client) { m_client = client; }
72 73
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 RefPtr<ExtraData> m_extraData; 169 RefPtr<ExtraData> m_extraData;
169 }; 170 };
170 171
171 typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector; 172 typedef Vector<RefPtr<MediaStreamDescriptor> > MediaStreamDescriptorVector;
172 173
173 } // namespace WebCore 174 } // namespace WebCore
174 175
175 #endif // ENABLE(MEDIA_STREAM) 176 #endif // ENABLE(MEDIA_STREAM)
176 177
177 #endif // MediaStreamDescriptor_h 178 #endif // MediaStreamDescriptor_h
OLDNEW
« no previous file with comments | « Source/core/dom/EventTargetFactory.in ('k') | Source/modules/mediastream/LocalMediaStream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698