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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "media/video/picture.h" | 6 #include "media/video/picture.h" |
7 | 7 |
8 namespace media { | 8 namespace media { |
9 | 9 |
10 PictureBuffer::PictureBuffer(int32_t id, const gfx::Size& size) | 10 PictureBuffer::PictureBuffer(int32_t id, const gfx::Size& size) |
11 : id_(id), size_(size) {} | 11 : id_(id), size_(size) {} |
12 | 12 |
13 PictureBuffer::PictureBuffer(int32_t id, | 13 PictureBuffer::PictureBuffer(int32_t id, |
14 const gfx::Size& size, | 14 const gfx::Size& size, |
15 const TextureIds& client_texture_ids) | 15 const TextureIds& client_texture_ids) |
16 : id_(id), size_(size), client_texture_ids_(client_texture_ids) { | 16 : id_(id), size_(size), client_texture_ids_(client_texture_ids) { |
17 DCHECK(!client_texture_ids_.empty()); | 17 DCHECK(!client_texture_ids_.empty()); |
18 } | 18 } |
19 | 19 |
20 PictureBuffer::PictureBuffer(int32_t id, | 20 PictureBuffer::PictureBuffer(int32_t id, |
21 const gfx::Size& size, | 21 const gfx::Size& size, |
22 const TextureIds& client_texture_ids, | 22 const TextureIds& client_texture_ids, |
23 const TextureIds& service_texture_ids) | 23 const TextureIds& service_texture_ids, |
| 24 uint32_t texture_target, |
| 25 VideoPixelFormat pixel_format) |
24 : id_(id), | 26 : id_(id), |
25 size_(size), | 27 size_(size), |
26 client_texture_ids_(client_texture_ids), | 28 client_texture_ids_(client_texture_ids), |
27 service_texture_ids_(service_texture_ids) { | 29 service_texture_ids_(service_texture_ids), |
| 30 texture_target_(texture_target), |
| 31 pixel_format_(pixel_format) { |
28 DCHECK(!service_texture_ids_.empty()); | 32 DCHECK(!service_texture_ids_.empty()); |
29 // We either not have client texture ids at all, or if we do, then their | 33 // We either not have client texture ids at all, or if we do, then their |
30 // number must be the same as the number of service texture ids. | 34 // number must be the same as the number of service texture ids. |
31 DCHECK(client_texture_ids_.empty() || | 35 DCHECK(client_texture_ids_.empty() || |
32 client_texture_ids_.size() == service_texture_ids_.size()); | 36 client_texture_ids_.size() == service_texture_ids_.size()); |
33 } | 37 } |
34 | 38 |
35 PictureBuffer::PictureBuffer(int32_t id, | 39 PictureBuffer::PictureBuffer(int32_t id, |
36 const gfx::Size& size, | 40 const gfx::Size& size, |
37 const TextureIds& client_texture_ids, | 41 const TextureIds& client_texture_ids, |
38 const std::vector<gpu::Mailbox>& texture_mailboxes) | 42 const std::vector<gpu::Mailbox>& texture_mailboxes, |
| 43 uint32_t texture_target, |
| 44 VideoPixelFormat pixel_format) |
39 : id_(id), | 45 : id_(id), |
40 size_(size), | 46 size_(size), |
41 client_texture_ids_(client_texture_ids), | 47 client_texture_ids_(client_texture_ids), |
42 texture_mailboxes_(texture_mailboxes) { | 48 texture_mailboxes_(texture_mailboxes), |
| 49 texture_target_(texture_target), |
| 50 pixel_format_(pixel_format) { |
43 DCHECK_EQ(client_texture_ids.size(), texture_mailboxes.size()); | 51 DCHECK_EQ(client_texture_ids.size(), texture_mailboxes.size()); |
44 } | 52 } |
45 | 53 |
46 PictureBuffer::PictureBuffer(const PictureBuffer& other) = default; | 54 PictureBuffer::PictureBuffer(const PictureBuffer& other) = default; |
47 | 55 |
48 PictureBuffer::~PictureBuffer() {} | 56 PictureBuffer::~PictureBuffer() {} |
49 | 57 |
50 gpu::Mailbox PictureBuffer::texture_mailbox(size_t plane) const { | 58 gpu::Mailbox PictureBuffer::texture_mailbox(size_t plane) const { |
51 if (plane >= texture_mailboxes_.size()) { | 59 if (plane >= texture_mailboxes_.size()) { |
52 LOG(ERROR) << "No mailbox for plane " << plane; | 60 LOG(ERROR) << "No mailbox for plane " << plane; |
(...skipping 15 matching lines...) Expand all Loading... |
68 allow_overlay_(allow_overlay), | 76 allow_overlay_(allow_overlay), |
69 size_changed_(false), | 77 size_changed_(false), |
70 surface_texture_(false), | 78 surface_texture_(false), |
71 wants_promotion_hint_(false) {} | 79 wants_promotion_hint_(false) {} |
72 | 80 |
73 Picture::Picture(const Picture& other) = default; | 81 Picture::Picture(const Picture& other) = default; |
74 | 82 |
75 Picture::~Picture() = default; | 83 Picture::~Picture() = default; |
76 | 84 |
77 } // namespace media | 85 } // namespace media |
OLD | NEW |