| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_CPP_VIDEO_WRITER_H_ | |
| 6 #define PPAPI_CPP_VIDEO_WRITER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "ppapi/c/pp_time.h" | |
| 11 #include "ppapi/cpp/completion_callback.h" | |
| 12 #include "ppapi/cpp/pass_ref.h" | |
| 13 #include "ppapi/cpp/resource.h" | |
| 14 | |
| 15 /// @file | |
| 16 /// This file defines the API to create and use video stream readers and | |
| 17 /// writers. | |
| 18 | |
| 19 namespace pp { | |
| 20 | |
| 21 class InstanceHandle; | |
| 22 class VideoFrame; | |
| 23 | |
| 24 // VideoWriter ----------------------------------------------------------------- | |
| 25 | |
| 26 /// The <code>VideoWriter</code> class represents a video writer resource. | |
| 27 class VideoWriter : public Resource { | |
| 28 public: | |
| 29 /// Default constructor for creating a <code>VideoWriter</code> object. | |
| 30 VideoWriter(); | |
| 31 | |
| 32 /// Constructor for creating a <code>VideoWriter</code> for an instance. | |
| 33 explicit VideoWriter(const InstanceHandle& instance); | |
| 34 | |
| 35 /// The copy constructor for <code>VideoWriter</code>. | |
| 36 /// | |
| 37 /// @param[in] other A reference to a <code>VideoWriter</code>. | |
| 38 VideoWriter(const VideoWriter& other); | |
| 39 | |
| 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. | |
| 42 /// | |
| 43 /// @param[in] resource A PP_Resource corresponding to a video writer. | |
| 44 VideoWriter(PassRef, PP_Resource resource); | |
| 45 | |
| 46 /// Opens a stream for writing video and associates it with the given id. | |
| 47 /// | |
| 48 /// @param[in] callback A <code>CompletionCallbackWithOutput</code> to be | |
| 49 /// called upon completion of Open which writes the stream id generated by | |
| 50 /// the host. | |
| 51 /// | |
| 52 /// @return A return code from <code>pp_errors.h</code>. | |
| 53 int32_t Open(const CompletionCallbackWithOutput<Var>& cc); | |
| 54 | |
| 55 /// Puts the next frame of video to the writer's stream. | |
| 56 /// | |
| 57 /// @param[in] frame A <code>VideoFrame</code> containing the frame to write | |
| 58 /// to the open stream. | |
| 59 /// | |
| 60 /// @return A return code from <code>pp_errors.h</code>. | |
| 61 int32_t PutFrame(const VideoFrame& frame); | |
| 62 | |
| 63 /// Closes the writer's current stream. | |
| 64 void Close(); | |
| 65 }; | |
| 66 | |
| 67 } // namespace pp | |
| 68 | |
| 69 #endif // PPAPI_CPP_VIDEO_WRITER_H_ | |
| OLD | NEW |