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

Side by Side Diff: webkit/media/webvideoframe_impl.cc

Issue 10824141: Remove VideoDecoder::natural_size() & added VideoFrame::natural_size(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright year. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/media/skcanvas_video_renderer_unittest.cc ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/media/webvideoframe_impl.h" 5 #include "webkit/media/webvideoframe_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/video_frame.h" 8 #include "media/base/video_frame.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h"
10 10
(...skipping 30 matching lines...) Expand all
41 COMPILE_ASSERT_MATCHING_ENUM(FormatNativeTexture, NATIVE_TEXTURE); 41 COMPILE_ASSERT_MATCHING_ENUM(FormatNativeTexture, NATIVE_TEXTURE);
42 42
43 WebVideoFrame::Format WebVideoFrameImpl::format() const { 43 WebVideoFrame::Format WebVideoFrameImpl::format() const {
44 if (video_frame_.get()) 44 if (video_frame_.get())
45 return static_cast<WebVideoFrame::Format>(video_frame_->format()); 45 return static_cast<WebVideoFrame::Format>(video_frame_->format());
46 return WebVideoFrame::FormatInvalid; 46 return WebVideoFrame::FormatInvalid;
47 } 47 }
48 48
49 unsigned WebVideoFrameImpl::width() const { 49 unsigned WebVideoFrameImpl::width() const {
50 if (video_frame_.get()) 50 if (video_frame_.get())
51 return video_frame_->width(); 51 return video_frame_->data_size().width();
52 return 0; 52 return 0;
53 } 53 }
54 54
55 unsigned WebVideoFrameImpl::height() const { 55 unsigned WebVideoFrameImpl::height() const {
56 if (video_frame_.get()) 56 if (video_frame_.get())
57 return video_frame_->height(); 57 return video_frame_->data_size().height();
58 return 0; 58 return 0;
59 } 59 }
60 60
61 unsigned WebVideoFrameImpl::planes() const { 61 unsigned WebVideoFrameImpl::planes() const {
62 if (!video_frame_.get()) 62 if (!video_frame_.get())
63 return 0; 63 return 0;
64 switch (video_frame_->format()) { 64 switch (video_frame_->format()) {
65 case media::VideoFrame::RGB32: 65 case media::VideoFrame::RGB32:
66 return 1; 66 return 1;
67 case media::VideoFrame::YV12: 67 case media::VideoFrame::YV12:
(...skipping 28 matching lines...) Expand all
96 return video_frame_->texture_id(); 96 return video_frame_->texture_id();
97 } 97 }
98 98
99 unsigned WebVideoFrameImpl::textureTarget() const { 99 unsigned WebVideoFrameImpl::textureTarget() const {
100 if (!video_frame_.get() || format() != FormatNativeTexture) 100 if (!video_frame_.get() || format() != FormatNativeTexture)
101 return 0; 101 return 0;
102 return video_frame_->texture_target(); 102 return video_frame_->texture_target();
103 } 103 }
104 104
105 } // namespace webkit_media 105 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/skcanvas_video_renderer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698