Index: ppapi/cpp/private/video_source_private.h |
diff --git a/ppapi/cpp/video_reader.h b/ppapi/cpp/private/video_source_private.h |
similarity index 28% |
rename from ppapi/cpp/video_reader.h |
rename to ppapi/cpp/private/video_source_private.h |
index 57e85a5c8f9dff9c53fdf35224378f8fab263364..3d919bfd9ede9e6e03ed10b8eec7bfc55a4cf194 100644 |
--- a/ppapi/cpp/video_reader.h |
+++ b/ppapi/cpp/private/video_source_private.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef PPAPI_CPP_VIDEO_READER_H_ |
-#define PPAPI_CPP_VIDEO_READER_H_ |
+#ifndef PPAPI_CPP_PRIVATE_VIDEO_SOURCE_PRIVATE_H_ |
+#define PPAPI_CPP_PRIVATE_VIDEO_SOURCE_PRIVATE_H_ |
#include <string> |
@@ -13,58 +13,72 @@ |
#include "ppapi/cpp/resource.h" |
/// @file |
-/// This file defines the API to create and use video stream readers. |
+/// This file defines the <code>PPB_VideoSource_Private</code> interface for a |
+/// video source resource, which receives video frames from a MediaStream video |
+/// track in the browser. |
namespace pp { |
class InstanceHandle; |
-class VideoFrame; |
+class VideoFrame_Private; |
-// VideoReader ----------------------------------------------------------------- |
- |
-/// The <code>VideoReader</code> class represents a video reader resource. |
-class VideoReader : public Resource { |
+/// The <code>VideoSource_Private</code> class contains methods for creating |
+/// video source resources and using them to receive video frames from a |
+/// MediaStream video track in the browser. |
+class VideoSource_Private : public Resource { |
public: |
- /// Default constructor for creating a <code>VideoReader</code> object. |
- VideoReader(); |
+ /// Default constructor for creating a <code>VideoSource_Private</code> |
+ /// object. |
+ VideoSource_Private(); |
- /// Constructor for creating a <code>VideoReader</code> for an instance. |
- explicit VideoReader(const InstanceHandle& instance); |
+ /// Constructor for creating a <code>VideoSource_Private</code> for an |
+ /// instance. |
+ explicit VideoSource_Private(const InstanceHandle& instance); |
- /// The copy constructor for <code>VideoReader</code>. |
+ /// The copy constructor for <code>VideoSource_Private</code>. |
/// |
- /// @param[in] other A reference to a <code>VideoReader</code>. |
- VideoReader(const VideoReader& other); |
+ /// @param[in] other A reference to a <code>VideoSource_Private</code>. |
+ VideoSource_Private(const VideoSource_Private& other); |
/// A constructor used when you have received a PP_Resource as a return |
/// value that has had its reference count incremented for you. |
/// |
- /// @param[in] resource A PP_Resource corresponding to a video reader. |
- VideoReader(PassRef, PP_Resource resource); |
+ /// @param[in] resource A PP_Resource corresponding to a video source. |
+ VideoSource_Private(PassRef, PP_Resource resource); |
- /// Opens a stream for reading video and associates it with the given id. |
+ /// Opens a video source for getting frames. |
/// |
- /// @param[in] stream_id A <code>Var</code> uniquely identifying the stream |
- /// to read from. |
+ /// @param[in] stream_url A <code>Var</code> string holding a URL identifying |
+ /// a MediaStream. |
/// @param[in] callback A <code>CompletionCallback</code> to be called upon |
- /// completion of Open. |
+ /// completion of Open(). |
/// |
- /// @return A return code from <code>pp_errors.h</code>. |
- int32_t Open(const Var& stream_id, |
+ /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
+ /// Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. |
+ /// Returns PP_ERROR_INPROGRESS if source is already open. |
+ /// Returns PP_ERROR_FAILED if the MediaStream doesn't exist or if there is |
+ /// some other browser error. |
+ int32_t Open(const Var& stream_url, |
const CompletionCallback& cc); |
- /// Gets the next frame of video from the reader's stream. |
+ /// Gets a frame from the video source. |
/// |
+ /// @param[out] frame A <code>VideoFrame_Private</code> to hold a video |
+ /// frame from the source. |
/// @param[in] callback A <code>CompletionCallbackWithOutput</code> to be |
- /// called upon completion of GetNextFrame. |
+ /// called upon completion of ReceiveFrame(). |
/// |
- /// @return A return code from <code>pp_errors.h</code>. |
- int32_t GetFrame(const CompletionCallbackWithOutput<VideoFrame>& cc); |
- |
- /// Closes the reader's current stream. |
+ /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
+ /// Returns PP_ERROR_BADRESOURCE if source isn't a valid video source. |
+ /// Returns PP_ERROR_FAILED if the source is not open, or if some other |
+ /// browser error occurs. |
+ int32_t GetFrame( |
+ const CompletionCallbackWithOutput<VideoFrame_Private>& cc); |
+ |
+ /// Closes the video source. |
void Close(); |
}; |
} // namespace pp |
-#endif // PPAPI_CPP_VIDEO_READER_H_ |
+#endif // PPAPI_CPP_PRIVATE_VIDEO_SOURCE_PRIVATE_H_ |