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 19 matching lines...) Expand all Loading... |
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 | 38 |
39 namespace blink { | 39 namespace blink { |
| 40 |
40 class MediaStreamSource; | 41 class MediaStreamSource; |
41 } | |
42 | |
43 namespace blink { | |
44 class WebAudioDestinationConsumer; | 42 class WebAudioDestinationConsumer; |
45 class WebMediaConstraints; | 43 class WebMediaConstraints; |
46 class WebString; | 44 class WebString; |
47 | 45 |
48 class WebMediaStreamSource { | 46 class WebMediaStreamSource { |
49 public: | 47 public: |
50 class ExtraData { | 48 class ExtraData { |
51 public: | 49 public: |
52 ExtraData() : m_owner(0) { } | 50 ExtraData() : m_owner(0) { } |
53 virtual ~ExtraData() { } | 51 virtual ~ExtraData() { } |
54 | 52 |
55 BLINK_PLATFORM_EXPORT WebMediaStreamSource owner(); | 53 BLINK_PLATFORM_EXPORT WebMediaStreamSource owner(); |
56 | 54 |
57 #if INSIDE_BLINK | 55 #if INSIDE_BLINK |
58 BLINK_PLATFORM_EXPORT void setOwner(blink::MediaStreamSource*); | 56 BLINK_PLATFORM_EXPORT void setOwner(MediaStreamSource*); |
59 #endif | 57 #endif |
60 | 58 |
61 private: | 59 private: |
62 blink::MediaStreamSource* m_owner; | 60 MediaStreamSource* m_owner; |
63 }; | 61 }; |
64 | 62 |
65 enum Type { | 63 enum Type { |
66 TypeAudio, | 64 TypeAudio, |
67 TypeVideo | 65 TypeVideo |
68 }; | 66 }; |
69 | 67 |
70 enum ReadyState { | 68 enum ReadyState { |
71 ReadyStateLive = 0, | 69 ReadyStateLive = 0, |
72 ReadyStateMuted = 1, | 70 ReadyStateMuted = 1, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 BLINK_PLATFORM_EXPORT WebMediaConstraints constraints(); | 104 BLINK_PLATFORM_EXPORT WebMediaConstraints constraints(); |
107 | 105 |
108 // Only used if if this is a WebAudio source. | 106 // Only used if if this is a WebAudio source. |
109 // The WebAudioDestinationConsumer is not owned, and has to be disposed of s
eparately | 107 // The WebAudioDestinationConsumer is not owned, and has to be disposed of s
eparately |
110 // after calling removeAudioConsumer. | 108 // after calling removeAudioConsumer. |
111 BLINK_PLATFORM_EXPORT bool requiresAudioConsumer() const; | 109 BLINK_PLATFORM_EXPORT bool requiresAudioConsumer() const; |
112 BLINK_PLATFORM_EXPORT void addAudioConsumer(WebAudioDestinationConsumer*); | 110 BLINK_PLATFORM_EXPORT void addAudioConsumer(WebAudioDestinationConsumer*); |
113 BLINK_PLATFORM_EXPORT bool removeAudioConsumer(WebAudioDestinationConsumer*)
; | 111 BLINK_PLATFORM_EXPORT bool removeAudioConsumer(WebAudioDestinationConsumer*)
; |
114 | 112 |
115 #if INSIDE_BLINK | 113 #if INSIDE_BLINK |
116 BLINK_PLATFORM_EXPORT WebMediaStreamSource(const WTF::PassRefPtr<blink::Medi
aStreamSource>&); | 114 BLINK_PLATFORM_EXPORT WebMediaStreamSource(const WTF::PassRefPtr<MediaStream
Source>&); |
117 BLINK_PLATFORM_EXPORT WebMediaStreamSource& operator=(blink::MediaStreamSour
ce*); | 115 BLINK_PLATFORM_EXPORT WebMediaStreamSource& operator=(MediaStreamSource*); |
118 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<blink::MediaStreamSource>() c
onst; | 116 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<MediaStreamSource>() const; |
119 BLINK_PLATFORM_EXPORT operator blink::MediaStreamSource*() const; | 117 BLINK_PLATFORM_EXPORT operator MediaStreamSource*() const; |
120 #endif | 118 #endif |
121 | 119 |
122 private: | 120 private: |
123 WebPrivatePtr<blink::MediaStreamSource> m_private; | 121 WebPrivatePtr<MediaStreamSource> m_private; |
124 }; | 122 }; |
125 | 123 |
126 } // namespace blink | 124 } // namespace blink |
127 | 125 |
128 #endif // WebMediaStreamSource_h | 126 #endif // WebMediaStreamSource_h |
OLD | NEW |