| 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 // PictureBuffer implementation. |
| 10 PictureBuffer::PictureBuffer(int32 id, | 10 PictureBuffer::PictureBuffer(int32 id, |
| 11 gfx::Size pixel_size, | 11 gfx::Size pixel_size, |
| 12 std::vector<uint32> color_format, | |
| 13 MemoryType memory_type, | 12 MemoryType memory_type, |
| 14 std::vector<DataPlaneHandle> data_plane_handles) | 13 std::vector<DataPlaneHandle> data_plane_handles) |
| 15 : id_(id), | 14 : id_(id), |
| 16 pixel_size_(pixel_size), | 15 pixel_size_(pixel_size), |
| 17 color_format_(color_format), | |
| 18 memory_type_(memory_type), | 16 memory_type_(memory_type), |
| 19 data_plane_handles_(data_plane_handles) { | 17 data_plane_handles_(data_plane_handles) { |
| 20 } | 18 } |
| 21 | 19 |
| 22 PictureBuffer::~PictureBuffer() {} | 20 PictureBuffer::~PictureBuffer() {} |
| 23 | 21 |
| 24 int32 PictureBuffer::GetId() { | 22 int32 PictureBuffer::GetId() { |
| 25 return id_; | 23 return id_; |
| 26 } | 24 } |
| 27 | 25 |
| 28 gfx::Size PictureBuffer::GetSize() { | 26 gfx::Size PictureBuffer::GetSize() { |
| 29 return pixel_size_; | 27 return pixel_size_; |
| 30 } | 28 } |
| 31 | 29 |
| 32 const std::vector<uint32>& PictureBuffer::GetColorFormat() { | |
| 33 return color_format_; | |
| 34 } | |
| 35 | |
| 36 PictureBuffer::MemoryType PictureBuffer::GetMemoryType() { | 30 PictureBuffer::MemoryType PictureBuffer::GetMemoryType() { |
| 37 return memory_type_; | 31 return memory_type_; |
| 38 } | 32 } |
| 39 | 33 |
| 40 std::vector<PictureBuffer::DataPlaneHandle>& PictureBuffer::GetPlaneHandles() { | 34 std::vector<PictureBuffer::DataPlaneHandle>& PictureBuffer::GetPlaneHandles() { |
| 41 return data_plane_handles_; | 35 return data_plane_handles_; |
| 42 } | 36 } |
| 43 | 37 |
| 44 // Picture implementation. | 38 // Picture implementation. |
| 45 Picture::Picture(PictureBuffer* picture_buffer, gfx::Size decoded_pixel_size, | 39 Picture::Picture(int32 picture_buffer_id, gfx::Size decoded_pixel_size, |
| 46 gfx::Size visible_pixel_size, void* user_handle) | 40 gfx::Size visible_pixel_size, void* user_handle) |
| 47 : picture_buffer_(picture_buffer), | 41 : picture_buffer_id_(picture_buffer_id), |
| 48 decoded_pixel_size_(decoded_pixel_size), | 42 decoded_pixel_size_(decoded_pixel_size), |
| 49 visible_pixel_size_(visible_pixel_size), | 43 visible_pixel_size_(visible_pixel_size), |
| 50 user_handle_(user_handle) { | 44 user_handle_(user_handle) { |
| 51 } | 45 } |
| 52 | 46 |
| 53 Picture::~Picture() {} | 47 Picture::~Picture() {} |
| 54 | 48 |
| 55 PictureBuffer* Picture::picture_buffer() { | 49 int32 Picture::GetId() { |
| 56 return picture_buffer_; | 50 return picture_buffer_id_; |
| 57 } | 51 } |
| 58 | 52 |
| 59 gfx::Size Picture::GetDecodedSize() const { | 53 gfx::Size Picture::GetDecodedSize() const { |
| 60 return decoded_pixel_size_; | 54 return decoded_pixel_size_; |
| 61 } | 55 } |
| 62 | 56 |
| 63 gfx::Size Picture::GetVisibleSize() const { | 57 gfx::Size Picture::GetVisibleSize() const { |
| 64 return visible_pixel_size_; | 58 return visible_pixel_size_; |
| 65 } | 59 } |
| 66 | 60 |
| 67 void* Picture::GetUserHandle() { | 61 void* Picture::GetUserHandle() { |
| 68 return user_handle_; | 62 return user_handle_; |
| 69 } | 63 } |
| 70 | 64 |
| 71 } // namespace media | 65 } // namespace media |
| 72 | |
| OLD | NEW |