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