| 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/geometry/rect.h" | 14 #include "ui/gfx/geometry/rect.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 // A picture buffer that is composed of a GLES2 texture. | 19 // A picture buffer that is composed of one or more GLES2 textures. |
| 20 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. | 20 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. |
| 21 class MEDIA_EXPORT PictureBuffer { | 21 class MEDIA_EXPORT PictureBuffer { |
| 22 public: | 22 public: |
| 23 using TextureIds = std::vector<uint32_t>; | 23 using TextureIds = std::vector<uint32_t>; |
| 24 | 24 |
| 25 PictureBuffer(int32_t id, gfx::Size size, const TextureIds& texture_ids); | |
| 26 PictureBuffer(int32_t id, | 25 PictureBuffer(int32_t id, |
| 27 gfx::Size size, | 26 gfx::Size size, |
| 28 const TextureIds& texture_ids, | 27 const TextureIds& client_texture_ids); |
| 29 const TextureIds& internal_texture_ids); | |
| 30 PictureBuffer(int32_t id, | 28 PictureBuffer(int32_t id, |
| 31 gfx::Size size, | 29 gfx::Size size, |
| 32 const TextureIds& texture_ids, | 30 const TextureIds& client_texture_ids, |
| 31 const TextureIds& service_texture_ids); |
| 32 PictureBuffer(int32_t id, |
| 33 gfx::Size size, |
| 34 const TextureIds& client_texture_ids, |
| 33 const std::vector<gpu::Mailbox>& texture_mailboxes); | 35 const std::vector<gpu::Mailbox>& texture_mailboxes); |
| 34 PictureBuffer(const PictureBuffer& other); | 36 PictureBuffer(const PictureBuffer& other); |
| 35 ~PictureBuffer(); | 37 ~PictureBuffer(); |
| 36 | 38 |
| 37 // Returns the client-specified id of the buffer. | 39 // Returns the client-specified id of the buffer. |
| 38 int32_t id() const { return id_; } | 40 int32_t id() const { return id_; } |
| 39 | 41 |
| 40 // Returns the size of the buffer. | 42 // Returns the size of the buffer. |
| 41 gfx::Size size() const { | 43 gfx::Size size() const { return size_; } |
| 42 return size_; | 44 |
| 43 } | |
| 44 void set_size(const gfx::Size& size) { size_ = size; } | 45 void set_size(const gfx::Size& size) { size_ = size; } |
| 45 | 46 |
| 46 // Returns the id of the texture. | 47 // The client texture ids, i.e., those returned by Chrome's GL service. |
| 47 // NOTE: The texture id in the renderer process corresponds to a different | 48 const TextureIds& client_texture_ids() const { return client_texture_ids_; } |
| 48 // texture id in the GPU process. | |
| 49 const TextureIds& texture_ids() const { return texture_ids_; } | |
| 50 | 49 |
| 51 const TextureIds& internal_texture_ids() const { | 50 // The service texture ids, i.e., the real platform ids corresponding to |
| 52 return internal_texture_ids_; | 51 // |client_texture_ids|. |
| 53 } | 52 const TextureIds& service_texture_ids() const { return service_texture_ids_; } |
| 54 | 53 |
| 55 const gpu::Mailbox& texture_mailbox(size_t plane) const { | 54 const gpu::Mailbox& texture_mailbox(size_t plane) const { |
| 56 return texture_mailboxes_[plane]; | 55 return texture_mailboxes_[plane]; |
| 57 } | 56 } |
| 58 | 57 |
| 59 private: | 58 private: |
| 60 int32_t id_; | 59 int32_t id_; |
| 61 gfx::Size size_; | 60 gfx::Size size_; |
| 62 TextureIds texture_ids_; | 61 TextureIds client_texture_ids_; |
| 63 TextureIds internal_texture_ids_; | 62 TextureIds service_texture_ids_; |
| 64 std::vector<gpu::Mailbox> texture_mailboxes_; | 63 std::vector<gpu::Mailbox> texture_mailboxes_; |
| 65 }; | 64 }; |
| 66 | 65 |
| 67 // A decoded picture frame. | 66 // A decoded picture frame. |
| 68 // This is the media-namespace equivalent of PP_Picture_Dev. | 67 // This is the media-namespace equivalent of PP_Picture_Dev. |
| 69 class MEDIA_EXPORT Picture { | 68 class MEDIA_EXPORT Picture { |
| 70 public: | 69 public: |
| 71 // Defaults |size_changed_| to false. Size changed is currently only used | 70 // Defaults |size_changed_| to false. Size changed is currently only used |
| 72 // by AVDA and is set via set_size_changd(). | 71 // by AVDA and is set via set_size_changd(). |
| 73 Picture(int32_t picture_buffer_id, | 72 Picture(int32_t picture_buffer_id, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 104 int32_t picture_buffer_id_; | 103 int32_t picture_buffer_id_; |
| 105 int32_t bitstream_buffer_id_; | 104 int32_t bitstream_buffer_id_; |
| 106 gfx::Rect visible_rect_; | 105 gfx::Rect visible_rect_; |
| 107 bool allow_overlay_; | 106 bool allow_overlay_; |
| 108 bool size_changed_; | 107 bool size_changed_; |
| 109 }; | 108 }; |
| 110 | 109 |
| 111 } // namespace media | 110 } // namespace media |
| 112 | 111 |
| 113 #endif // MEDIA_VIDEO_PICTURE_H_ | 112 #endif // MEDIA_VIDEO_PICTURE_H_ |
| OLD | NEW |