OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 #ifndef MediaStreamComponent_h | 32 #ifndef MediaStreamComponent_h |
33 #define MediaStreamComponent_h | 33 #define MediaStreamComponent_h |
34 | 34 |
35 #include "platform/audio/AudioSourceProvider.h" | 35 #include "platform/audio/AudioSourceProvider.h" |
36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
37 #include "public/platform/WebMediaStreamTrack.h" | 37 #include "public/platform/WebMediaStreamTrack.h" |
38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
39 #include "wtf/ThreadingPrimitives.h" | 39 #include "wtf/ThreadingPrimitives.h" |
40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 #include <memory> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
44 class MediaStreamSource; | 45 class MediaStreamSource; |
45 class WebAudioSourceProvider; | 46 class WebAudioSourceProvider; |
46 | 47 |
47 // A MediaStreamComponent is a MediaStreamTrack. | 48 // A MediaStreamComponent is a MediaStreamTrack. |
48 // TODO(hta): Consider merging the two classes. | 49 // TODO(hta): Consider merging the two classes. |
49 | 50 |
50 class PLATFORM_EXPORT MediaStreamComponent final : public GarbageCollectedFinali
zed<MediaStreamComponent> { | 51 class PLATFORM_EXPORT MediaStreamComponent final : public GarbageCollectedFinali
zed<MediaStreamComponent> { |
(...skipping 20 matching lines...) Expand all Loading... |
71 | 72 |
72 String id() const { return m_id; } | 73 String id() const { return m_id; } |
73 bool enabled() const { return m_enabled; } | 74 bool enabled() const { return m_enabled; } |
74 void setEnabled(bool enabled) { m_enabled = enabled; } | 75 void setEnabled(bool enabled) { m_enabled = enabled; } |
75 bool muted() const { return m_muted; } | 76 bool muted() const { return m_muted; } |
76 void setMuted(bool muted) { m_muted = muted; } | 77 void setMuted(bool muted) { m_muted = muted; } |
77 AudioSourceProvider* getAudioSourceProvider() { return &m_sourceProvider; } | 78 AudioSourceProvider* getAudioSourceProvider() { return &m_sourceProvider; } |
78 void setSourceProvider(WebAudioSourceProvider* provider) { m_sourceProvider.
wrap(provider); } | 79 void setSourceProvider(WebAudioSourceProvider* provider) { m_sourceProvider.
wrap(provider); } |
79 | 80 |
80 TrackData* getTrackData() const { return m_trackData.get(); } | 81 TrackData* getTrackData() const { return m_trackData.get(); } |
81 void setTrackData(PassOwnPtr<TrackData> trackData) { m_trackData = std::move
(trackData); } | 82 void setTrackData(std::unique_ptr<TrackData> trackData) { m_trackData = std:
:move(trackData); } |
82 void getSettings(WebMediaStreamTrack::Settings&); | 83 void getSettings(WebMediaStreamTrack::Settings&); |
83 | 84 |
84 DECLARE_TRACE(); | 85 DECLARE_TRACE(); |
85 | 86 |
86 private: | 87 private: |
87 MediaStreamComponent(const String& id, MediaStreamSource*); | 88 MediaStreamComponent(const String& id, MediaStreamSource*); |
88 | 89 |
89 // AudioSourceProviderImpl wraps a WebAudioSourceProvider::provideInput() | 90 // AudioSourceProviderImpl wraps a WebAudioSourceProvider::provideInput() |
90 // calls into chromium to get a rendered audio stream. | 91 // calls into chromium to get a rendered audio stream. |
91 | 92 |
(...skipping 15 matching lines...) Expand all Loading... |
107 private: | 108 private: |
108 WebAudioSourceProvider* m_webAudioSourceProvider; | 109 WebAudioSourceProvider* m_webAudioSourceProvider; |
109 Mutex m_provideInputLock; | 110 Mutex m_provideInputLock; |
110 }; | 111 }; |
111 | 112 |
112 AudioSourceProviderImpl m_sourceProvider; | 113 AudioSourceProviderImpl m_sourceProvider; |
113 Member<MediaStreamSource> m_source; | 114 Member<MediaStreamSource> m_source; |
114 String m_id; | 115 String m_id; |
115 bool m_enabled; | 116 bool m_enabled; |
116 bool m_muted; | 117 bool m_muted; |
117 OwnPtr<TrackData> m_trackData; | 118 std::unique_ptr<TrackData> m_trackData; |
118 }; | 119 }; |
119 | 120 |
120 typedef HeapVector<Member<MediaStreamComponent>> MediaStreamComponentVector; | 121 typedef HeapVector<Member<MediaStreamComponent>> MediaStreamComponentVector; |
121 | 122 |
122 } // namespace blink | 123 } // namespace blink |
123 | 124 |
124 #endif // MediaStreamComponent_h | 125 #endif // MediaStreamComponent_h |
OLD | NEW |