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

Side by Side Diff: cc/layers/video_layer_impl.cc

Issue 1869303004: media: Implement zero-copy video playback for VP8. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: optimize only VP8 Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } else if (videoframe_color_space == media::COLOR_SPACE_HD_REC709) { 243 } else if (videoframe_color_space == media::COLOR_SPACE_HD_REC709) {
244 color_space = YUVVideoDrawQuad::REC_709; 244 color_space = YUVVideoDrawQuad::REC_709;
245 } 245 }
246 } 246 }
247 247
248 const gfx::Size ya_tex_size = coded_size; 248 const gfx::Size ya_tex_size = coded_size;
249 gfx::Size uv_tex_size = media::VideoFrame::PlaneSize( 249 gfx::Size uv_tex_size = media::VideoFrame::PlaneSize(
250 frame_->format(), media::VideoFrame::kUPlane, coded_size); 250 frame_->format(), media::VideoFrame::kUPlane, coded_size);
251 251
252 if (frame_->HasTextures()) { 252 if (frame_->HasTextures()) {
253 DCHECK_EQ(media::PIXEL_FORMAT_I420, frame_->format()); 253 if (DCHECK_IS_ON()) {
254 DCHECK_EQ(3u, frame_resources_.size()); // Alpha is not supported yet. 254 if (frame_->format() == media::PIXEL_FORMAT_I420) {
255 DCHECK_EQ(3u, frame_resources_.size());
256 } else if (frame_->format() == media::PIXEL_FORMAT_YV12A) {
257 DCHECK_EQ(4u, frame_resources_.size());
258 } else {
259 NOTREACHED();
260 }
261 }
255 } else { 262 } else {
256 DCHECK(uv_tex_size == 263 DCHECK(uv_tex_size ==
257 media::VideoFrame::PlaneSize( 264 media::VideoFrame::PlaneSize(
258 frame_->format(), media::VideoFrame::kVPlane, coded_size)); 265 frame_->format(), media::VideoFrame::kVPlane, coded_size));
259 DCHECK(frame_resources_.size() <= 3 || 266 DCHECK(frame_resources_.size() <= 3 ||
260 ya_tex_size == media::VideoFrame::PlaneSize( 267 ya_tex_size == media::VideoFrame::PlaneSize(
261 frame_->format(), media::VideoFrame::kAPlane, 268 frame_->format(), media::VideoFrame::kAPlane,
262 coded_size)); 269 coded_size));
263 } 270 }
264 271
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 void VideoLayerImpl::SetNeedsRedraw() { 419 void VideoLayerImpl::SetNeedsRedraw() {
413 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 420 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
414 layer_tree_impl()->SetNeedsRedraw(); 421 layer_tree_impl()->SetNeedsRedraw();
415 } 422 }
416 423
417 const char* VideoLayerImpl::LayerTypeAsString() const { 424 const char* VideoLayerImpl::LayerTypeAsString() const {
418 return "cc::VideoLayerImpl"; 425 return "cc::VideoLayerImpl";
419 } 426 }
420 427
421 } // namespace cc 428 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698