OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 Google Inc. 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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef MediaStreamCenter_h | 31 #ifndef MediaStreamCenter_h |
32 #define MediaStreamCenter_h | 32 #define MediaStreamCenter_h |
33 | 33 |
34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
36 #include "public/platform/WebMediaStreamCenterClient.h" | 36 #include "public/platform/WebMediaStreamCenterClient.h" |
37 #include "wtf/Allocator.h" | 37 #include "wtf/Allocator.h" |
| 38 #include "wtf/OwnPtr.h" |
38 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
40 #include <memory> | |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class AudioSourceProvider; | 44 class AudioSourceProvider; |
45 class MediaStreamComponent; | 45 class MediaStreamComponent; |
46 class MediaStreamDescriptor; | 46 class MediaStreamDescriptor; |
47 class WebMediaStream; | 47 class WebMediaStream; |
48 class WebMediaStreamCenter; | 48 class WebMediaStreamCenter; |
49 class WebMediaStreamTrack; | 49 class WebMediaStreamTrack; |
50 | 50 |
51 class PLATFORM_EXPORT MediaStreamCenter final : public WebMediaStreamCenterClien
t { | 51 class PLATFORM_EXPORT MediaStreamCenter final : public WebMediaStreamCenterClien
t { |
52 USING_FAST_MALLOC(MediaStreamCenter); | 52 USING_FAST_MALLOC(MediaStreamCenter); |
53 WTF_MAKE_NONCOPYABLE(MediaStreamCenter); | 53 WTF_MAKE_NONCOPYABLE(MediaStreamCenter); |
54 public: | 54 public: |
55 ~MediaStreamCenter() override; | 55 ~MediaStreamCenter() override; |
56 | 56 |
57 static MediaStreamCenter& instance(); | 57 static MediaStreamCenter& instance(); |
58 | 58 |
59 void didCreateMediaStreamTrack(MediaStreamComponent*); | 59 void didCreateMediaStreamTrack(MediaStreamComponent*); |
60 void didSetMediaStreamTrackEnabled(MediaStreamComponent*); | 60 void didSetMediaStreamTrackEnabled(MediaStreamComponent*); |
61 bool didStopMediaStreamTrack(MediaStreamComponent*); | 61 bool didStopMediaStreamTrack(MediaStreamComponent*); |
62 std::unique_ptr<AudioSourceProvider> createWebAudioSourceFromMediaStreamTrac
k(MediaStreamComponent*); | 62 PassOwnPtr<AudioSourceProvider> createWebAudioSourceFromMediaStreamTrack(Med
iaStreamComponent*); |
63 | 63 |
64 void didCreateMediaStream(MediaStreamDescriptor*); | 64 void didCreateMediaStream(MediaStreamDescriptor*); |
65 void didCreateMediaStreamAndTracks(MediaStreamDescriptor*); | 65 void didCreateMediaStreamAndTracks(MediaStreamDescriptor*); |
66 bool didAddMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*); | 66 bool didAddMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*); |
67 bool didRemoveMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*
); | 67 bool didRemoveMediaStreamTrack(MediaStreamDescriptor*, MediaStreamComponent*
); |
68 void didStopLocalMediaStream(MediaStreamDescriptor*); | 68 void didStopLocalMediaStream(MediaStreamDescriptor*); |
69 | 69 |
70 // blink::WebMediaStreamCenterClient | 70 // blink::WebMediaStreamCenterClient |
71 void stopLocalMediaStream(const WebMediaStream&) override; | 71 void stopLocalMediaStream(const WebMediaStream&) override; |
72 | 72 |
73 private: | 73 private: |
74 MediaStreamCenter(); | 74 MediaStreamCenter(); |
75 | 75 |
76 std::unique_ptr<WebMediaStreamCenter> m_private; | 76 OwnPtr<WebMediaStreamCenter> m_private; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
80 | 80 |
81 #endif // MediaStreamCenter_h | 81 #endif // MediaStreamCenter_h |
OLD | NEW |