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

Side by Side Diff: cc/test/fake_video_frame.cc

Issue 11754003: Move VideoFrameProvider to, and remove all usage of WebVideoFrame from cc/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed crashes Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/test/fake_video_frame.h"
6
7 using WebKit::WebRect;
8 using WebKit::WebSize;
9 using WebKit::WebVideoFrame;
10
11 namespace cc {
12
13 FakeVideoFrame::FakeVideoFrame(const scoped_refptr<media::VideoFrame>& frame)
14 : frame_(frame) {}
15
16 FakeVideoFrame::~FakeVideoFrame() {}
17
18 WebVideoFrame::Format FakeVideoFrame::format() const {
19 return FormatInvalid;
20 }
21
22 unsigned FakeVideoFrame::width() const {
23 return frame_->natural_size().width();
24 }
25
26 unsigned FakeVideoFrame::height() const {
27 return frame_->natural_size().height();
28 }
29
30 unsigned FakeVideoFrame::planes() const {
31 return 0;
32 }
33
34 int FakeVideoFrame::stride(unsigned plane) const {
35 return 0;
36 }
37
38 const void* FakeVideoFrame::data(unsigned plane) const {
39 return NULL;
40 }
41
42 unsigned FakeVideoFrame::textureId() const {
43 return frame_->texture_id();
44 }
45
46 unsigned FakeVideoFrame::textureTarget() const {
47 return frame_->texture_target();
48 }
49
50 WebRect FakeVideoFrame::visibleRect() const {
51 return frame_->visible_rect();
52 }
53
54 WebSize FakeVideoFrame::textureSize() const {
55 return frame_->coded_size();
56 }
57
58 // static
59 media::VideoFrame* FakeVideoFrame::ToVideoFrame(
60 WebVideoFrame* web_video_frame) {
61 if (!web_video_frame)
62 return NULL;
63 FakeVideoFrame* fake_frame = static_cast<FakeVideoFrame*>(web_video_frame);
64 return fake_frame->frame_.get();
65 }
66
67 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698