2013-07-10 14:07:56 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
2015-12-09 12:13:30 +01:00
|
|
|
#ifndef WEBRTC_TEST_WIN_D3D_RENDERER_H_
|
|
|
|
|
#define WEBRTC_TEST_WIN_D3D_RENDERER_H_
|
2013-07-10 14:07:56 +00:00
|
|
|
|
|
|
|
|
#include <Windows.h>
|
|
|
|
|
#include <d3d9.h>
|
2014-09-18 08:58:15 +00:00
|
|
|
#pragma comment(lib, "d3d9.lib") // located in DirectX SDK
|
2013-07-10 14:07:56 +00:00
|
|
|
|
2015-06-04 15:18:17 +02:00
|
|
|
#include "webrtc/base/scoped_ref_ptr.h"
|
2013-10-28 16:32:01 +00:00
|
|
|
#include "webrtc/test/video_renderer.h"
|
2013-07-10 14:07:56 +00:00
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
class D3dRenderer : public VideoRenderer {
|
|
|
|
|
public:
|
|
|
|
|
static D3dRenderer* Create(const char* window_title, size_t width,
|
|
|
|
|
size_t height);
|
|
|
|
|
virtual ~D3dRenderer();
|
|
|
|
|
|
2016-03-21 01:27:56 -07:00
|
|
|
void OnFrame(const webrtc::VideoFrame& frame) override;
|
2015-02-09 15:14:36 +00:00
|
|
|
|
2013-07-10 14:07:56 +00:00
|
|
|
private:
|
|
|
|
|
D3dRenderer(size_t width, size_t height);
|
|
|
|
|
|
|
|
|
|
static LRESULT WINAPI WindowProc(HWND hwnd, UINT msg, WPARAM wparam,
|
|
|
|
|
LPARAM lparam);
|
|
|
|
|
bool Init(const char* window_title);
|
|
|
|
|
void Resize(size_t width, size_t height);
|
|
|
|
|
void Destroy();
|
|
|
|
|
|
|
|
|
|
size_t width_, height_;
|
|
|
|
|
|
|
|
|
|
HWND hwnd_;
|
2015-06-04 15:18:17 +02:00
|
|
|
rtc::scoped_refptr<IDirect3D9> d3d_;
|
|
|
|
|
rtc::scoped_refptr<IDirect3DDevice9> d3d_device_;
|
2013-07-10 14:07:56 +00:00
|
|
|
|
2015-06-04 15:18:17 +02:00
|
|
|
rtc::scoped_refptr<IDirect3DTexture9> texture_;
|
|
|
|
|
rtc::scoped_refptr<IDirect3DVertexBuffer9> vertex_buffer_;
|
2013-07-10 14:07:56 +00:00
|
|
|
};
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2015-12-09 12:13:30 +01:00
|
|
|
#endif // WEBRTC_TEST_WIN_D3D_RENDERER_H_
|