Pepper_47_C_interfaces
|
#include <ppb_video_encoder.h>
Public Attributes | |
PP_Resource(* | Create )(PP_Instance instance) |
PP_Bool(* | IsVideoEncoder )(PP_Resource resource) |
int32_t(* | GetSupportedProfiles )(PP_Resource video_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
int32_t(* | Initialize )(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size *input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) |
int32_t(* | GetFramesRequired )(PP_Resource video_encoder) |
int32_t(* | GetFrameCodedSize )(PP_Resource video_encoder, struct PP_Size *coded_size) |
int32_t(* | GetVideoFrame )(PP_Resource video_encoder, PP_Resource *video_frame, struct PP_CompletionCallback callback) |
int32_t(* | Encode )(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback callback) |
int32_t(* | GetBitstreamBuffer )(PP_Resource video_encoder, struct PP_BitstreamBuffer *bitstream_buffer, struct PP_CompletionCallback callback) |
void(* | RecycleBitstreamBuffer )(PP_Resource video_encoder, const struct PP_BitstreamBuffer *bitstream_buffer) |
void(* | RequestEncodingParametersChange )(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate) |
void(* | Close )(PP_Resource video_encoder) |
Video encoder interface.
Typical usage:
PPB_MediaStreamVideoTrack
.Available video codecs vary by platform. All: vp8 (software). ChromeOS, depending on your device: h264 (hardware), vp8 (hardware)
Definition at line 59 of file ppb_video_encoder.h.
void(* PPB_VideoEncoder_0_2::Close)(PP_Resource video_encoder) |
Closes the video encoder, and cancels any pending encodes. Any pending callbacks will still run, reporting PP_ERROR_ABORTED
. It is not valid to call any encoder functions after a call to this method. Note: Destroying the video encoder closes it implicitly, so you are not required to call Close().
[in] | video_encoder | A PP_Resource identifying the video encoder. |
Definition at line 238 of file ppb_video_encoder.h.
PP_Resource(* PPB_VideoEncoder_0_2::Create)(PP_Instance instance) |
Creates a new video encoder resource.
[in] | instance | A PP_Instance identifying the instance with the video encoder. |
PP_Resource
corresponding to a video encoder if successful or 0 otherwise. Definition at line 69 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::Encode)(PP_Resource video_encoder, PP_Resource video_frame, PP_Bool force_keyframe, struct PP_CompletionCallback callback) |
Encodes a video frame.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | video_frame | The PPB_VideoFrame to be encoded. |
[in] | force_keyframe | A PP_Bool> specifying whether the encoder should emit a key frame for this video frame. |
[in] | callback | A |
An int32_t containing an error code from pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed.
Definition at line 182 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::GetBitstreamBuffer)(PP_Resource video_encoder, struct PP_BitstreamBuffer *bitstream_buffer, struct PP_CompletionCallback callback) |
Gets the next encoded bitstream buffer from the encoder.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[out] | bitstream_buffer | A PP_BitstreamBuffer containing encoded video data. |
[in] | callback | A PP_CompletionCallback to be called upon completion. The plugin can call GetBitstreamBuffer from the callback in order to continuously "pull" bitstream buffers from the encoder. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Returns PP_ERROR_INPROGRESS if a prior call to GetBitstreamBuffer() has not completed. Definition at line 202 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::GetFrameCodedSize)(PP_Resource video_encoder, struct PP_Size *coded_size) |
Gets the coded size of the video frames required by the encoder. Coded size is the logical size of the input frames, in pixels. The encoder may have hardware alignment requirements that make this different from |input_visible_size|, as requested in the call to Initialize().
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | coded_size | A PP_Size to hold the coded size. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Definition at line 149 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::GetFramesRequired)(PP_Resource video_encoder) |
Gets the number of input video frames that the encoder may hold while encoding. If the plugin is providing the video frames, it should have at least this many available.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Definition at line 136 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::GetSupportedProfiles)(PP_Resource video_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
Gets an array of supported video encoder profiles. These can be used to choose a profile before calling Initialize().
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | output | A PP_ArrayOutput to receive the supported PP_VideoProfileDescription structs. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Definition at line 94 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::GetVideoFrame)(PP_Resource video_encoder, PP_Resource *video_frame, struct PP_CompletionCallback callback) |
Gets a blank video frame which can be filled with video data and passed to the encoder.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[out] | video_frame | A blank PPB_VideoFrame resource. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Definition at line 164 of file ppb_video_encoder.h.
int32_t(* PPB_VideoEncoder_0_2::Initialize)(PP_Resource video_encoder, PP_VideoFrame_Format input_format, const struct PP_Size *input_visible_size, PP_VideoProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) |
Initializes a video encoder resource. The plugin should call Initialize() successfully before calling any of the functions below.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | input_format | The PP_VideoFrame_Format of the frames which will be encoded. |
[in] | input_visible_size | A PP_Size specifying the dimensions of the visible part of the input frames. |
[in] | output_profile | A PP_VideoProfile specifying the codec profile of the encoded output stream. |
[in] | acceleration | A PP_HardwareAcceleration specifying whether to use a hardware accelerated or a software implementation. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Returns PP_ERROR_NOTSUPPORTED if video encoding is not available, or the requested codec profile is not supported. Definition at line 118 of file ppb_video_encoder.h.
PP_Bool(* PPB_VideoEncoder_0_2::IsVideoEncoder)(PP_Resource resource) |
Determines if the given resource is a video encoder.
[in] | resource | A PP_Resource identifying a resource. |
PP_TRUE
if the resource is a PPB_VideoEncoder
, PP_FALSE
if the resource is invalid or some other type. Definition at line 79 of file ppb_video_encoder.h.
void(* PPB_VideoEncoder_0_2::RecycleBitstreamBuffer)(PP_Resource video_encoder, const struct PP_BitstreamBuffer *bitstream_buffer) |
Recycles a bitstream buffer back to the encoder.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | bitstream_buffer | A PP_BitstreamBuffer that is no longer needed by the plugin. |
Definition at line 213 of file ppb_video_encoder.h.
void(* PPB_VideoEncoder_0_2::RequestEncodingParametersChange)(PP_Resource video_encoder, uint32_t bitrate, uint32_t framerate) |
Requests a change to encoding parameters. This is only a request, fulfilled on a best-effort basis.
[in] | video_encoder | A PP_Resource identifying the video encoder. |
[in] | bitrate | The requested new bitrate, in bits per second. |
[in] | framerate | The requested new framerate, in frames per second. |
Definition at line 225 of file ppb_video_encoder.h.