OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...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 WebMediaStreamSource_h | 31 #ifndef WebMediaStreamSource_h |
32 #define WebMediaStreamSource_h | 32 #define WebMediaStreamSource_h |
33 | 33 |
34 #include "WebCommon.h" | 34 #include "WebCommon.h" |
35 #include "WebNonCopyable.h" | 35 #include "WebNonCopyable.h" |
36 #include "WebPrivatePtr.h" | 36 #include "WebPrivatePtr.h" |
37 #include "WebVector.h" | 37 #include "WebVector.h" |
38 #if INSIDE_BLINK | |
39 #include "platform/heap/Handle.h" | |
40 #endif | |
41 | 38 |
42 namespace blink { | 39 namespace blink { |
43 | 40 |
44 class MediaStreamSource; | 41 class MediaStreamSource; |
45 class WebAudioDestinationConsumer; | 42 class WebAudioDestinationConsumer; |
46 class WebMediaConstraints; | 43 class WebMediaConstraints; |
47 class WebString; | 44 class WebString; |
48 | 45 |
49 class WebMediaStreamSource { | 46 class WebMediaStreamSource { |
50 public: | 47 public: |
51 class ExtraData { | 48 class ExtraData { |
52 public: | 49 public: |
53 ExtraData() : m_owner(0) { } | 50 ExtraData() : m_owner(0) { } |
54 virtual ~ExtraData() { } | 51 virtual ~ExtraData() { } |
55 | 52 |
56 BLINK_PLATFORM_EXPORT WebMediaStreamSource owner(); | 53 BLINK_PLATFORM_EXPORT WebMediaStreamSource owner(); |
57 | 54 |
58 #if INSIDE_BLINK | 55 #if INSIDE_BLINK |
59 BLINK_PLATFORM_EXPORT void setOwner(MediaStreamSource*); | 56 BLINK_PLATFORM_EXPORT void setOwner(MediaStreamSource*); |
60 #endif | 57 #endif |
61 | 58 |
62 private: | 59 private: |
63 #if INSIDE_BLINK | |
64 GC_PLUGIN_IGNORE("http://crbug.com/409526") | |
65 #endif | |
66 MediaStreamSource* m_owner; | 60 MediaStreamSource* m_owner; |
67 }; | 61 }; |
68 | 62 |
69 enum Type { | 63 enum Type { |
70 TypeAudio, | 64 TypeAudio, |
71 TypeVideo | 65 TypeVideo |
72 }; | 66 }; |
73 | 67 |
74 enum ReadyState { | 68 enum ReadyState { |
75 ReadyStateLive = 0, | 69 ReadyStateLive = 0, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 BLINK_PLATFORM_EXPORT WebMediaConstraints constraints(); | 106 BLINK_PLATFORM_EXPORT WebMediaConstraints constraints(); |
113 | 107 |
114 // Only used if if this is a WebAudio source. | 108 // Only used if if this is a WebAudio source. |
115 // The WebAudioDestinationConsumer is not owned, and has to be disposed of s
eparately | 109 // The WebAudioDestinationConsumer is not owned, and has to be disposed of s
eparately |
116 // after calling removeAudioConsumer. | 110 // after calling removeAudioConsumer. |
117 BLINK_PLATFORM_EXPORT bool requiresAudioConsumer() const; | 111 BLINK_PLATFORM_EXPORT bool requiresAudioConsumer() const; |
118 BLINK_PLATFORM_EXPORT void addAudioConsumer(WebAudioDestinationConsumer*); | 112 BLINK_PLATFORM_EXPORT void addAudioConsumer(WebAudioDestinationConsumer*); |
119 BLINK_PLATFORM_EXPORT bool removeAudioConsumer(WebAudioDestinationConsumer*)
; | 113 BLINK_PLATFORM_EXPORT bool removeAudioConsumer(WebAudioDestinationConsumer*)
; |
120 | 114 |
121 #if INSIDE_BLINK | 115 #if INSIDE_BLINK |
122 BLINK_PLATFORM_EXPORT WebMediaStreamSource(MediaStreamSource*); | 116 BLINK_PLATFORM_EXPORT WebMediaStreamSource(const WTF::PassRefPtr<MediaStream
Source>&); |
123 BLINK_PLATFORM_EXPORT WebMediaStreamSource& operator=(MediaStreamSource*); | 117 BLINK_PLATFORM_EXPORT WebMediaStreamSource& operator=(MediaStreamSource*); |
124 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<MediaStreamSource>() const; | 118 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<MediaStreamSource>() const; |
125 BLINK_PLATFORM_EXPORT operator MediaStreamSource*() const; | 119 BLINK_PLATFORM_EXPORT operator MediaStreamSource*() const; |
126 #endif | 120 #endif |
127 | 121 |
128 private: | 122 private: |
129 WebPrivatePtr<MediaStreamSource> m_private; | 123 WebPrivatePtr<MediaStreamSource> m_private; |
130 }; | 124 }; |
131 | 125 |
132 } // namespace blink | 126 } // namespace blink |
133 | 127 |
134 #endif // WebMediaStreamSource_h | 128 #endif // WebMediaStreamSource_h |
OLD | NEW |