Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1237)

Unified Diff: ppapi/api/ppb_video_writer.idl

Issue 13461010: Add PP_VideoFrame, PPB_VideoReader, and PPB_VideoWriter APIs to Pepper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/api/ppb_video_writer.idl
diff --git a/ppapi/api/ppb_video_writer.idl b/ppapi/api/ppb_video_writer.idl
new file mode 100644
index 0000000000000000000000000000000000000000..9566d022d8cac7e84f710d7fd6a3ca2e615fad7c
--- /dev/null
+++ b/ppapi/api/ppb_video_writer.idl
@@ -0,0 +1,88 @@
+/* Copyright (c) 2013 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/**
+ * This file defines the <code>PPB_VideoWriter</code> struct for a video writer
+ * resource.
+ */
+
+ label Chrome {
+ M28 = 1.0
+ };
+
+/**
+ * The <code>PPB_VideoWriter</code> interface contains pointers to several
+ * functions for creating video writer resources and using them to generate
+ * streams of video frames.
+ */
+interface PPB_VideoWriter {
+ /**
+ * Creates a video writer resource.
+ *
+ * @param[in] instance A <code>PP_Instance</code> identifying one instance
+ * of a module.
+ *
+ * @return A <code>PP_Resource</code> with a nonzero ID on success or zero on
+ * failure. Failure means the instance was invalid.
+ */
+ PP_Resource Create([in] PP_Instance instance);
+
+ /**
+ * Determines if a given resource is a video writer.
+ *
+ * @param[in] resource A <code>PP_Resource</code> corresponding to a resource.
+ *
+ * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
+ * resource is a video writer or <code>PP_FALSE</code> otherwise.
+ */
+ PP_Bool IsVideoWriter([in] PP_Resource resource);
+
+ /**
+ * Opens a video stream with the given id for writing.
+ *
+ * @param[in] writer A <code>PP_Resource</code> corresponding to a video
+ * writer resource.
+ * @param[in] stream_id A <code>PP_Var</code> holding a string uniquely
+ * identifying the stream.
+ * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
+ * completion of Open().
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ * Returns PP_ERROR_BADRESOURCE if writer isn't a valid video writer.
+ * Returns PP_ERROR_INPROGRESS if the writer has already opened a stream.
+ */
+ int32_t Open([in] PP_Resource writer,
+ [in] PP_Var stream_id,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Closes the writer's video stream.
+ *
+ * @param[in] writer A <code>PP_Resource</code> corresponding to a video
+ * writer resource.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ * Returns PP_ERROR_BADRESOURCE if writer isn't a valid video writer.
+ * Returns PP_ERROR_FAILED if the writer has not opened a stream.
+ */
+ int32_t Close([in] PP_Resource writer);
yzshen1 2013/04/02 19:28:39 Please see my comments of Close() in ppb_video_rea
bbudge 2013/04/02 20:07:34 Done.
+
+ /**
+ * Emits a frame of video to the writer's open stream.
+ *
+ * @param[in] writer A <code>PP_Resource</code> corresponding to a video
+ * writer resource.
+ * @param[in] frame A <code>PP_VideoFrame</code> holding a video frame to
+ * write to the open stream.
+ *
+ * @return An int32_t containing an error code from <code>pp_errors.h</code>.
+ * Returns PP_ERROR_BADRESOURCE if writer isn't a valid video writer.
+ * Returns PP_ERROR_FAILED if the writer has not opened a stream or if the
+ * video frame has an invalid image data resource.
+ */
+ int32_t EmitFrame([in] PP_Resource writer,
darin1 2013/04/02 18:08:38 bikeshed-nit: What do you think about calling this
bbudge 2013/04/02 20:07:34 I think it helps to understand how the two APIs in
+ [in] PP_VideoFrame frame);
+};
+

Powered by Google App Engine
This is Rietveld 408576698