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

Side by Side Diff: webrtc/media/devices/gdivideorenderer.cc

Issue 1838353004: cricket::VideoFrame cleanup. New width() and height(). Deleted GetChroma* methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use objc dot syntax. Delete chromaSize property. Created 4 years, 8 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
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
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return true; 130 return true;
131 } 131 }
132 132
133 void GdiVideoRenderer::VideoWindow::OnFrame(const VideoFrame& video_frame) { 133 void GdiVideoRenderer::VideoWindow::OnFrame(const VideoFrame& video_frame) {
134 if (!handle()) { 134 if (!handle()) {
135 return; 135 return;
136 } 136 }
137 137
138 const VideoFrame* frame = video_frame.GetCopyWithRotationApplied(); 138 const VideoFrame* frame = video_frame.GetCopyWithRotationApplied();
139 139
140 if (SetSize(static_cast<int>(frame->GetWidth()), 140 if (SetSize(frame->width(), frame->height())) {
141 static_cast<int>(frame->GetHeight()))) {
142 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(frame), 0); 141 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(frame), 0);
143 } 142 }
144 } 143 }
145 144
146 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam, 145 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam,
147 LPARAM lParam, LRESULT& result) { 146 LPARAM lParam, LRESULT& result) {
148 switch (uMsg) { 147 switch (uMsg) {
149 case WM_PAINT: 148 case WM_PAINT:
150 OnPaint(); 149 OnPaint();
151 return true; 150 return true;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ///////////////////////////////////////////////////////////////////////////// 237 /////////////////////////////////////////////////////////////////////////////
239 GdiVideoRenderer::GdiVideoRenderer(int x, int y) 238 GdiVideoRenderer::GdiVideoRenderer(int x, int y)
240 : initial_x_(x), 239 : initial_x_(x),
241 initial_y_(y) { 240 initial_y_(y) {
242 } 241 }
243 GdiVideoRenderer::~GdiVideoRenderer() {} 242 GdiVideoRenderer::~GdiVideoRenderer() {}
244 243
245 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) { 244 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) {
246 if (!window_.get()) { // Create the window for the first frame 245 if (!window_.get()) { // Create the window for the first frame
247 window_.reset(new VideoWindow(initial_x_, initial_y_, 246 window_.reset(new VideoWindow(initial_x_, initial_y_,
248 static_cast<int>(frame.GetWidth()), 247 frame.width(), frame.height()));
pbos-webrtc 2016/03/31 14:49:09 git cl format I think?
249 static_cast<int>(frame.GetHeight())));
250 } 248 }
251 window_->OnFrame(frame); 249 window_->OnFrame(frame);
252 } 250 }
253 251
254 } // namespace cricket 252 } // namespace cricket
255 #endif // WIN32 253 #endif // WIN32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698