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 #ifndef MEDIA_VIDEO_PICTURE_H_ | 5 #ifndef MEDIA_VIDEO_PICTURE_H_ |
6 #define MEDIA_VIDEO_PICTURE_H_ | 6 #define MEDIA_VIDEO_PICTURE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "gpu/command_buffer/common/mailbox.h" | 12 #include "gpu/command_buffer/common/mailbox.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
| 14 #include "ui/gfx/color_space.h" |
14 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
16 | 17 |
17 namespace media { | 18 namespace media { |
18 | 19 |
19 // A picture buffer that is composed of a GLES2 texture. | 20 // A picture buffer that is composed of a GLES2 texture. |
20 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. | 21 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. |
21 class MEDIA_EXPORT PictureBuffer { | 22 class MEDIA_EXPORT PictureBuffer { |
22 public: | 23 public: |
23 using TextureIds = std::vector<uint32_t>; | 24 using TextureIds = std::vector<uint32_t>; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 67 |
67 // A decoded picture frame. | 68 // A decoded picture frame. |
68 // This is the media-namespace equivalent of PP_Picture_Dev. | 69 // This is the media-namespace equivalent of PP_Picture_Dev. |
69 class MEDIA_EXPORT Picture { | 70 class MEDIA_EXPORT Picture { |
70 public: | 71 public: |
71 // Defaults |size_changed_| to false. Size changed is currently only used | 72 // Defaults |size_changed_| to false. Size changed is currently only used |
72 // by AVDA and is set via set_size_changd(). | 73 // by AVDA and is set via set_size_changd(). |
73 Picture(int32_t picture_buffer_id, | 74 Picture(int32_t picture_buffer_id, |
74 int32_t bitstream_buffer_id, | 75 int32_t bitstream_buffer_id, |
75 const gfx::Rect& visible_rect, | 76 const gfx::Rect& visible_rect, |
| 77 const gfx::ColorSpace& color_space, |
76 bool allow_overlay); | 78 bool allow_overlay); |
77 | 79 |
78 // Returns the id of the picture buffer where this picture is contained. | 80 // Returns the id of the picture buffer where this picture is contained. |
79 int32_t picture_buffer_id() const { return picture_buffer_id_; } | 81 int32_t picture_buffer_id() const { return picture_buffer_id_; } |
80 | 82 |
81 // Returns the id of the bitstream buffer from which this frame was decoded. | 83 // Returns the id of the bitstream buffer from which this frame was decoded. |
82 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } | 84 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } |
83 | 85 |
84 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { | 86 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { |
85 bitstream_buffer_id_ = bitstream_buffer_id; | 87 bitstream_buffer_id_ = bitstream_buffer_id; |
86 } | 88 } |
87 | 89 |
| 90 // Returns the color space of the picture. |
| 91 const gfx::ColorSpace& color_space() const { return color_space_; } |
| 92 |
88 // Returns the visible rectangle of the picture. Its size may be smaller | 93 // Returns the visible rectangle of the picture. Its size may be smaller |
89 // than the size of the PictureBuffer, as it is the only visible part of the | 94 // than the size of the PictureBuffer, as it is the only visible part of the |
90 // Picture contained in the PictureBuffer. | 95 // Picture contained in the PictureBuffer. |
91 gfx::Rect visible_rect() const { return visible_rect_; } | 96 gfx::Rect visible_rect() const { return visible_rect_; } |
92 | 97 |
93 bool allow_overlay() const { return allow_overlay_; } | 98 bool allow_overlay() const { return allow_overlay_; } |
94 | 99 |
95 // Returns true when the VDA has adjusted the resolution of this Picture | 100 // Returns true when the VDA has adjusted the resolution of this Picture |
96 // without requesting new PictureBuffers. GpuVideoDecoder should read this | 101 // without requesting new PictureBuffers. GpuVideoDecoder should read this |
97 // as a signal to update the size of the corresponding PicutreBuffer using | 102 // as a signal to update the size of the corresponding PicutreBuffer using |
98 // visible_rect() upon receiving this Picture from a VDA. | 103 // visible_rect() upon receiving this Picture from a VDA. |
99 bool size_changed() const { return size_changed_; }; | 104 bool size_changed() const { return size_changed_; }; |
100 | 105 |
101 void set_size_changed(bool size_changed) { size_changed_ = size_changed; } | 106 void set_size_changed(bool size_changed) { size_changed_ = size_changed; } |
102 | 107 |
103 private: | 108 private: |
104 int32_t picture_buffer_id_; | 109 int32_t picture_buffer_id_; |
105 int32_t bitstream_buffer_id_; | 110 int32_t bitstream_buffer_id_; |
106 gfx::Rect visible_rect_; | 111 gfx::Rect visible_rect_; |
| 112 gfx::ColorSpace color_space_; |
107 bool allow_overlay_; | 113 bool allow_overlay_; |
108 bool size_changed_; | 114 bool size_changed_; |
109 }; | 115 }; |
110 | 116 |
111 } // namespace media | 117 } // namespace media |
112 | 118 |
113 #endif // MEDIA_VIDEO_PICTURE_H_ | 119 #endif // MEDIA_VIDEO_PICTURE_H_ |
OLD | NEW |