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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 /// Initializes a video decoder resource. This should be called after Create() | 59 /// Initializes a video decoder resource. This should be called after Create() |
60 /// and before any other functions. | 60 /// and before any other functions. |
61 /// | 61 /// |
62 /// @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to | 62 /// @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to |
63 /// use during decoding. | 63 /// use during decoding. |
64 /// @param[in] profile A <code>PP_VideoProfile</code> specifying the video | 64 /// @param[in] profile A <code>PP_VideoProfile</code> specifying the video |
65 /// codec profile. | 65 /// codec profile. |
66 /// @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying | 66 /// @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying |
67 /// whether to use a hardware accelerated or a software implementation. | 67 /// whether to use a hardware accelerated or a software implementation. |
| 68 /// @param[in] min_picture_count A count of pictures the plugin would like to |
| 69 /// have in flight. This is effectively the number of times the plugin can |
| 70 /// call GetPicture() and get a decoded frame without calling |
| 71 /// RecyclePicture(). The decoder has its own internal minimum count, and will |
| 72 /// take the larger of its internal and this value. A client that doesn't care |
| 73 /// can therefore just pass in zero for this argument. |
68 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 74 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
69 /// completion. | 75 /// completion. |
70 /// | 76 /// |
71 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 77 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
72 /// Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the | 78 /// Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the |
73 /// requested profile is not supported. In this case, the client may call | 79 /// requested profile is not supported. In this case, the client may call |
74 /// Initialize() again with different parameters to find a good configuration. | 80 /// Initialize() again with different parameters to find a good configuration. |
75 int32_t Initialize(const Graphics3D& graphics3d_context, | 81 int32_t Initialize(const Graphics3D& graphics3d_context, |
76 PP_VideoProfile profile, | 82 PP_VideoProfile profile, |
77 PP_HardwareAcceleration acceleration, | 83 PP_HardwareAcceleration acceleration, |
| 84 uint32_t min_picture_count, |
78 const CompletionCallback& callback); | 85 const CompletionCallback& callback); |
79 | 86 |
80 /// Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 87 /// Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's |
81 /// |buffer|. The plugin should wait until the decoder signals completion by | 88 /// |buffer|. The plugin should wait until the decoder signals completion by |
82 /// returning PP_OK or by running |callback| before calling Decode() again. | 89 /// returning PP_OK or by running |callback| before calling Decode() again. |
83 /// | 90 /// |
84 /// In general, each bitstream buffer should contain a demuxed bitstream frame | 91 /// In general, each bitstream buffer should contain a demuxed bitstream frame |
85 /// for the selected video codec. For example, H264 decoders expect to receive | 92 /// for the selected video codec. For example, H264 decoders expect to receive |
86 /// one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 | 93 /// one AnnexB NAL unit, including the 4 byte start code prefix, while VP8 |
87 /// decoders expect to receive a bitstream frame without the IVF frame header. | 94 /// decoders expect to receive a bitstream frame without the IVF frame header. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 /// completion. | 174 /// completion. |
168 /// | 175 /// |
169 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 176 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. |
170 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. | 177 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. |
171 int32_t Reset(const CompletionCallback& callback); | 178 int32_t Reset(const CompletionCallback& callback); |
172 }; | 179 }; |
173 | 180 |
174 } // namespace pp | 181 } // namespace pp |
175 | 182 |
176 #endif // PPAPI_CPP_VIDEO_DECODER_H_ | 183 #endif // PPAPI_CPP_VIDEO_DECODER_H_ |
OLD | NEW |