pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_WIN_D3D_RENDERER_H_ |
| 11 | #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_WIN_D3D_RENDERER_H_ |
| 12 | |
| 13 | #include <Windows.h> |
| 14 | #include <d3d9.h> |
| 15 | |
| 16 | #include "webrtc/system_wrappers/interface/scoped_refptr.h" |
pbos@webrtc.org | 16e03b7 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 17 | #include "webrtc/test/video_renderer.h" |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 18 | #include "webrtc/typedefs.h" |
pbos@webrtc.org | adf23a5 | 2013-07-10 14:07:56 +0000 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | namespace test { |
| 22 | |
| 23 | class D3dRenderer : public VideoRenderer { |
| 24 | public: |
| 25 | static D3dRenderer* Create(const char* window_title, size_t width, |
| 26 | size_t height); |
| 27 | virtual ~D3dRenderer(); |
| 28 | |
| 29 | virtual void RenderFrame(const webrtc::I420VideoFrame& frame, int delta) |
| 30 | OVERRIDE; |
| 31 | private: |
| 32 | D3dRenderer(size_t width, size_t height); |
| 33 | |
| 34 | static LRESULT WINAPI WindowProc(HWND hwnd, UINT msg, WPARAM wparam, |
| 35 | LPARAM lparam); |
| 36 | bool Init(const char* window_title); |
| 37 | void Resize(size_t width, size_t height); |
| 38 | void Destroy(); |
| 39 | |
| 40 | size_t width_, height_; |
| 41 | |
| 42 | HWND hwnd_; |
| 43 | scoped_refptr<IDirect3D9> d3d_; |
| 44 | scoped_refptr<IDirect3DDevice9> d3d_device_; |
| 45 | |
| 46 | scoped_refptr<IDirect3DTexture9> texture_; |
| 47 | scoped_refptr<IDirect3DVertexBuffer9> vertex_buffer_; |
| 48 | }; |
| 49 | } // namespace test |
| 50 | } // namespace webrtc |
| 51 | |
| 52 | #endif // WEBRTC_VIDEO_ENGINE_TEST_COMMON_WIN_D3D_RENDERER_H_ |