OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 // Implementation of GdiVideoRenderer on Windows | 11 // Implementation of GdiVideoRenderer on Windows |
12 | 12 |
13 #ifdef WIN32 | 13 #ifdef WIN32 |
14 | 14 |
15 #include "webrtc/media/devices/gdivideorenderer.h" | 15 #include "webrtc/media/devices/gdivideorenderer.h" |
16 | 16 |
17 #include "libyuv/convert_argb.h" | 17 #include "libyuv/convert_argb.h" |
18 #include "webrtc/base/thread.h" | 18 #include "webrtc/base/thread.h" |
19 #include "webrtc/base/win32window.h" | 19 #include "webrtc/base/win32window.h" |
20 #include "webrtc/media/engine/webrtcvideoframe.h" | 20 #include "webrtc/video_frame.h" |
perkj_webrtc
2016/10/25 10:53:36
remove
| |
21 | 21 |
22 namespace cricket { | 22 namespace cricket { |
23 | 23 |
24 ///////////////////////////////////////////////////////////////////////////// | 24 ///////////////////////////////////////////////////////////////////////////// |
25 // Definition of private class VideoWindow. We use a worker thread to manage | 25 // Definition of private class VideoWindow. We use a worker thread to manage |
26 // the window. | 26 // the window. |
27 ///////////////////////////////////////////////////////////////////////////// | 27 ///////////////////////////////////////////////////////////////////////////// |
28 class GdiVideoRenderer::VideoWindow : public rtc::Win32Window { | 28 class GdiVideoRenderer::VideoWindow : public rtc::Win32Window { |
29 public: | 29 public: |
30 VideoWindow(int x, int y, int width, int height); | 30 VideoWindow(int x, int y, int width, int height); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 SendMessage(handle(), kSetSizeMsg, 0, MAKELPARAM(width, height)); | 128 SendMessage(handle(), kSetSizeMsg, 0, MAKELPARAM(width, height)); |
129 } | 129 } |
130 return true; | 130 return true; |
131 } | 131 } |
132 | 132 |
133 void GdiVideoRenderer::VideoWindow::OnFrame(const VideoFrame& video_frame) { | 133 void GdiVideoRenderer::VideoWindow::OnFrame(const VideoFrame& video_frame) { |
134 if (!handle()) { | 134 if (!handle()) { |
135 return; | 135 return; |
136 } | 136 } |
137 | 137 |
138 const cricket::WebRtcVideoFrame frame( | 138 const webrtc::VideoFrame frame( |
139 webrtc::I420Buffer::Rotate(video_frame.video_frame_buffer(), | 139 webrtc::I420Buffer::Rotate(video_frame.video_frame_buffer(), |
140 video_frame.rotation()), | 140 video_frame.rotation()), |
141 webrtc::kVideoRotation_0, video_frame.timestamp_us()); | 141 webrtc::kVideoRotation_0, video_frame.timestamp_us()); |
142 | 142 |
143 if (SetSize(frame.width(), frame.height())) { | 143 if (SetSize(frame.width(), frame.height())) { |
144 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(&frame), 0); | 144 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(&frame), 0); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam, | 148 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) { | 251 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) { |
252 if (!window_.get()) { // Create the window for the first frame | 252 if (!window_.get()) { // Create the window for the first frame |
253 window_.reset( | 253 window_.reset( |
254 new VideoWindow(initial_x_, initial_y_, frame.width(), frame.height())); | 254 new VideoWindow(initial_x_, initial_y_, frame.width(), frame.height())); |
255 } | 255 } |
256 window_->OnFrame(frame); | 256 window_->OnFrame(frame); |
257 } | 257 } |
258 | 258 |
259 } // namespace cricket | 259 } // namespace cricket |
260 #endif // WIN32 | 260 #endif // WIN32 |
OLD | NEW |