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