OLD | NEW |
| (Empty) |
1 /* | |
2 * libjingle | |
3 * Copyright 2004 Google Inc. | |
4 * | |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions are met: | |
7 * | |
8 * 1. Redistributions of source code must retain the above copyright notice, | |
9 * this list of conditions and the following disclaimer. | |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
11 * this list of conditions and the following disclaimer in the documentation | |
12 * and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 #ifndef TALK_MEDIA_WEBRTCPASSTHROUGHRENDER_H_ | |
29 #define TALK_MEDIA_WEBRTCPASSTHROUGHRENDER_H_ | |
30 | |
31 #include <map> | |
32 | |
33 #include "webrtc/base/criticalsection.h" | |
34 #include "webrtc/modules/video_render/include/video_render.h" | |
35 | |
36 namespace cricket { | |
37 class PassthroughStream; | |
38 | |
39 class WebRtcPassthroughRender : public webrtc::VideoRender { | |
40 public: | |
41 WebRtcPassthroughRender(); | |
42 virtual ~WebRtcPassthroughRender(); | |
43 | |
44 int64_t TimeUntilNextProcess() override { return 0; } | |
45 | |
46 int32_t Process() override { return 0; } | |
47 | |
48 void* Window() override { | |
49 rtc::CritScope cs(&render_critical_); | |
50 return window_; | |
51 } | |
52 | |
53 int32_t ChangeWindow(void* window) override { | |
54 rtc::CritScope cs(&render_critical_); | |
55 window_ = window; | |
56 return 0; | |
57 } | |
58 | |
59 webrtc::VideoRenderCallback* AddIncomingRenderStream( | |
60 const uint32_t stream_id, | |
61 const uint32_t zOrder, | |
62 const float left, | |
63 const float top, | |
64 const float right, | |
65 const float bottom) override; | |
66 | |
67 int32_t DeleteIncomingRenderStream(const uint32_t stream_id) override; | |
68 | |
69 int32_t AddExternalRenderCallback( | |
70 const uint32_t stream_id, | |
71 webrtc::VideoRenderCallback* render_object) override; | |
72 | |
73 int32_t GetIncomingRenderStreamProperties(const uint32_t stream_id, | |
74 uint32_t& zOrder, | |
75 float& left, | |
76 float& top, | |
77 float& right, | |
78 float& bottom) const override { | |
79 return -1; | |
80 } | |
81 | |
82 uint32_t GetIncomingFrameRate(const uint32_t stream_id) override { return 0; } | |
83 | |
84 uint32_t GetNumIncomingRenderStreams() const override { | |
85 return static_cast<uint32_t>(stream_render_map_.size()); | |
86 } | |
87 | |
88 bool HasIncomingRenderStream(const uint32_t stream_id) const override; | |
89 | |
90 int32_t RegisterRawFrameCallback( | |
91 const uint32_t stream_id, | |
92 webrtc::VideoRenderCallback* callback_obj) override { | |
93 return -1; | |
94 } | |
95 | |
96 int32_t StartRender(const uint32_t stream_id) override; | |
97 | |
98 int32_t StopRender(const uint32_t stream_id) override; | |
99 | |
100 int32_t ResetRender() override { return 0; } | |
101 | |
102 webrtc::RawVideoType PreferredVideoType() const override; | |
103 | |
104 bool IsFullScreen() override { return false; } | |
105 | |
106 int32_t GetScreenResolution(uint32_t& screenWidth, | |
107 uint32_t& screenHeight) const override { | |
108 return -1; | |
109 } | |
110 | |
111 uint32_t RenderFrameRate(const uint32_t stream_id) override { return 0; } | |
112 | |
113 int32_t SetStreamCropping(const uint32_t stream_id, | |
114 const float left, | |
115 const float top, | |
116 const float right, | |
117 const float bottom) override { | |
118 return -1; | |
119 } | |
120 | |
121 int32_t SetExpectedRenderDelay(uint32_t stream_id, | |
122 int32_t delay_ms) override { | |
123 return -1; | |
124 } | |
125 | |
126 int32_t ConfigureRenderer(const uint32_t stream_id, | |
127 const unsigned int zOrder, | |
128 const float left, | |
129 const float top, | |
130 const float right, | |
131 const float bottom) override { | |
132 return -1; | |
133 } | |
134 | |
135 int32_t SetTransparentBackground(const bool enable) override { return -1; } | |
136 | |
137 int32_t FullScreenRender(void* window, const bool enable) override { | |
138 return -1; | |
139 } | |
140 | |
141 int32_t SetBitmap(const void* bitMap, | |
142 const uint8_t pictureId, | |
143 const void* colorKey, | |
144 const float left, | |
145 const float top, | |
146 const float right, | |
147 const float bottom) override { | |
148 return -1; | |
149 } | |
150 | |
151 int32_t SetText(const uint8_t textId, | |
152 const uint8_t* text, | |
153 const int32_t textLength, | |
154 const uint32_t textColorRef, | |
155 const uint32_t backgroundColorRef, | |
156 const float left, | |
157 const float top, | |
158 const float right, | |
159 const float bottom) override { | |
160 return -1; | |
161 } | |
162 | |
163 int32_t SetStartImage(const uint32_t stream_id, | |
164 const webrtc::VideoFrame& videoFrame) override { | |
165 return -1; | |
166 } | |
167 | |
168 int32_t SetTimeoutImage(const uint32_t stream_id, | |
169 const webrtc::VideoFrame& videoFrame, | |
170 const uint32_t timeout) override { | |
171 return -1; | |
172 } | |
173 | |
174 private: | |
175 typedef std::map<uint32_t, PassthroughStream*> StreamMap; | |
176 | |
177 PassthroughStream* FindStream(const uint32_t stream_id) const; | |
178 | |
179 void* window_; | |
180 StreamMap stream_render_map_; | |
181 rtc::CriticalSection render_critical_; | |
182 }; | |
183 } // namespace cricket | |
184 | |
185 #endif // TALK_MEDIA_WEBRTCPASSTHROUGHRENDER_H_ | |
OLD | NEW |