OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |