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

Unified Diff: webrtc/media/devices/carbonvideorenderer.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, 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/media/devices/carbonvideorenderer.cc
diff --git a/webrtc/media/devices/carbonvideorenderer.cc b/webrtc/media/devices/carbonvideorenderer.cc
index a1ff6306201c6b7435837450e332d17dac95468f..428060bd0811bfe5e07d3baeac4df01051000638 100644
--- a/webrtc/media/devices/carbonvideorenderer.cc
+++ b/webrtc/media/devices/carbonvideorenderer.cc
@@ -106,19 +106,23 @@ bool CarbonVideoRenderer::SetSize(int width, int height) {
void CarbonVideoRenderer::OnFrame(const VideoFrame& video_frame) {
{
- const VideoFrame* frame = video_frame->GetCopyWithRotationApplied();
+ const cricket::WebRtcVideoFrame frame(
+ webrtc::VideoFrameBuffer::Rotate(video_frame.video_frame_buffer(),
+ video_frame.rotation()),
+ webrtc::kVideoRotation_0,
+ video_frame.timestamp_us());
- if (!SetSize(frame->width(), frame->height())) {
+ if (!SetSize(frame.width(), frame.height())) {
return false;
}
// Grab the image lock so we are not trashing up the image being drawn.
rtc::CritScope cs(&image_crit_);
- frame->ConvertToRgbBuffer(cricket::FOURCC_ABGR,
- image_.get(),
- static_cast<size_t>(frame->width()) *
- frame->height() * 4,
- frame->width() * 4);
+ frame.ConvertToRgbBuffer(cricket::FOURCC_ABGR,
+ image_.get(),
+ static_cast<size_t>(frame.width()) *
+ frame.height() * 4,
+ frame.width() * 4);
}
// Trigger a repaint event for the whole window.

Powered by Google App Engine
This is Rietveld 408576698