Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: webrtc/api/test/fakevideotrackrenderer.h

Issue 1610243002: Move talk/app/webrtc to webrtc/api (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updated location for peerconnection_unittests.isolate Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2012 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
11 #ifndef WEBRTC_API_TEST_FAKEVIDEOTRACKRENDERER_H_
12 #define WEBRTC_API_TEST_FAKEVIDEOTRACKRENDERER_H_
13
14 #include "talk/media/base/fakevideorenderer.h"
15 #include "webrtc/api/mediastreaminterface.h"
16
17 namespace webrtc {
18
19 class FakeVideoTrackRenderer : public VideoRendererInterface {
20 public:
21 FakeVideoTrackRenderer(VideoTrackInterface* video_track)
22 : video_track_(video_track), last_frame_(NULL) {
23 video_track_->AddRenderer(this);
24 }
25 ~FakeVideoTrackRenderer() {
26 video_track_->RemoveRenderer(this);
27 }
28
29 virtual void RenderFrame(const cricket::VideoFrame* video_frame) override {
30 last_frame_ = const_cast<cricket::VideoFrame*>(video_frame);
31 fake_renderer_.RenderFrame(video_frame);
32 }
33
34 int errors() const { return fake_renderer_.errors(); }
35 int width() const { return fake_renderer_.width(); }
36 int height() const { return fake_renderer_.height(); }
37 bool black_frame() const { return fake_renderer_.black_frame(); }
38
39 int num_rendered_frames() const {
40 return fake_renderer_.num_rendered_frames();
41 }
42 const cricket::VideoFrame* last_frame() const { return last_frame_; }
43
44 private:
45 cricket::FakeVideoRenderer fake_renderer_;
46 rtc::scoped_refptr<VideoTrackInterface> video_track_;
47
48 // Weak reference for frame pointer comparison only.
49 cricket::VideoFrame* last_frame_;
50 };
51
52 } // namespace webrtc
53
54 #endif // WEBRTC_API_TEST_FAKEVIDEOTRACKRENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698