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

Unified Diff: webrtc/media/devices/gtkvideorenderer.cc

Issue 2285693002: New static I420Buffer::Rotate method, to replace GetCopyWithRotationApplied. (Closed)
Patch Set: 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/gtkvideorenderer.cc
diff --git a/webrtc/media/devices/gtkvideorenderer.cc b/webrtc/media/devices/gtkvideorenderer.cc
index d7a4d6fb6c33444570a452170d4068d2602f5841..e126e03b35a51df86e81c812addc042a6d93075a 100644
--- a/webrtc/media/devices/gtkvideorenderer.cc
+++ b/webrtc/media/devices/gtkvideorenderer.cc
@@ -17,7 +17,7 @@
#include <gtk/gtk.h>
#include "webrtc/media/base/videocommon.h"
-#include "webrtc/media/base/videoframe.h"
+#include "webrtc/media/engine/webrtcvideoframe.h"
namespace cricket {
@@ -81,19 +81,23 @@ bool GtkVideoRenderer::SetSize(int width, int height) {
}
void GtkVideoRenderer::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());
// Need to set size as the frame might be rotated.
- if (!SetSize(frame->width(), frame->height())) {
+ if (!SetSize(frame.width(), frame.height())) {
return;
}
// convert I420 frame to ABGR format, which is accepted by GTK
- 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);
ScopedGdkLock lock;
@@ -106,11 +110,11 @@ void GtkVideoRenderer::OnFrame(const VideoFrame& video_frame) {
draw_area_->style->fg_gc[GTK_STATE_NORMAL],
0,
0,
- frame->width(),
- frame->height(),
+ frame.width(),
+ frame.height(),
GDK_RGB_DITHER_MAX,
image_.get(),
- frame->width() * 4);
+ frame.width() * 4);
// Run the Gtk main loop to refresh the window.
Pump();

Powered by Google App Engine
This is Rietveld 408576698