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] stream_id A string uniquely identifying the stream to write to. |
| 49 /// @param[in] callback A <code>CompletionCallback</code> to be called upon |
| 50 /// completion of Open. |
| 51 /// |
| 52 /// @return A return code from <code>pp_errors.h</code>. |
| 53 int32_t Open(const std::string& stream_id, |
| 54 const CompletionCallback& cc); |
| 55 |
| 56 /// Puts the next frame of video to the writer's stream. |
| 57 /// |
| 58 /// @param[in] frame A <code>VideoFrame</code> containing the frame to write |
| 59 /// to the open stream. |
| 60 /// |
| 61 /// @return A return code from <code>pp_errors.h</code>. |
| 62 int32_t PutFrame(const VideoFrame& frame); |
| 63 |
| 64 /// Closes the writer's current stream. |
| 65 void Close(); |
| 66 }; |
| 67 |
| 68 } // namespace pp |
| 69 |
| 70 #endif // PPAPI_CPP_VIDEO_WRITER_H_ |
OLD | NEW |