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

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

Issue 2517173004: Move VideoFrame and related declarations to webrtc/api/video. (Closed)
Patch Set: Make rotation check clearer. Created 3 years, 11 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
« no previous file with comments | « webrtc/media/base/videosourcebase.h ('k') | webrtc/media/engine/fakewebrtccall.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/devices/gtkvideorenderer.cc
diff --git a/webrtc/media/devices/gtkvideorenderer.cc b/webrtc/media/devices/gtkvideorenderer.cc
index b88c391cafa6f351587abca3113e5af04db6b7bb..f4a141245460f8fd581eae8f8dce0472c007a1cb 100644
--- a/webrtc/media/devices/gtkvideorenderer.cc
+++ b/webrtc/media/devices/gtkvideorenderer.cc
@@ -10,8 +10,9 @@
// Implementation of GtkVideoRenderer
+#include "webrtc/api/video/i420_buffer.h"
+#include "webrtc/api/video/video_frame.h"
#include "webrtc/media/devices/gtkvideorenderer.h"
-#include "webrtc/video_frame.h"
#include <gdk/gdk.h>
#include <glib.h>
@@ -82,8 +83,10 @@ bool GtkVideoRenderer::SetSize(int width, int height) {
void GtkVideoRenderer::OnFrame(const webrtc::VideoFrame& video_frame) {
rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(
- webrtc::I420Buffer::Rotate(video_frame.video_frame_buffer(),
- video_frame.rotation()));
+ video_frame.video_frame_buffer());
+ if (video_frame.rotation() != webrtc::kVideoRotation_0) {
+ buffer = webrtc::I420Buffer::Rotate(*buffer, video_frame.rotation());
+ }
// Need to set size as the frame might be rotated.
if (!SetSize(buffer->width(), buffer->height())) {
« no previous file with comments | « webrtc/media/base/videosourcebase.h ('k') | webrtc/media/engine/fakewebrtccall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698