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

Side by Side Diff: talk/app/webrtc/test/fakevideotrackrenderer.h

Issue 1574963002: Deleted renderer-related SetSize methods, and all uses. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase 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
« no previous file with comments | « talk/app/webrtc/java/jni/peerconnection_jni.cc ('k') | talk/app/webrtc/videosource_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 27 matching lines...) Expand all
38 FakeVideoTrackRenderer(VideoTrackInterface* video_track) 38 FakeVideoTrackRenderer(VideoTrackInterface* video_track)
39 : video_track_(video_track), last_frame_(NULL) { 39 : video_track_(video_track), last_frame_(NULL) {
40 video_track_->AddRenderer(this); 40 video_track_->AddRenderer(this);
41 } 41 }
42 ~FakeVideoTrackRenderer() { 42 ~FakeVideoTrackRenderer() {
43 video_track_->RemoveRenderer(this); 43 video_track_->RemoveRenderer(this);
44 } 44 }
45 45
46 virtual void RenderFrame(const cricket::VideoFrame* video_frame) override { 46 virtual void RenderFrame(const cricket::VideoFrame* video_frame) override {
47 last_frame_ = const_cast<cricket::VideoFrame*>(video_frame); 47 last_frame_ = const_cast<cricket::VideoFrame*>(video_frame);
48 if (!fake_renderer_.SetSize(static_cast<int>(video_frame->GetWidth()),
49 static_cast<int>(video_frame->GetHeight()),
50 0)) {
51 return;
52 }
53
54 fake_renderer_.RenderFrame(video_frame); 48 fake_renderer_.RenderFrame(video_frame);
55 } 49 }
56 50
57 int errors() const { return fake_renderer_.errors(); } 51 int errors() const { return fake_renderer_.errors(); }
58 int width() const { return fake_renderer_.width(); } 52 int width() const { return fake_renderer_.width(); }
59 int height() const { return fake_renderer_.height(); } 53 int height() const { return fake_renderer_.height(); }
60 int num_rendered_frames() const { 54 int num_rendered_frames() const {
61 return fake_renderer_.num_rendered_frames(); 55 return fake_renderer_.num_rendered_frames();
62 } 56 }
63 const cricket::VideoFrame* last_frame() const { return last_frame_; } 57 const cricket::VideoFrame* last_frame() const { return last_frame_; }
64 58
65 private: 59 private:
66 cricket::FakeVideoRenderer fake_renderer_; 60 cricket::FakeVideoRenderer fake_renderer_;
67 rtc::scoped_refptr<VideoTrackInterface> video_track_; 61 rtc::scoped_refptr<VideoTrackInterface> video_track_;
68 62
69 // Weak reference for frame pointer comparison only. 63 // Weak reference for frame pointer comparison only.
70 cricket::VideoFrame* last_frame_; 64 cricket::VideoFrame* last_frame_;
71 }; 65 };
72 66
73 } // namespace webrtc 67 } // namespace webrtc
74 68
75 #endif // TALK_APP_WEBRTC_TEST_FAKEVIDEOTRACKRENDERER_H_ 69 #endif // TALK_APP_WEBRTC_TEST_FAKEVIDEOTRACKRENDERER_H_
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/jni/peerconnection_jni.cc ('k') | talk/app/webrtc/videosource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698