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