Index: media/filters/skcanvas_video_renderer.cc |
diff --git a/media/filters/skcanvas_video_renderer.cc b/media/filters/skcanvas_video_renderer.cc |
index 062e317b71da03476438e156bb2f5d2cedc47b00..fe1bfde044ec91a71ac05b5b88b210189d8483e2 100644 |
--- a/media/filters/skcanvas_video_renderer.cc |
+++ b/media/filters/skcanvas_video_renderer.cc |
@@ -9,6 +9,7 @@ |
#include "media/base/yuv_convert.h" |
#include "third_party/libyuv/include/libyuv.h" |
#include "third_party/skia/include/core/SkCanvas.h" |
+#include "ui/gfx/skbitmap_operations.h" |
// Skia internal format depends on a platform. On Android it is ABGR, on others |
// it is ARGB. |
@@ -188,7 +189,8 @@ SkCanvasVideoRenderer::~SkCanvasVideoRenderer() {} |
void SkCanvasVideoRenderer::Paint(media::VideoFrame* video_frame, |
SkCanvas* canvas, |
const gfx::RectF& dest_rect, |
- uint8 alpha) { |
+ uint8 alpha, |
+ VideoRotation video_rotation) { |
if (alpha == 0) { |
return; |
} |
@@ -210,6 +212,24 @@ void SkCanvasVideoRenderer::Paint(media::VideoFrame* video_frame, |
if (last_frame_.isNull() || |
video_frame->timestamp() != last_frame_timestamp_) { |
ConvertVideoFrameToBitmap(video_frame, &last_frame_); |
+ |
+ switch (video_rotation) { |
+ case VIDEO_ROTATION_0: |
+ break; |
+ case VIDEO_ROTATION_90: |
+ last_frame_ = SkBitmapOperations::Rotate( |
+ last_frame_, SkBitmapOperations::ROTATION_90_CW); |
+ break; |
+ case VIDEO_ROTATION_180: |
+ last_frame_ = SkBitmapOperations::Rotate( |
+ last_frame_, SkBitmapOperations::ROTATION_180_CW); |
+ break; |
+ case VIDEO_ROTATION_270: |
+ last_frame_ = SkBitmapOperations::Rotate( |
+ last_frame_, SkBitmapOperations::ROTATION_270_CW); |
+ break; |
+ } |
+ |
last_frame_timestamp_ = video_frame->timestamp(); |
} |