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" | 8 #include "base/basictypes.h" |
| 9 #include "gpu/command_buffer/common/mailbox.h" |
9 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
10 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
11 | 12 |
12 namespace media { | 13 namespace media { |
13 | 14 |
14 // A picture buffer that is composed of a GLES2 texture. | 15 // A picture buffer that is composed of a GLES2 texture. |
15 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. | 16 // This is the media-namespace equivalent of PP_PictureBuffer_Dev. |
16 class MEDIA_EXPORT PictureBuffer { | 17 class MEDIA_EXPORT PictureBuffer { |
17 public: | 18 public: |
18 PictureBuffer(int32 id, gfx::Size size, uint32 texture_id); | 19 PictureBuffer(int32 id, gfx::Size size, uint32 texture_id); |
| 20 PictureBuffer(int32 id, |
| 21 gfx::Size size, |
| 22 uint32 texture_id, |
| 23 const gpu::Mailbox& texture_mailbox); |
19 | 24 |
20 // Returns the client-specified id of the buffer. | 25 // Returns the client-specified id of the buffer. |
21 int32 id() const { | 26 int32 id() const { |
22 return id_; | 27 return id_; |
23 } | 28 } |
24 | 29 |
25 // Returns the size of the buffer. | 30 // Returns the size of the buffer. |
26 gfx::Size size() const { | 31 gfx::Size size() const { |
27 return size_; | 32 return size_; |
28 } | 33 } |
29 | 34 |
30 // Returns the id of the texture. | 35 // Returns the id of the texture. |
31 // NOTE: The texture id in the renderer process corresponds to a different | 36 // NOTE: The texture id in the renderer process corresponds to a different |
32 // texture id in the GPU process. | 37 // texture id in the GPU process. |
33 uint32 texture_id() const { | 38 uint32 texture_id() const { |
34 return texture_id_; | 39 return texture_id_; |
35 } | 40 } |
36 | 41 |
| 42 const gpu::Mailbox& texture_mailbox() const { |
| 43 return texture_mailbox_; |
| 44 } |
| 45 |
37 private: | 46 private: |
38 int32 id_; | 47 int32 id_; |
39 gfx::Size size_; | 48 gfx::Size size_; |
40 uint32 texture_id_; | 49 uint32 texture_id_; |
| 50 gpu::Mailbox texture_mailbox_; |
41 }; | 51 }; |
42 | 52 |
43 // A decoded picture frame. | 53 // A decoded picture frame. |
44 // This is the media-namespace equivalent of PP_Picture_Dev. | 54 // This is the media-namespace equivalent of PP_Picture_Dev. |
45 class MEDIA_EXPORT Picture { | 55 class MEDIA_EXPORT Picture { |
46 public: | 56 public: |
47 Picture(int32 picture_buffer_id, int32 bitstream_buffer_id); | 57 Picture(int32 picture_buffer_id, int32 bitstream_buffer_id); |
48 | 58 |
49 // Returns the id of the picture buffer where this picture is contained. | 59 // Returns the id of the picture buffer where this picture is contained. |
50 int32 picture_buffer_id() const { | 60 int32 picture_buffer_id() const { |
(...skipping 10 matching lines...) Expand all Loading... |
61 } | 71 } |
62 | 72 |
63 private: | 73 private: |
64 int32 picture_buffer_id_; | 74 int32 picture_buffer_id_; |
65 int32 bitstream_buffer_id_; | 75 int32 bitstream_buffer_id_; |
66 }; | 76 }; |
67 | 77 |
68 } // namespace media | 78 } // namespace media |
69 | 79 |
70 #endif // MEDIA_VIDEO_PICTURE_H_ | 80 #endif // MEDIA_VIDEO_PICTURE_H_ |
OLD | NEW |