OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 PPAPI_CPP_VIDEO_DECODER_H_ | 5 #ifndef PPAPI_CPP_VIDEO_DECODER_H_ |
6 #define PPAPI_CPP_VIDEO_DECODER_H_ | 6 #define PPAPI_CPP_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "ppapi/c/pp_codecs.h" | 8 #include "ppapi/c/pp_codecs.h" |
9 #include "ppapi/c/pp_size.h" | 9 #include "ppapi/c/pp_size.h" |
10 #include "ppapi/cpp/completion_callback.h" | 10 #include "ppapi/cpp/completion_callback.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 /// decoder. | 142 /// decoder. |
143 void RecyclePicture(const PP_VideoPicture& picture); | 143 void RecyclePicture(const PP_VideoPicture& picture); |
144 | 144 |
145 /// Flushes the decoder. The plugin should call Flush() when it reaches the | 145 /// Flushes the decoder. The plugin should call Flush() when it reaches the |
146 /// end of its video stream in order to stop cleanly. The decoder will run any | 146 /// end of its video stream in order to stop cleanly. The decoder will run any |
147 /// pending Decode() call to completion. The plugin should make no further | 147 /// pending Decode() call to completion. The plugin should make no further |
148 /// calls to the decoder other than GetPicture() and RecyclePicture() until | 148 /// calls to the decoder other than GetPicture() and RecyclePicture() until |
149 /// the decoder signals completion by running |callback|. Just before | 149 /// the decoder signals completion by running |callback|. Just before |
150 /// completion, any pending GetPicture() call will complete by running its | 150 /// completion, any pending GetPicture() call will complete by running its |
151 /// callback with result PP_ERROR_ABORTED to signal that no more pictures are | 151 /// callback with result PP_ERROR_ABORTED to signal that no more pictures are |
152 /// available. The plugin should recycle any pictures it is using before | 152 /// available. Any pictures held by the plugin remain valid during and after |
153 /// resuming decoding. | 153 /// the flush and should be recycled back to the decoder. |
154 /// | 154 /// |
155 /// @param[in] callback A <code>CompletionCallback</code> to be called on | 155 /// @param[in] callback A <code>CompletionCallback</code> to be called on |
156 /// completion. | 156 /// completion. |
157 /// | 157 /// |
158 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 158 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
159 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. | 159 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. |
160 int32_t Flush(const CompletionCallback& callback); | 160 int32_t Flush(const CompletionCallback& callback); |
161 | 161 |
162 /// Resets the decoder as quickly as possible. The plugin can call Reset() to | 162 /// Resets the decoder as quickly as possible. The plugin can call Reset() to |
163 /// skip to another position in the video stream. After Reset() returns, any | 163 /// skip to another position in the video stream. After Reset() returns, any |
164 /// pending calls to Decode() and GetPicture()) abort, causing their callbacks | 164 /// pending calls to Decode() and GetPicture()) abort, causing their callbacks |
165 /// to run with PP_ERROR_ABORTED. The plugin should not make further calls to | 165 /// to run with PP_ERROR_ABORTED. The plugin should not make further calls to |
166 /// the decoder until the decoder signals completion by running |callback|. | 166 /// the decoder other than RecyclePicture() until the decoder signals |
167 /// The pictures in use by the plugin remain valid until decoding is resumed, | 167 /// completion by running |callback|. Any pictures held by the plugin remain |
168 /// but need not be recycled. | 168 /// valid during and after the reset and should be recycled back to the |
| 169 /// decoder. |
169 /// | 170 /// |
170 /// @param[in] callback A <code>CompletionCallback</code> to be called on | 171 /// @param[in] callback A <code>CompletionCallback</code> to be called on |
171 /// completion. | 172 /// completion. |
172 /// | 173 /// |
173 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 174 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
174 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. | 175 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. |
175 int32_t Reset(const CompletionCallback& callback); | 176 int32_t Reset(const CompletionCallback& callback); |
176 }; | 177 }; |
177 | 178 |
178 } // namespace pp | 179 } // namespace pp |
179 | 180 |
180 #endif // PPAPI_CPP_VIDEO_DECODER_H_ | 181 #endif // PPAPI_CPP_VIDEO_DECODER_H_ |
OLD | NEW |