OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIDEO_DECODE_ACCELERATOR_H_ | 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 // Interface for collaborating with picture interface to provide memory for | 55 // Interface for collaborating with picture interface to provide memory for |
56 // output picture and blitting them. These callbacks will not be made unless | 56 // output picture and blitting them. These callbacks will not be made unless |
57 // Initialize() has returned successfully. | 57 // Initialize() has returned successfully. |
58 // This interface is extended by the various layers that relay messages back | 58 // This interface is extended by the various layers that relay messages back |
59 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin | 59 // to the plugin, through the PPP_VideoDecoder_Dev interface the plugin |
60 // implements. | 60 // implements. |
61 class MEDIA_EXPORT Client { | 61 class MEDIA_EXPORT Client { |
62 public: | 62 public: |
63 // Callback to tell client how many and what size of buffers to provide. | 63 // Callback to tell client how many and what size of buffers to provide. |
| 64 // Note that the actual count provided through AssignPictureBuffers() can be |
| 65 // larger than the value requested. |
64 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 66 virtual void ProvidePictureBuffers(uint32 requested_num_of_buffers, |
65 const gfx::Size& dimensions, | 67 const gfx::Size& dimensions, |
66 uint32 texture_target) = 0; | 68 uint32 texture_target) = 0; |
67 | 69 |
68 // Callback to dismiss picture buffer that was assigned earlier. | 70 // Callback to dismiss picture buffer that was assigned earlier. |
69 virtual void DismissPictureBuffer(int32 picture_buffer_id) = 0; | 71 virtual void DismissPictureBuffer(int32 picture_buffer_id) = 0; |
70 | 72 |
71 // Callback to deliver decoded pictures ready to be displayed. | 73 // Callback to deliver decoded pictures ready to be displayed. |
72 virtual void PictureReady(const Picture& picture) = 0; | 74 virtual void PictureReady(const Picture& picture) = 0; |
73 | 75 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // |bitstream_buffer| is the input bitstream that is sent for decoding. | 110 // |bitstream_buffer| is the input bitstream that is sent for decoding. |
109 virtual void Decode(const BitstreamBuffer& bitstream_buffer) = 0; | 111 virtual void Decode(const BitstreamBuffer& bitstream_buffer) = 0; |
110 | 112 |
111 // Assigns a set of texture-backed picture buffers to the video decoder. | 113 // Assigns a set of texture-backed picture buffers to the video decoder. |
112 // | 114 // |
113 // Ownership of each picture buffer remains with the client, but the client | 115 // Ownership of each picture buffer remains with the client, but the client |
114 // is not allowed to deallocate the buffer before the DismissPictureBuffer | 116 // is not allowed to deallocate the buffer before the DismissPictureBuffer |
115 // callback has been initiated for a given buffer. | 117 // callback has been initiated for a given buffer. |
116 // | 118 // |
117 // Parameters: | 119 // Parameters: |
118 // |buffers| contains the allocated picture buffers for the output. | 120 // |buffers| contains the allocated picture buffers for the output. Note |
| 121 // that the count of buffers may be larger than the count requested through |
| 122 // the call to Client::ProvidePictureBuffers(). |
119 virtual void AssignPictureBuffers( | 123 virtual void AssignPictureBuffers( |
120 const std::vector<PictureBuffer>& buffers) = 0; | 124 const std::vector<PictureBuffer>& buffers) = 0; |
121 | 125 |
122 // Sends picture buffers to be reused by the decoder. This needs to be called | 126 // Sends picture buffers to be reused by the decoder. This needs to be called |
123 // for each buffer that has been processed so that decoder may know onto which | 127 // for each buffer that has been processed so that decoder may know onto which |
124 // picture buffers it can write the output to. | 128 // picture buffers it can write the output to. |
125 // | 129 // |
126 // Parameters: | 130 // Parameters: |
127 // |picture_buffer_id| id of the picture buffer that is to be reused. | 131 // |picture_buffer_id| id of the picture buffer that is to be reused. |
128 virtual void ReusePictureBuffer(int32 picture_buffer_id) = 0; | 132 virtual void ReusePictureBuffer(int32 picture_buffer_id) = 0; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // uses "Destroy()" instead of trying to use the destructor. | 181 // uses "Destroy()" instead of trying to use the destructor. |
178 template <> | 182 template <> |
179 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { | 183 struct MEDIA_EXPORT DefaultDeleter<media::VideoDecodeAccelerator> { |
180 public: | 184 public: |
181 void operator()(void* video_decode_accelerator) const; | 185 void operator()(void* video_decode_accelerator) const; |
182 }; | 186 }; |
183 | 187 |
184 } // namespace base | 188 } // namespace base |
185 | 189 |
186 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ | 190 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |