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

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

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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. 2 * Copyright (C) 2011 Ericsson AB. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 26 matching lines...) Expand all
37 #include "UUID.h" 37 #include "UUID.h"
38 38
39 namespace WebCore { 39 namespace WebCore {
40 40
41 class MediaStreamDescriptor; 41 class MediaStreamDescriptor;
42 42
43 class MediaStreamComponent : public RefCounted<MediaStreamComponent> { 43 class MediaStreamComponent : public RefCounted<MediaStreamComponent> {
44 public: 44 public:
45 static PassRefPtr<MediaStreamComponent> create(PassRefPtr<MediaStreamSource> source) 45 static PassRefPtr<MediaStreamComponent> create(PassRefPtr<MediaStreamSource> source)
46 { 46 {
47 return adoptRef(new MediaStreamComponent(0, source)); 47 return adoptRef(new MediaStreamComponent(createCanonicalUUIDString(), 0, source));
48 }
49
50 static PassRefPtr<MediaStreamComponent> create(const String& id, PassRefPtr< MediaStreamSource> source)
51 {
52 return adoptRef(new MediaStreamComponent(id, 0, source));
48 } 53 }
49 54
50 static PassRefPtr<MediaStreamComponent> create(MediaStreamDescriptor* stream , PassRefPtr<MediaStreamSource> source) 55 static PassRefPtr<MediaStreamComponent> create(MediaStreamDescriptor* stream , PassRefPtr<MediaStreamSource> source)
51 { 56 {
52 return adoptRef(new MediaStreamComponent(stream, source)); 57 return adoptRef(new MediaStreamComponent(createCanonicalUUIDString(), st ream, source));
53 } 58 }
54 59
55 MediaStreamDescriptor* stream() const { return m_stream; } 60 MediaStreamDescriptor* stream() const { return m_stream; }
56 void setStream(MediaStreamDescriptor* stream) { ASSERT(!m_stream && stream); m_stream = stream; } 61 void setStream(MediaStreamDescriptor* stream) { ASSERT(!m_stream && stream); m_stream = stream; }
57 62
58 MediaStreamSource* source() const { return m_source.get(); } 63 MediaStreamSource* source() const { return m_source.get(); }
59 64
60 String id() const { return m_id; } 65 String id() const { return m_id; }
61 bool enabled() const { return m_enabled; } 66 bool enabled() const { return m_enabled; }
62 void setEnabled(bool enabled) { m_enabled = enabled; } 67 void setEnabled(bool enabled) { m_enabled = enabled; }
63 68
64 private: 69 private:
65 MediaStreamComponent(MediaStreamDescriptor* stream, PassRefPtr<MediaStreamSo urce> source) 70 MediaStreamComponent(const String& id, MediaStreamDescriptor* stream, PassRe fPtr<MediaStreamSource> source)
66 : m_stream(stream) 71 : m_stream(stream)
67 , m_source(source) 72 , m_source(source)
68 , m_id(createCanonicalUUIDString()) 73 , m_id(id)
69 , m_enabled(true) 74 , m_enabled(true)
70 { 75 {
76 ASSERT(m_id.length());
71 } 77 }
72 78
73 MediaStreamDescriptor* m_stream; 79 MediaStreamDescriptor* m_stream;
74 RefPtr<MediaStreamSource> m_source; 80 RefPtr<MediaStreamSource> m_source;
75 String m_id; 81 String m_id;
76 bool m_enabled; 82 bool m_enabled;
77 }; 83 };
78 84
85 typedef Vector<RefPtr<MediaStreamComponent> > MediaStreamComponentVector;
86
79 } // namespace WebCore 87 } // namespace WebCore
80 88
81 #endif // ENABLE(MEDIA_STREAM) 89 #endif // ENABLE(MEDIA_STREAM)
82 90
83 #endif // MediaStreamComponent_h 91 #endif // MediaStreamComponent_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698