| Index: ppapi/c/ppb_video_writer.h
|
| diff --git a/ppapi/c/ppb_video_writer.h b/ppapi/c/ppb_video_writer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..afdb14c92c94d6fc5b6ea2f8581bcebe48018b59
|
| --- /dev/null
|
| +++ b/ppapi/c/ppb_video_writer.h
|
| @@ -0,0 +1,110 @@
|
| +/* 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.
|
| + */
|
| +
|
| +/* From ppb_video_writer.idl modified Mon Apr 1 17:19:47 2013. */
|
| +
|
| +#ifndef PPAPI_C_PPB_VIDEO_WRITER_H_
|
| +#define PPAPI_C_PPB_VIDEO_WRITER_H_
|
| +
|
| +#include "ppapi/c/pp_bool.h"
|
| +#include "ppapi/c/pp_completion_callback.h"
|
| +#include "ppapi/c/pp_instance.h"
|
| +#include "ppapi/c/pp_macros.h"
|
| +#include "ppapi/c/pp_resource.h"
|
| +#include "ppapi/c/pp_stdint.h"
|
| +#include "ppapi/c/pp_time.h"
|
| +#include "ppapi/c/pp_var.h"
|
| +#include "ppapi/c/pp_video_frame.h"
|
| +
|
| +#define PPB_VIDEOWRITER_INTERFACE_1_0 "PPB_VideoWriter;1.0"
|
| +#define PPB_VIDEOWRITER_INTERFACE PPB_VIDEOWRITER_INTERFACE_1_0
|
| +
|
| +/**
|
| + * @file
|
| + * This file defines the <code>PPB_VideoWriter</code> struct for a video writer
|
| + * resource.
|
| + */
|
| +
|
| +
|
| +/**
|
| + * @addtogroup Interfaces
|
| + * @{
|
| + */
|
| +/**
|
| + * 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.
|
| + */
|
| +struct PPB_VideoWriter_1_0 {
|
| + /**
|
| + * 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)(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)(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)(PP_Resource writer,
|
| + struct PP_Var stream_id,
|
| + struct 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)(PP_Resource writer);
|
| + /**
|
| + * 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)(PP_Resource writer, const struct PP_VideoFrame* frame);
|
| +};
|
| +
|
| +typedef struct PPB_VideoWriter_1_0 PPB_VideoWriter;
|
| +/**
|
| + * @}
|
| + */
|
| +
|
| +#endif /* PPAPI_C_PPB_VIDEO_WRITER_H_ */
|
| +
|
|
|