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

Unified Diff: media/cast/test/linux_output_window.cc

Issue 899583002: Revert of [Cast] Software encoder support for varying video frame sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « media/cast/test/fake_media_source.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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!
« no previous file with comments | « media/cast/test/fake_media_source.cc ('k') | media/cast/test/sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698