| 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 "base/basictypes.h" | |
| 9 #include "gpu/command_buffer/common/mailbox.h" | 8 #include "gpu/command_buffer/common/mailbox.h" |
| 10 #include "media/base/media_export.h" | 9 #include "media/base/media_export.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" | 11 #include "ui/gfx/geometry/size.h" |
| 13 | 12 |
| 14 namespace media { | 13 namespace media { |
| 15 | 14 |
| 16 // A picture buffer that is composed of a GLES2 texture. | 15 // A picture buffer that is composed of a GLES2 texture. |
| 17 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. | 16 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. |
| 18 class MEDIA_EXPORT PictureBuffer { | 17 class MEDIA_EXPORT PictureBuffer { |
| 19 public: | 18 public: |
| 20 PictureBuffer(int32 id, gfx::Size size, uint32 texture_id); | 19 PictureBuffer(int32_t id, gfx::Size size, uint32_t texture_id); |
| 21 PictureBuffer(int32 id, | 20 PictureBuffer(int32_t id, |
| 22 gfx::Size size, | 21 gfx::Size size, |
| 23 uint32 texture_id, | 22 uint32_t texture_id, |
| 24 uint32 internal_texture_id); | 23 uint32_t internal_texture_id); |
| 25 PictureBuffer(int32 id, | 24 PictureBuffer(int32_t id, |
| 26 gfx::Size size, | 25 gfx::Size size, |
| 27 uint32 texture_id, | 26 uint32_t texture_id, |
| 28 const gpu::Mailbox& texture_mailbox); | 27 const gpu::Mailbox& texture_mailbox); |
| 29 | 28 |
| 30 // Returns the client-specified id of the buffer. | 29 // Returns the client-specified id of the buffer. |
| 31 int32 id() const { | 30 int32_t id() const { return id_; } |
| 32 return id_; | |
| 33 } | |
| 34 | 31 |
| 35 // Returns the size of the buffer. | 32 // Returns the size of the buffer. |
| 36 gfx::Size size() const { | 33 gfx::Size size() const { |
| 37 return size_; | 34 return size_; |
| 38 } | 35 } |
| 39 | 36 |
| 40 // Returns the id of the texture. | 37 // Returns the id of the texture. |
| 41 // NOTE: The texture id in the renderer process corresponds to a different | 38 // NOTE: The texture id in the renderer process corresponds to a different |
| 42 // texture id in the GPU process. | 39 // texture id in the GPU process. |
| 43 uint32 texture_id() const { | 40 uint32_t texture_id() const { return texture_id_; } |
| 44 return texture_id_; | |
| 45 } | |
| 46 | 41 |
| 47 uint32 internal_texture_id() const { return internal_texture_id_; } | 42 uint32_t internal_texture_id() const { return internal_texture_id_; } |
| 48 | 43 |
| 49 const gpu::Mailbox& texture_mailbox() const { | 44 const gpu::Mailbox& texture_mailbox() const { |
| 50 return texture_mailbox_; | 45 return texture_mailbox_; |
| 51 } | 46 } |
| 52 | 47 |
| 53 private: | 48 private: |
| 54 int32 id_; | 49 int32_t id_; |
| 55 gfx::Size size_; | 50 gfx::Size size_; |
| 56 uint32 texture_id_; | 51 uint32_t texture_id_; |
| 57 uint32 internal_texture_id_; | 52 uint32_t internal_texture_id_; |
| 58 gpu::Mailbox texture_mailbox_; | 53 gpu::Mailbox texture_mailbox_; |
| 59 }; | 54 }; |
| 60 | 55 |
| 61 // A decoded picture frame. | 56 // A decoded picture frame. |
| 62 // This is the media-namespace equivalent of PP_Picture_Dev. | 57 // This is the media-namespace equivalent of PP_Picture_Dev. |
| 63 class MEDIA_EXPORT Picture { | 58 class MEDIA_EXPORT Picture { |
| 64 public: | 59 public: |
| 65 Picture(int32 picture_buffer_id, | 60 Picture(int32_t picture_buffer_id, |
| 66 int32 bitstream_buffer_id, | 61 int32_t bitstream_buffer_id, |
| 67 const gfx::Rect& visible_rect, | 62 const gfx::Rect& visible_rect, |
| 68 bool allow_overlay); | 63 bool allow_overlay); |
| 69 | 64 |
| 70 // Returns the id of the picture buffer where this picture is contained. | 65 // Returns the id of the picture buffer where this picture is contained. |
| 71 int32 picture_buffer_id() const { | 66 int32_t picture_buffer_id() const { return picture_buffer_id_; } |
| 72 return picture_buffer_id_; | |
| 73 } | |
| 74 | 67 |
| 75 // Returns the id of the bitstream buffer from which this frame was decoded. | 68 // Returns the id of the bitstream buffer from which this frame was decoded. |
| 76 int32 bitstream_buffer_id() const { | 69 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } |
| 77 return bitstream_buffer_id_; | |
| 78 } | |
| 79 | 70 |
| 80 void set_bitstream_buffer_id(int32 bitstream_buffer_id) { | 71 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { |
| 81 bitstream_buffer_id_ = bitstream_buffer_id; | 72 bitstream_buffer_id_ = bitstream_buffer_id; |
| 82 } | 73 } |
| 83 | 74 |
| 84 // Returns the visible rectangle of the picture. Its size may be smaller | 75 // Returns the visible rectangle of the picture. Its size may be smaller |
| 85 // than the size of the PictureBuffer, as it is the only visible part of the | 76 // than the size of the PictureBuffer, as it is the only visible part of the |
| 86 // Picture contained in the PictureBuffer. | 77 // Picture contained in the PictureBuffer. |
| 87 gfx::Rect visible_rect() const { return visible_rect_; } | 78 gfx::Rect visible_rect() const { return visible_rect_; } |
| 88 | 79 |
| 89 bool allow_overlay() const { return allow_overlay_; } | 80 bool allow_overlay() const { return allow_overlay_; } |
| 90 | 81 |
| 91 private: | 82 private: |
| 92 int32 picture_buffer_id_; | 83 int32_t picture_buffer_id_; |
| 93 int32 bitstream_buffer_id_; | 84 int32_t bitstream_buffer_id_; |
| 94 gfx::Rect visible_rect_; | 85 gfx::Rect visible_rect_; |
| 95 bool allow_overlay_; | 86 bool allow_overlay_; |
| 96 }; | 87 }; |
| 97 | 88 |
| 98 } // namespace media | 89 } // namespace media |
| 99 | 90 |
| 100 #endif // MEDIA_VIDEO_PICTURE_H_ | 91 #endif // MEDIA_VIDEO_PICTURE_H_ |
| OLD | NEW |