Index: media/cast/test/linux_output_window.cc |
diff --git a/media/cast/test/linux_output_window.cc b/media/cast/test/linux_output_window.cc |
index 486db98cc5f8f67d07b2d1a9100d3554f720738d..5a934aada4394cb8881729ead4159167c50c9eb2 100644 |
--- a/media/cast/test/linux_output_window.cc |
+++ b/media/cast/test/linux_output_window.cc |
@@ -3,8 +3,6 @@ |
// found in the LICENSE file. |
#include "media/cast/test/linux_output_window.h" |
- |
-#include <algorithm> |
#include "base/logging.h" |
#include "media/base/video_frame.h" |
@@ -120,27 +118,18 @@ |
void LinuxOutputWindow::RenderFrame( |
const scoped_refptr<media::VideoFrame>& video_frame) { |
- const gfx::Size damage_size(std::min(video_frame->visible_rect().width(), |
- image_->width), |
- std::min(video_frame->visible_rect().height(), |
- image_->height)); |
- |
- if (damage_size.width() < image_->width || |
- damage_size.height() < image_->height) |
- memset(image_->data, 0x00, image_->bytes_per_line * image_->height); |
- |
- if (!damage_size.IsEmpty()) { |
- libyuv::I420ToARGB(video_frame->visible_data(VideoFrame::kYPlane), |
- video_frame->stride(VideoFrame::kYPlane), |
- video_frame->visible_data(VideoFrame::kUPlane), |
- video_frame->stride(VideoFrame::kUPlane), |
- video_frame->visible_data(VideoFrame::kVPlane), |
- video_frame->stride(VideoFrame::kVPlane), |
- reinterpret_cast<uint8_t*>(image_->data), |
- image_->bytes_per_line, |
- damage_size.width(), |
- damage_size.height()); |
- } |
+ CHECK_LE(video_frame->coded_size().width(), image_->width); |
+ CHECK_LE(video_frame->coded_size().height(), image_->height); |
+ libyuv::I420ToARGB(video_frame->data(VideoFrame::kYPlane), |
+ video_frame->stride(VideoFrame::kYPlane), |
+ video_frame->data(VideoFrame::kUPlane), |
+ video_frame->stride(VideoFrame::kUPlane), |
+ video_frame->data(VideoFrame::kVPlane), |
+ video_frame->stride(VideoFrame::kVPlane), |
+ reinterpret_cast<uint8_t*>(image_->data), |
+ image_->bytes_per_line, |
+ video_frame->coded_size().width(), |
+ video_frame->coded_size().height()); |
// Place image in window. |
XShmPutImage(display_, |
@@ -151,8 +140,8 @@ |
0, |
0, |
0, |
- image_->width, |
- image_->height, |
+ video_frame->coded_size().width(), |
+ video_frame->coded_size().height(), |
true); |
// Very important for the image to update properly! |