| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/video/picture.h" | 5 #include "media/video/picture.h" |
| 6 | 6 |
| 7 namespace media { | 7 namespace media { |
| 8 | 8 |
| 9 // PictureBuffer implementation. | 9 // Implementations for the other constructors are found in |
| 10 PictureBuffer::PictureBuffer(int32 id, | 10 // webkit/plugins/ppapi/ppb_video_decoder_impl.cc. |
| 11 gfx::Size pixel_size, | 11 // They are not included in this file because it would require |
| 12 std::vector<uint32> color_format, | 12 // media/ to depend on files in ppapi/. |
| 13 MemoryType memory_type, | 13 BufferInfo::BufferInfo(int32 id, gfx::Size size) |
| 14 std::vector<DataPlaneHandle> data_plane_handles) | |
| 15 : id_(id), | 14 : id_(id), |
| 16 pixel_size_(pixel_size), | 15 size_(size) { |
| 17 color_format_(color_format), | |
| 18 memory_type_(memory_type), | |
| 19 data_plane_handles_(data_plane_handles) { | |
| 20 } | 16 } |
| 21 | 17 |
| 22 PictureBuffer::~PictureBuffer() {} | 18 GLESBuffer::GLESBuffer( |
| 23 | 19 int32 id, gfx::Size size, uint32 texture_id, uint32 context_id) |
| 24 int32 PictureBuffer::GetId() { | 20 : texture_id_(texture_id), |
| 25 return id_; | 21 context_id_(context_id), |
| 22 info_(id, size) { |
| 26 } | 23 } |
| 27 | 24 |
| 28 gfx::Size PictureBuffer::GetSize() { | 25 SysmemBuffer::SysmemBuffer(int32 id, gfx::Size size, void* data) |
| 29 return pixel_size_; | 26 : data_(data), |
| 30 } | 27 info_(id, size) { |
| 31 | |
| 32 const std::vector<uint32>& PictureBuffer::GetColorFormat() { | |
| 33 return color_format_; | |
| 34 } | |
| 35 | |
| 36 PictureBuffer::MemoryType PictureBuffer::GetMemoryType() { | |
| 37 return memory_type_; | |
| 38 } | |
| 39 | |
| 40 std::vector<PictureBuffer::DataPlaneHandle>& PictureBuffer::GetPlaneHandles() { | |
| 41 return data_plane_handles_; | |
| 42 } | |
| 43 | |
| 44 // Picture implementation. | |
| 45 Picture::Picture(PictureBuffer* picture_buffer, gfx::Size decoded_pixel_size, | |
| 46 gfx::Size visible_pixel_size, void* user_handle) | |
| 47 : picture_buffer_(picture_buffer), | |
| 48 decoded_pixel_size_(decoded_pixel_size), | |
| 49 visible_pixel_size_(visible_pixel_size), | |
| 50 user_handle_(user_handle) { | |
| 51 } | |
| 52 | |
| 53 Picture::~Picture() {} | |
| 54 | |
| 55 PictureBuffer* Picture::picture_buffer() { | |
| 56 return picture_buffer_; | |
| 57 } | |
| 58 | |
| 59 gfx::Size Picture::GetDecodedSize() const { | |
| 60 return decoded_pixel_size_; | |
| 61 } | |
| 62 | |
| 63 gfx::Size Picture::GetVisibleSize() const { | |
| 64 return visible_pixel_size_; | |
| 65 } | |
| 66 | |
| 67 void* Picture::GetUserHandle() { | |
| 68 return user_handle_; | |
| 69 } | 28 } |
| 70 | 29 |
| 71 } // namespace media | 30 } // namespace media |
| 72 | |
| OLD | NEW |