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

Side by Side Diff: webkit/glue/media/video_renderer_impl.cc

Issue 3058055: Implemented way to share video frames between WebKit and Chromium (Closed)
Patch Set: Adding WebKit side for easy reading (will delete in final patch) Created 10 years, 4 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 | « webkit/glue/media/video_renderer_impl.h ('k') | webkit/glue/media/web_video_renderer.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "webkit/glue/media/video_renderer_impl.h" 5 #include "webkit/glue/media/video_renderer_impl.h"
6 6
7 #include "media/base/video_frame.h" 7 #include "media/base/video_frame.h"
8 #include "media/base/yuv_convert.h" 8 #include "media/base/yuv_convert.h"
9 #include "webkit/glue/webmediaplayer_impl.h" 9 #include "webkit/glue/webmediaplayer_impl.h"
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // which is neglible enough for measuring playback performance. 88 // which is neglible enough for measuring playback performance.
89 if (pts_logging_) { 89 if (pts_logging_) {
90 LOG(INFO) << "pts=" 90 LOG(INFO) << "pts="
91 << video_frame->GetTimestamp().InMicroseconds(); 91 << video_frame->GetTimestamp().InMicroseconds();
92 } 92 }
93 } 93 }
94 94
95 PutCurrentFrame(video_frame); 95 PutCurrentFrame(video_frame);
96 } 96 }
97 97
98 void VideoRendererImpl::GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_ out) {
99 VideoRendererBase::GetCurrentFrame(frame_out);
100 }
101
102 void VideoRendererImpl::PutCurrentFrame(scoped_refptr<media::VideoFrame> frame) {
103 VideoRendererBase::PutCurrentFrame(frame);
104 }
105
98 // CanFastPaint is a helper method to determine the conditions for fast 106 // CanFastPaint is a helper method to determine the conditions for fast
99 // painting. The conditions are: 107 // painting. The conditions are:
100 // 1. No skew in canvas matrix. 108 // 1. No skew in canvas matrix.
101 // 2. No flipping nor mirroring. 109 // 2. No flipping nor mirroring.
102 // 3. Canvas has pixel format ARGB8888. 110 // 3. Canvas has pixel format ARGB8888.
103 // 4. Canvas is opaque. 111 // 4. Canvas is opaque.
104 // TODO(hclam): The fast paint method should support flipping and mirroring. 112 // TODO(hclam): The fast paint method should support flipping and mirroring.
105 // Disable the flipping and mirroring checks once we have it. 113 // Disable the flipping and mirroring checks once we have it.
106 bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas, 114 bool VideoRendererImpl::CanFastPaint(skia::PlatformCanvas* canvas,
107 const gfx::Rect& dest_rect) { 115 const gfx::Rect& dest_rect) {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 // Transform destination rect to local coordinates. 320 // Transform destination rect to local coordinates.
313 SkRect transformed_rect; 321 SkRect transformed_rect;
314 SkRect skia_dest_rect; 322 SkRect skia_dest_rect;
315 skia_dest_rect.iset(src_rect.x(), src_rect.y(), 323 skia_dest_rect.iset(src_rect.x(), src_rect.y(),
316 src_rect.right(), src_rect.bottom()); 324 src_rect.right(), src_rect.bottom());
317 matrix.mapRect(&transformed_rect, skia_dest_rect); 325 matrix.mapRect(&transformed_rect, skia_dest_rect);
318 transformed_rect.round(dest_rect); 326 transformed_rect.round(dest_rect);
319 } 327 }
320 328
321 } // namespace webkit_glue 329 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/media/video_renderer_impl.h ('k') | webkit/glue/media/web_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698