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

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

Issue 2285693002: New static I420Buffer::Rotate method, to replace GetCopyWithRotationApplied. (Closed)
Patch Set: Address magjed's comments. And add missing include. Created 4 years, 3 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 SendMessage(handle(), kSetSizeMsg, 0, MAKELPARAM(width, height)); 128 SendMessage(handle(), kSetSizeMsg, 0, MAKELPARAM(width, height));
129 } 129 }
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 cricket::WebRtcVideoFrame frame(
139 webrtc::VideoFrameBuffer::Rotate(video_frame.video_frame_buffer(),
140 video_frame.rotation()),
141 webrtc::kVideoRotation_0,
142 video_frame.timestamp_us());
139 143
140 if (SetSize(frame->width(), frame->height())) { 144 if (SetSize(frame.width(), frame.height())) {
141 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(frame), 0); 145 SendMessage(handle(), kRenderFrameMsg, reinterpret_cast<WPARAM>(&frame), 0);
142 } 146 }
143 } 147 }
144 148
145 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam, 149 bool GdiVideoRenderer::VideoWindow::OnMessage(UINT uMsg, WPARAM wParam,
146 LPARAM lParam, LRESULT& result) { 150 LPARAM lParam, LRESULT& result) {
147 switch (uMsg) { 151 switch (uMsg) {
148 case WM_PAINT: 152 case WM_PAINT:
149 OnPaint(); 153 OnPaint();
150 return true; 154 return true;
151 155
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) { 248 void GdiVideoRenderer::OnFrame(const VideoFrame& frame) {
245 if (!window_.get()) { // Create the window for the first frame 249 if (!window_.get()) { // Create the window for the first frame
246 window_.reset( 250 window_.reset(
247 new VideoWindow(initial_x_, initial_y_, frame.width(), frame.height())); 251 new VideoWindow(initial_x_, initial_y_, frame.width(), frame.height()));
248 } 252 }
249 window_->OnFrame(frame); 253 window_->OnFrame(frame);
250 } 254 }
251 255
252 } // namespace cricket 256 } // namespace cricket
253 #endif // WIN32 257 #endif // WIN32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698