| 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 "webrtc/base/scoped_ptr.h" | |
| 18 #include "webrtc/base/thread.h" | 17 #include "webrtc/base/thread.h" |
| 19 #include "webrtc/base/win32window.h" | 18 #include "webrtc/base/win32window.h" |
| 20 #include "webrtc/media/base/videocommon.h" | 19 #include "webrtc/media/base/videocommon.h" |
| 21 #include "webrtc/media/base/videoframe.h" | 20 #include "webrtc/media/base/videoframe.h" |
| 22 | 21 |
| 23 namespace cricket { | 22 namespace cricket { |
| 24 | 23 |
| 25 ///////////////////////////////////////////////////////////////////////////// | 24 ///////////////////////////////////////////////////////////////////////////// |
| 26 // 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 |
| 27 // the window. | 26 // the window. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 VideoWindow* window_; | 75 VideoWindow* window_; |
| 77 }; | 76 }; |
| 78 | 77 |
| 79 // Context: worker Thread. | 78 // Context: worker Thread. |
| 80 bool Initialize(); | 79 bool Initialize(); |
| 81 void OnPaint(); | 80 void OnPaint(); |
| 82 void OnSize(int width, int height, bool frame_changed); | 81 void OnSize(int width, int height, bool frame_changed); |
| 83 void OnRenderFrame(const VideoFrame* frame); | 82 void OnRenderFrame(const VideoFrame* frame); |
| 84 | 83 |
| 85 BITMAPINFO bmi_; | 84 BITMAPINFO bmi_; |
| 86 rtc::scoped_ptr<uint8_t[]> image_; | 85 std::unique_ptr<uint8_t[]> image_; |
| 87 rtc::scoped_ptr<WindowThread> window_thread_; | 86 std::unique_ptr<WindowThread> window_thread_; |
| 88 // The initial position of the window. | 87 // The initial position of the window. |
| 89 int initial_x_; | 88 int initial_x_; |
| 90 int initial_y_; | 89 int initial_y_; |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 ///////////////////////////////////////////////////////////////////////////// | 92 ///////////////////////////////////////////////////////////////////////////// |
| 94 // Implementation of class VideoWindow | 93 // Implementation of class VideoWindow |
| 95 ///////////////////////////////////////////////////////////////////////////// | 94 ///////////////////////////////////////////////////////////////////////////// |
| 96 GdiVideoRenderer::VideoWindow::VideoWindow( | 95 GdiVideoRenderer::VideoWindow::VideoWindow( |
| 97 int x, int y, int width, int height) | 96 int x, int y, int width, int height) |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 252 |
| 254 bool GdiVideoRenderer::RenderFrame(const VideoFrame* frame) { | 253 bool GdiVideoRenderer::RenderFrame(const VideoFrame* frame) { |
| 255 if (!frame || !window_.get()) { | 254 if (!frame || !window_.get()) { |
| 256 return false; | 255 return false; |
| 257 } | 256 } |
| 258 return window_->RenderFrame(frame); | 257 return window_->RenderFrame(frame); |
| 259 } | 258 } |
| 260 | 259 |
| 261 } // namespace cricket | 260 } // namespace cricket |
| 262 #endif // WIN32 | 261 #endif // WIN32 |
| OLD | NEW |