OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 int num_rendered_frames() const { | 38 int num_rendered_frames() const { |
39 return fake_renderer_.num_rendered_frames(); | 39 return fake_renderer_.num_rendered_frames(); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 cricket::FakeVideoRenderer fake_renderer_; | 43 cricket::FakeVideoRenderer fake_renderer_; |
44 rtc::scoped_refptr<VideoTrackInterface> video_track_; | 44 rtc::scoped_refptr<VideoTrackInterface> video_track_; |
45 }; | 45 }; |
46 | 46 |
47 // Similar class, testing the deprecated AddRenderer/RemoveRenderer methods. | |
48 class FakeVideoTrackRendererOld : public VideoRendererInterface { | |
49 public: | |
50 FakeVideoTrackRendererOld(VideoTrackInterface* video_track) | |
51 : video_track_(video_track) { | |
52 video_track_->AddRenderer(this); | |
53 } | |
54 ~FakeVideoTrackRendererOld() { video_track_->RemoveRenderer(this); } | |
55 | |
56 virtual void RenderFrame(const cricket::VideoFrame* video_frame) override { | |
57 fake_renderer_.RenderFrame(video_frame); | |
58 } | |
59 | |
60 int errors() const { return fake_renderer_.errors(); } | |
61 int width() const { return fake_renderer_.width(); } | |
62 int height() const { return fake_renderer_.height(); } | |
63 bool black_frame() const { return fake_renderer_.black_frame(); } | |
64 | |
65 int num_rendered_frames() const { | |
66 return fake_renderer_.num_rendered_frames(); | |
67 } | |
68 | |
69 private: | |
70 cricket::FakeVideoRenderer fake_renderer_; | |
71 rtc::scoped_refptr<VideoTrackInterface> video_track_; | |
72 }; | |
73 | |
74 } // namespace webrtc | 47 } // namespace webrtc |
75 | 48 |
76 #endif // WEBRTC_API_TEST_FAKEVIDEOTRACKRENDERER_H_ | 49 #endif // WEBRTC_API_TEST_FAKEVIDEOTRACKRENDERER_H_ |
OLD | NEW |