| 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 "gpu/command_buffer/common/mailbox.h" | 10 #include "gpu/command_buffer/common/mailbox.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 uint32_t texture_id, | 28 uint32_t texture_id, |
| 29 const gpu::Mailbox& texture_mailbox); | 29 const gpu::Mailbox& texture_mailbox); |
| 30 | 30 |
| 31 // Returns the client-specified id of the buffer. | 31 // Returns the client-specified id of the buffer. |
| 32 int32_t id() const { return id_; } | 32 int32_t id() const { return id_; } |
| 33 | 33 |
| 34 // Returns the size of the buffer. | 34 // Returns the size of the buffer. |
| 35 gfx::Size size() const { | 35 gfx::Size size() const { |
| 36 return size_; | 36 return size_; |
| 37 } | 37 } |
| 38 void set_size(const gfx::Size& size) { size_ = size; } |
| 38 | 39 |
| 39 // Returns the id of the texture. | 40 // Returns the id of the texture. |
| 40 // NOTE: The texture id in the renderer process corresponds to a different | 41 // NOTE: The texture id in the renderer process corresponds to a different |
| 41 // texture id in the GPU process. | 42 // texture id in the GPU process. |
| 42 uint32_t texture_id() const { return texture_id_; } | 43 uint32_t texture_id() const { return texture_id_; } |
| 43 | 44 |
| 44 uint32_t internal_texture_id() const { return internal_texture_id_; } | 45 uint32_t internal_texture_id() const { return internal_texture_id_; } |
| 45 | 46 |
| 46 const gpu::Mailbox& texture_mailbox() const { | 47 const gpu::Mailbox& texture_mailbox() const { |
| 47 return texture_mailbox_; | 48 return texture_mailbox_; |
| 48 } | 49 } |
| 49 | 50 |
| 50 private: | 51 private: |
| 51 int32_t id_; | 52 int32_t id_; |
| 52 gfx::Size size_; | 53 gfx::Size size_; |
| 53 uint32_t texture_id_; | 54 uint32_t texture_id_; |
| 54 uint32_t internal_texture_id_; | 55 uint32_t internal_texture_id_; |
| 55 gpu::Mailbox texture_mailbox_; | 56 gpu::Mailbox texture_mailbox_; |
| 56 }; | 57 }; |
| 57 | 58 |
| 58 // A decoded picture frame. | 59 // A decoded picture frame. |
| 59 // This is the media-namespace equivalent of PP_Picture_Dev. | 60 // This is the media-namespace equivalent of PP_Picture_Dev. |
| 60 class MEDIA_EXPORT Picture { | 61 class MEDIA_EXPORT Picture { |
| 61 public: | 62 public: |
| 63 // Defaults |size_changed_| to false. Size changed is currently only used |
| 64 // by AVDA and is set via set_size_changd(). |
| 62 Picture(int32_t picture_buffer_id, | 65 Picture(int32_t picture_buffer_id, |
| 63 int32_t bitstream_buffer_id, | 66 int32_t bitstream_buffer_id, |
| 64 const gfx::Rect& visible_rect, | 67 const gfx::Rect& visible_rect, |
| 65 bool allow_overlay); | 68 bool allow_overlay); |
| 66 | 69 |
| 67 // Returns the id of the picture buffer where this picture is contained. | 70 // Returns the id of the picture buffer where this picture is contained. |
| 68 int32_t picture_buffer_id() const { return picture_buffer_id_; } | 71 int32_t picture_buffer_id() const { return picture_buffer_id_; } |
| 69 | 72 |
| 70 // Returns the id of the bitstream buffer from which this frame was decoded. | 73 // Returns the id of the bitstream buffer from which this frame was decoded. |
| 71 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } | 74 int32_t bitstream_buffer_id() const { return bitstream_buffer_id_; } |
| 72 | 75 |
| 73 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { | 76 void set_bitstream_buffer_id(int32_t bitstream_buffer_id) { |
| 74 bitstream_buffer_id_ = bitstream_buffer_id; | 77 bitstream_buffer_id_ = bitstream_buffer_id; |
| 75 } | 78 } |
| 76 | 79 |
| 77 // Returns the visible rectangle of the picture. Its size may be smaller | 80 // Returns the visible rectangle of the picture. Its size may be smaller |
| 78 // than the size of the PictureBuffer, as it is the only visible part of the | 81 // than the size of the PictureBuffer, as it is the only visible part of the |
| 79 // Picture contained in the PictureBuffer. | 82 // Picture contained in the PictureBuffer. |
| 80 gfx::Rect visible_rect() const { return visible_rect_; } | 83 gfx::Rect visible_rect() const { return visible_rect_; } |
| 81 | 84 |
| 82 bool allow_overlay() const { return allow_overlay_; } | 85 bool allow_overlay() const { return allow_overlay_; } |
| 83 | 86 |
| 87 // Returns true when the VDA has adjusted the resolution of this Picture |
| 88 // without requesting new PictureBuffers. GpuVideoDecoder should read this |
| 89 // as a signal to update the size of the corresponding PicutreBuffer using |
| 90 // visible_rect() upon receiving this Picture from a VDA. |
| 91 bool size_changed() const { return size_changed_; }; |
| 92 |
| 93 void set_size_changed(bool size_changed) { size_changed_ = size_changed; } |
| 94 |
| 84 private: | 95 private: |
| 85 int32_t picture_buffer_id_; | 96 int32_t picture_buffer_id_; |
| 86 int32_t bitstream_buffer_id_; | 97 int32_t bitstream_buffer_id_; |
| 87 gfx::Rect visible_rect_; | 98 gfx::Rect visible_rect_; |
| 88 bool allow_overlay_; | 99 bool allow_overlay_; |
| 100 bool size_changed_; |
| 89 }; | 101 }; |
| 90 | 102 |
| 91 } // namespace media | 103 } // namespace media |
| 92 | 104 |
| 93 #endif // MEDIA_VIDEO_PICTURE_H_ | 105 #endif // MEDIA_VIDEO_PICTURE_H_ |
| OLD | NEW |