Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 68 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 69 /// completion. | 69 /// completion. |
| 70 /// | 70 /// |
| 71 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 71 /// @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 | 72 /// 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 | 73 /// requested profile is not supported. In this case, the client may call |
| 74 /// Initialize() again with different parameters to find a good configuration. | 74 /// Initialize() again with different parameters to find a good configuration. |
| 75 int32_t Initialize(const Graphics3D& graphics3d_context, | 75 int32_t Initialize(const Graphics3D& graphics3d_context, |
| 76 PP_VideoProfile profile, | 76 PP_VideoProfile profile, |
| 77 PP_HardwareAcceleration acceleration, | 77 PP_HardwareAcceleration acceleration, |
| 78 const CompletionCallback& callback); | 78 const CompletionCallback& callback); |
|
bbudge
2015/06/25 01:20:53
We don't usually support older interface versions
lpique
2015/06/25 22:21:18
Done.
| |
| 79 | 79 |
| 80 /// Initializes a video decoder resource. This should be called after Create() | |
| 81 /// and before any other functions. | |
| 82 /// | |
| 83 /// @param[in] graphics3d_context A <code>PPB_Graphics3D</code> resource to | |
| 84 /// use during decoding. | |
| 85 /// @param[in] profile A <code>PP_VideoProfile</code> specifying the video | |
| 86 /// codec profile. | |
| 87 /// @param[in] acceleration A <code>PP_HardwareAcceleration</code> specifying | |
| 88 /// whether to use a hardware accelerated or a software implementation. | |
| 89 /// @param[in] min_picture_count A count of pictures the plugin would like to | |
| 90 /// have in flight. This is effectively the number of times the plugin can | |
| 91 /// call GetPicture() and get a decoded frame without calling | |
| 92 /// RecyclePicture(). The decoder has its own internal minimum count, and will | |
| 93 /// take the larger of its internal and this value. A client that doesn't care | |
| 94 /// can therefore just pass in zero for this argument. | |
| 95 /// @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
| 96 /// completion. | |
| 97 /// | |
| 98 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
| 99 /// Returns PP_ERROR_NOTSUPPORTED if video decoding is not available, or the | |
| 100 /// requested profile is not supported. In this case, the client may call | |
| 101 /// Initialize() again with different parameters to find a good configuration. | |
| 102 int32_t Initialize(const Graphics3D& graphics3d_context, | |
| 103 PP_VideoProfile profile, | |
| 104 PP_HardwareAcceleration acceleration, | |
| 105 uint32_t min_picture_count, | |
| 106 const CompletionCallback& callback); | |
| 107 | |
| 80 /// Decodes a bitstream buffer. Copies |size| bytes of data from the plugin's | 108 /// 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 | 109 /// |buffer|. The plugin should wait until the decoder signals completion by |
| 82 /// returning PP_OK or by running |callback| before calling Decode() again. | 110 /// returning PP_OK or by running |callback| before calling Decode() again. |
| 83 /// | 111 /// |
| 84 /// In general, each bitstream buffer should contain a demuxed bitstream frame | 112 /// In general, each bitstream buffer should contain a demuxed bitstream frame |
| 85 /// for the selected video codec. For example, H264 decoders expect to receive | 113 /// 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 | 114 /// 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. | 115 /// decoders expect to receive a bitstream frame without the IVF frame header. |
| 88 /// | 116 /// |
| 89 /// If the call to Decode() eventually results in a picture, the |decode_id| | 117 /// If the call to Decode() eventually results in a picture, the |decode_id| |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 /// completion. | 195 /// completion. |
| 168 /// | 196 /// |
| 169 /// @return An int32_t containing an error code from <code>pp_errors.h</code>. | 197 /// @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. | 198 /// Returns PP_ERROR_FAILED if the decoder isn't initialized. |
| 171 int32_t Reset(const CompletionCallback& callback); | 199 int32_t Reset(const CompletionCallback& callback); |
| 172 }; | 200 }; |
| 173 | 201 |
| 174 } // namespace pp | 202 } // namespace pp |
| 175 | 203 |
| 176 #endif // PPAPI_CPP_VIDEO_DECODER_H_ | 204 #endif // PPAPI_CPP_VIDEO_DECODER_H_ |
| OLD | NEW |