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 // | 11 // |
12 // Definition of class GdiVideoRenderer that implements the abstract class | 12 // Definition of class GdiVideoRenderer that implements the abstract class |
13 // cricket::VideoRenderer via GDI on Windows. | 13 // cricket::VideoRenderer via GDI on Windows. |
14 | 14 |
15 #ifndef WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ | 15 #ifndef WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ |
16 #define WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ | 16 #define WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ |
17 #ifdef WIN32 | 17 #ifdef WIN32 |
18 | 18 |
19 #include <memory> | 19 #include <memory> |
20 | 20 |
21 #include "webrtc/media/base/videorenderer.h" | 21 #include "webrtc/media/base/videosinkinterface.h" |
22 | 22 |
23 namespace cricket { | 23 namespace cricket { |
24 | 24 |
25 class GdiVideoRenderer : public VideoRenderer { | 25 class VideoFrame; |
| 26 |
| 27 class GdiVideoRenderer : public rtc::VideoSinkInterface<cricket::VideoFrame> { |
26 public: | 28 public: |
27 GdiVideoRenderer(int x, int y); | 29 GdiVideoRenderer(int x, int y); |
28 virtual ~GdiVideoRenderer(); | 30 virtual ~GdiVideoRenderer(); |
29 | 31 |
30 // Implementation of pure virtual methods of VideoRenderer. | 32 // Implementation of VideoSinkInterface |
31 // These two methods may be executed in different threads. | 33 void OnFrame(const VideoFrame& frame) override; |
32 // SetSize is called before RenderFrame. | |
33 virtual bool SetSize(int width, int height, int reserved); | |
34 virtual bool RenderFrame(const VideoFrame* frame); | |
35 | 34 |
36 private: | 35 private: |
37 class VideoWindow; // forward declaration, defined in the .cc file | 36 class VideoWindow; // forward declaration, defined in the .cc file |
38 std::unique_ptr<VideoWindow> window_; | 37 std::unique_ptr<VideoWindow> window_; |
39 // The initial position of the window. | 38 // The initial position of the window. |
40 int initial_x_; | 39 int initial_x_; |
41 int initial_y_; | 40 int initial_y_; |
42 }; | 41 }; |
43 | 42 |
44 } // namespace cricket | 43 } // namespace cricket |
45 | 44 |
46 #endif // WIN32 | 45 #endif // WIN32 |
47 #endif // WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ | 46 #endif // WEBRTC_MEDIA_DEVICES_GDIVIDEORENDERER_H_ |
OLD | NEW |