/** * Create() allocates an image data resource with the given format and size. * * For security reasons, if uninitialized, the bitmap will not contain random * memory, but may contain data from a previous image produced by the same * module if the bitmap was cached and re-used. * * @param[in] instance A <code>PP_Instance</code> identifying one instance * of a module. * @param[in] format The desired image data format. * @param[in] size A pointer to a <code>PP_Size</code> containing the image * size. * @param[in] init_to_zero A <code>PP_Bool</code> to determine transparency * at creation. * Set the <code>init_to_zero</code> flag if you want the bitmap initialized * to transparent during the creation process. If this flag is not set, the * current contents of the bitmap will be undefined, and the module should * be sure to set all the pixels. * * @return A <code>PP_Resource</code> with a nonzero ID on success or zero on * failure. Failure means the instance, image size, or format was invalid. */ public static PPResource Create(PPInstance instance, PPImageDataFormat format, PPSize size, PPBool init_to_zero) { return(_Create(instance, format, size, init_to_zero)); }
/** * Encodes a video frame. * * @param[in] video_encoder A <code>PP_Resource</code> identifying the video * encoder. * @param[in] video_frame The <code>PPB_VideoFrame</code> to be encoded. * @param[in] force_keyframe A <code>PP_Bool> specifying whether the encoder * should emit a key frame for this video frame. * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon * completion. Plugins that pass <code>PPB_VideoFrame</code> resources owned * by other resources should wait for completion before reusing them. * * @return An int32_t containing an error code from <code>pp_errors.h</code>. * Returns PP_ERROR_FAILED if Initialize() has not successfully completed. */ public static int Encode(PPResource video_encoder, PPResource video_frame, PPBool force_keyframe, PPCompletionCallback callback) { return(_Encode(video_encoder, video_frame, force_keyframe, callback)); }
extern static PPResource _Create(PPInstance instance, PPImageDataFormat format, PPSize size, PPBool init_to_zero);
/** * SetFullscreen() switches the module instance to and from fullscreen * mode. * * The transition to and from fullscreen mode is asynchronous. During the * transition, IsFullscreen() will return the previous value and * no 2D or 3D device can be bound. The transition ends at DidChangeView() * when IsFullscreen() returns the new value. You might receive other * DidChangeView() calls while in transition. * * The transition to fullscreen mode can only occur while the browser is * processing a user gesture, even if <code>PP_TRUE</code> is returned. * * @param[in] instance A <code>PP_Instance</code> identifying one instance * of a module. * @param[in] fullscreen <code>PP_TRUE</code> to enter fullscreen mode, or * <code>PP_FALSE</code> to exit fullscreen mode. * * @return <code>PP_TRUE</code> on success or <code>PP_FALSE</code> on * failure. */ public static PPBool SetFullscreen(PPInstance instance, PPBool fullscreen) { return(_SetFullscreen(instance, fullscreen)); }
extern static PPBool _SetFullscreen(PPInstance instance, PPBool fullscreen);
/** * Posts a quit message to the given message loop's work queue. Work posted * before that point will be processed before quitting. * * This may be called on the message loop registered for the current thread, * or it may be called on the message loop registered for another thread. It * is an error to attempt to PostQuit() the main thread loop. * * @param should_destroy Marks the message loop as being in a destroyed state * and prevents further posting of messages. * * If you quit a message loop without setting should_destroy, it will still * be attached to the thread and you can still run it again by calling Run() * again. If you destroy it, it will be detached from the current thread. * * @return * - PP_OK: The request to quit was successfully posted. * - PP_ERROR_BADRESOURCE: The message loop was invalid. * - PP_ERROR_WRONG_THREAD: You are attempting to quit the main thread. * The main thread's message loop is managed by the system and can't be * quit. */ public static int PostQuit(PPResource message_loop, PPBool should_destroy) { return(_PostQuit(message_loop, should_destroy)); }
extern static int _PostQuit(PPResource message_loop, PPBool should_destroy);
/** * Describe() retrieves the configuration for the given graphics context, * filling the given values (which must not be <code>NULL</code>). * * @param[in] resource The 2D Graphics resource. * @param[in,out] size The size of the 2D graphics context in the browser. * @param[in,out] is_always_opaque Identifies whether only opaque data * will be painted. * * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if * the resource is invalid. The output parameters will be set to 0 on a * <code>PP_FALSE</code>. */ public static PPBool Describe(PPResource graphics_2d, out PPSize size, out PPBool is_always_opaque) { return(_Describe(graphics_2d, out size, out is_always_opaque)); }
extern static PPBool _Describe(PPResource graphics_2d, out PPSize size, out PPBool is_always_opaque);
/** * Create() creates a 2D graphics context. The returned graphics context will * not be bound to the module instance on creation (call BindGraphics() on * the module instance to bind the returned graphics context to the module * instance). * * @param[in] instance The module instance. * @param[in] size The size of the graphic context. * @param[in] is_always_opaque Set the <code>is_always_opaque</code> flag to * <code>PP_TRUE</code> if you know that you will be painting only opaque * data to this context. This option will disable blending when compositing * the module with the web page, which might give higher performance on some * computers. * * If you set <code>is_always_opaque</code>, your alpha channel should always * be set to 0xFF or there may be painting artifacts. The alpha values * overwrite the destination alpha values without blending when * <code>is_always_opaque</code> is true. * * @return A <code>PP_Resource</code> containing the 2D graphics context if * successful or 0 if unsuccessful. */ public static PPResource Create(PPInstance instance, PPSize size, PPBool is_always_opaque) { return(_Create(instance, size, is_always_opaque)); }
extern static PPResource _Create(PPInstance instance, PPSize size, PPBool is_always_opaque);
/** * Returns a human-readable description of the network address. The * description is in the form of host [ ":" port ] and conforms to * http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses * (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"). * * @param[in] addr A <code>PP_Resource</code> corresponding to a network * address. * @param[in] include_port Whether to include the port number in the * description. * * @return A string <code>PP_Var</code> on success; an undefined * <code>PP_Var</code> on failure. */ public static PPVar DescribeAsString(PPResource addr, PPBool include_port) { return(_DescribeAsString(addr, include_port)); }
extern static PPVar _DescribeAsString(PPResource addr, PPBool include_port);
extern static int _Encode(PPResource video_encoder, PPResource video_frame, PPBool force_keyframe, PPCompletionCallback callback);