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 "media/base/video_frame.h" | 5 #include "media/base/video_frame.h" |
6 #include "webkit/media/webvideoframe_impl.h" | 6 #include "webkit/media/webvideoframe_impl.h" |
7 | 7 |
8 namespace webkit_media { | 8 namespace webkit_media { |
9 | 9 |
10 WebVideoFrameImpl::WebVideoFrameImpl( | 10 WebVideoFrameImpl::WebVideoFrameImpl( |
11 scoped_refptr<media::VideoFrame> video_frame) | 11 scoped_refptr<media::VideoFrame> video_frame) |
12 : video_frame(video_frame) { | 12 : video_frame(video_frame) { |
13 } | 13 } |
14 | 14 |
15 WebVideoFrameImpl::~WebVideoFrameImpl() {} | 15 WebVideoFrameImpl::~WebVideoFrameImpl() {} |
16 | 16 |
| 17 WebKit::WebVideoFrame::Format WebVideoFrameImpl::format() const |
| 18 { |
| 19 // media::VideoFrame::Format is in sync with WebKit::WebVideoFrame::Format |
| 20 return video_frame ? |
| 21 (WebKit::WebVideoFrame::Format)(video_frame->format()) : |
| 22 WebKit::WebVideoFrame::FormatInvalid; |
| 23 } |
| 24 |
| 25 unsigned WebVideoFrameImpl::textureId() const |
| 26 { |
| 27 return video_frame ? video_frame->texture_id() : 0; |
| 28 } |
| 29 |
| 30 unsigned WebVideoFrameImpl::textureTarget() const |
| 31 { |
| 32 return video_frame ? video_frame->texture_target() : 0; |
| 33 } |
17 } // namespace webkit_media | 34 } // namespace webkit_media |
OLD | NEW |