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

Unified Diff: webrtc/examples/peerconnection/client/linux/main_wnd.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/examples/peerconnection/client/linux/main_wnd.cc
diff --git a/webrtc/examples/peerconnection/client/linux/main_wnd.cc b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
index e2ed0085e08fa220380606e09e83ea7b96db3ff4..3a9f165a0190ddcb909c5a61c443a6a341cdd754 100644
--- a/webrtc/examples/peerconnection/client/linux/main_wnd.cc
+++ b/webrtc/examples/peerconnection/client/linux/main_wnd.cc
@@ -18,6 +18,7 @@
#include "webrtc/base/common.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/stringutils.h"
+#include "webrtc/media/engine/webrtcvideoframe.h"
using rtc::sprintfn;
@@ -484,16 +485,20 @@ void GtkMainWnd::VideoRenderer::OnFrame(
const cricket::VideoFrame& video_frame) {
gdk_threads_enter();
- const cricket::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());
- SetSize(frame->width(), frame->height());
+ SetSize(frame.width(), frame.height());
int size = width_ * height_ * 4;
// TODO(henrike): Convert directly to RGBA
- frame->ConvertToRgbBuffer(cricket::FOURCC_ARGB,
- image_.get(),
- size,
- width_ * 4);
+ frame.ConvertToRgbBuffer(cricket::FOURCC_ARGB,
+ image_.get(),
+ size,
+ width_ * 4);
// Convert the B,G,R,A frame to R,G,B,A, which is accepted by GTK.
// The 'A' is just padding for GTK, so we can use it as temp.
uint8_t* pix = image_.get();

Powered by Google App Engine
This is Rietveld 408576698