Native Client

Pepper C API


The Pepper Plug-in API (PPAPI) lets Native Client modules communicate with the hosting browser and access system-level functions in a safe and portable way. For a brief description of Pepper see the Technical Overview.

Pepper has both a C API and a C++ API. These APIs are generally divided into two parts: functions that are implemented in the browser and that you call from your Native Client module, and functions that the browser invokes and that you must implement in your Native Client module.

To develop a Native Client module using a specific version of Pepper, you must download and use the corresponding SDK bundle. For example, to use Pepper 20 you must download and use the pepper_20 SDK bundle. Native Client modules compiled using a particular Pepper version will generally work in corresponding versions of Chrome and higher. For example, a module compiled using Pepper 20 will work in Chrome 20 and higher.

The reference documentation on this site includes both the C and C++ APIs for the most recent versions of Pepper. Before you read the reference documentation, we recommend that you read the Technical Overview and the Getting Started Tutorial.

Pepper 20

The Pepper 20 bundle/platform includes the Pepper MouseCursor API, which can be used to modify the mouse cursor, and a new example, file_histogram, which demonstrates how to enable a user to provide one or more local files to a Native Client application.

For additional information about Pepper 20, see the SDK release notes.

Pepper C API

The lowest level of Pepper is the C API, declared in the header files in include/ppapi/c. The C API represents the lowest level binary interface between a Native Client module and the browser.

C API Groupings

The C API is divided into three sub-groupings, indicated by the prefixes PP, PPB, and PPP.

  • The prefix PP, used to help prevent naming collisions, stands for "Pepper Plug-in" (also known as the Native Client module). Common structs have a PP_ prefix, such as PP_Var for representing a JavaScript variable, or PP_Rect for describing a rectangle. There are also several utility functions in the PP_ grouping.
  • Interfaces in the C API are named according to whether they are implemented by the browser, or by you (the web app developer) in the Native Client module. Interfaces implemented by the browser are prefixed by PPB, where "B" stands for browser. For example, the PPB_Core interface is a collection of core interfaces implemented by the browser and accessed by the Native Client module.
  • Interfaces implemented by the Native Client module (plug-in) are prefixed by PPP, where "P" stands for plug-in. For example, the PPP_InputEvent interface defines how a Native Client module reacts to input events such as a key press. You implement PPP interfaces in your Native Client module.

In some cases, there might be both a browser and a Native Client module interface for the same concept. For example, the PPP_Instance interface represents the Native Client module functions that the browser calls related to a certain instance. The Native Client module also calls PPB_Instance functions in the browser to manipulate its instance.

Click the links below "Pepper C API" in the left navbar to view the C API by construct (all interfaces, structures, functions, etc.), by functional area (all APIs pertaining to audio, 2D graphics, 3D graphics, etc.), or by file (all APIs in pp_bool.h, ppp.h, ppb_var.h, etc.).

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.