| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_WRITER_H_ | 5 #ifndef PPAPI_CPP_VIDEO_WRITER_H_ |
| 6 #define PPAPI_CPP_VIDEO_WRITER_H_ | 6 #define PPAPI_CPP_VIDEO_WRITER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 VideoWriter(const VideoWriter& other); | 38 VideoWriter(const VideoWriter& other); |
| 39 | 39 |
| 40 /// A constructor used when you have received a PP_Resource as a return | 40 /// A constructor used when you have received a PP_Resource as a return |
| 41 /// value that has had its reference count incremented for you. | 41 /// value that has had its reference count incremented for you. |
| 42 /// | 42 /// |
| 43 /// @param[in] resource A PP_Resource corresponding to a video writer. | 43 /// @param[in] resource A PP_Resource corresponding to a video writer. |
| 44 VideoWriter(PassRef, PP_Resource resource); | 44 VideoWriter(PassRef, PP_Resource resource); |
| 45 | 45 |
| 46 /// Opens a stream for writing video and associates it with the given id. | 46 /// Opens a stream for writing video and associates it with the given id. |
| 47 /// | 47 /// |
| 48 /// @param[in] stream_id A string uniquely identifying the stream to write to. | 48 /// @param[in] callback A <code>CompletionCallbackWithOutput</code> to be |
| 49 /// @param[in] callback A <code>CompletionCallback</code> to be called upon | 49 /// called upon completion of Open which writes the stream id generated by |
| 50 /// completion of Open. | 50 /// the host. |
| 51 /// | 51 /// |
| 52 /// @return A return code from <code>pp_errors.h</code>. | 52 /// @return A return code from <code>pp_errors.h</code>. |
| 53 int32_t Open(const std::string& stream_id, | 53 int32_t Open(const CompletionCallbackWithOutput<Var>& cc); |
| 54 const CompletionCallback& cc); | |
| 55 | 54 |
| 56 /// Puts the next frame of video to the writer's stream. | 55 /// Puts the next frame of video to the writer's stream. |
| 57 /// | 56 /// |
| 58 /// @param[in] frame A <code>VideoFrame</code> containing the frame to write | 57 /// @param[in] frame A <code>VideoFrame</code> containing the frame to write |
| 59 /// to the open stream. | 58 /// to the open stream. |
| 60 /// | 59 /// |
| 61 /// @return A return code from <code>pp_errors.h</code>. | 60 /// @return A return code from <code>pp_errors.h</code>. |
| 62 int32_t PutFrame(const VideoFrame& frame); | 61 int32_t PutFrame(const VideoFrame& frame); |
| 63 | 62 |
| 64 /// Closes the writer's current stream. | 63 /// Closes the writer's current stream. |
| 65 void Close(); | 64 void Close(); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace pp | 67 } // namespace pp |
| 69 | 68 |
| 70 #endif // PPAPI_CPP_VIDEO_WRITER_H_ | 69 #endif // PPAPI_CPP_VIDEO_WRITER_H_ |
| OLD | NEW |