Pepper_47_C_interfaces
|
#include <ppb_audio_encoder.h>
Public Attributes | |
PP_Resource(* | Create )(PP_Instance instance) |
PP_Bool(* | IsAudioEncoder )(PP_Resource resource) |
int32_t(* | GetSupportedProfiles )(PP_Resource audio_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
int32_t(* | Initialize )(PP_Resource audio_encoder, uint32_t channels, PP_AudioBuffer_SampleRate input_sample_rate, PP_AudioBuffer_SampleSize input_sample_size, PP_AudioProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) |
int32_t(* | GetNumberOfSamples )(PP_Resource audio_encoder) |
int32_t(* | GetBuffer )(PP_Resource audio_encoder, PP_Resource *audio_buffer, struct PP_CompletionCallback callback) |
int32_t(* | Encode )(PP_Resource audio_encoder, PP_Resource audio_buffer, struct PP_CompletionCallback callback) |
int32_t(* | GetBitstreamBuffer )(PP_Resource audio_encoder, struct PP_AudioBitstreamBuffer *bitstream_buffer, struct PP_CompletionCallback callback) |
void(* | RecycleBitstreamBuffer )(PP_Resource audio_encoder, const struct PP_AudioBitstreamBuffer *bitstream_buffer) |
void(* | RequestBitrateChange )(PP_Resource audio_encoder, uint32_t bitrate) |
void(* | Close )(PP_Resource audio_encoder) |
Audio encoder interface.
Typical usage:
PPB_MediaStreamAudioTrack
.Available audio codecs vary by platform. All: opus.
Definition at line 54 of file ppb_audio_encoder.h.
void(* PPB_AudioEncoder_0_1::Close)(PP_Resource audio_encoder) |
Closes the audio 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 audio encoder closes it implicitly, so you are not required to call Close().
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
Definition at line 215 of file ppb_audio_encoder.h.
PP_Resource(* PPB_AudioEncoder_0_1::Create)(PP_Instance instance) |
Creates a new audio encoder resource.
[in] | instance | A PP_Instance identifying the instance with the audio encoder. |
PP_Resource
corresponding to an audio encoder if successful or 0 otherwise. Definition at line 64 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::Encode)(PP_Resource audio_encoder, PP_Resource audio_buffer, struct PP_CompletionCallback callback) |
Encodes an audio buffer.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[in] | audio_buffer | The PPB_AudioBuffer to be encoded. |
[in] | callback | A PP_CompletionCallback to be called upon completion. Plugins that pass PPB_AudioBuffer resources owned by other resources should wait for completion before reusing them. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Definition at line 162 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::GetBitstreamBuffer)(PP_Resource audio_encoder, struct PP_AudioBitstreamBuffer *bitstream_buffer, struct PP_CompletionCallback callback) |
Gets the next encoded bitstream buffer from the encoder.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[out] | bitstream_buffer | A PP_BitstreamBuffer containing encoded audio 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 181 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::GetBuffer)(PP_Resource audio_encoder, PP_Resource *audio_buffer, struct PP_CompletionCallback callback) |
Gets a blank audio buffer (with metadata given by the Initialize() call) which can be filled with audio data and passed to the encoder.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[out] | audio_buffer | A blank PPB_AudioBuffer 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 146 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::GetNumberOfSamples)(PP_Resource audio_encoder) |
Gets the number of audio samples per channel that audio buffers must contain in order to be processed by the encoder. This will be the number of samples per channels contained in buffers returned by GetBuffer().
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
pp_errors.h
. Returns PP_ERROR_FAILED if Initialize() has not successfully completed. Definition at line 132 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::GetSupportedProfiles)(PP_Resource audio_encoder, struct PP_ArrayOutput output, struct PP_CompletionCallback callback) |
Gets an array of supported audio encoder profiles. These can be used to choose a profile before calling Initialize().
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[in] | output | A PP_ArrayOutput to receive the supported PP_AudioProfileDescription structs. |
[in] | callback | A PP_CompletionCallback to be called upon completion. |
pp_errors.h
. Definition at line 89 of file ppb_audio_encoder.h.
int32_t(* PPB_AudioEncoder_0_1::Initialize)(PP_Resource audio_encoder, uint32_t channels, PP_AudioBuffer_SampleRate input_sample_rate, PP_AudioBuffer_SampleSize input_sample_size, PP_AudioProfile output_profile, uint32_t initial_bitrate, PP_HardwareAcceleration acceleration, struct PP_CompletionCallback callback) |
Initializes an audio encoder resource. The plugin should call Initialize() successfully before calling any of the functions below.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[in] | channels | The number of audio channels to encode. |
[in] | input_sampling_rate | The sampling rate of the input audio buffer. |
[in] | input_sample_size | The sample size of the input audio buffer. |
[in] | output_profile | A PP_AudioProfile specifying the codec profile of the encoded output stream. |
[in] | initial_bitrate | The initial bitrate for the encoder. |
[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 audio encoding is not available, or the requested codec profile is not supported. Definition at line 113 of file ppb_audio_encoder.h.
PP_Bool(* PPB_AudioEncoder_0_1::IsAudioEncoder)(PP_Resource resource) |
Determines if the given resource is an audio encoder.
[in] | resource | A PP_Resource identifying a resource. |
PP_TRUE
if the resource is a PPB_AudioEncoder
, PP_FALSE
if the resource is invalid or some other type. Definition at line 74 of file ppb_audio_encoder.h.
void(* PPB_AudioEncoder_0_1::RecycleBitstreamBuffer)(PP_Resource audio_encoder, const struct PP_AudioBitstreamBuffer *bitstream_buffer) |
Recycles a bitstream buffer back to the encoder.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[in] | bitstream_buffer | A PP_BitstreamBuffer that is no longer needed by the plugin. |
Definition at line 193 of file ppb_audio_encoder.h.
void(* PPB_AudioEncoder_0_1::RequestBitrateChange)(PP_Resource audio_encoder, uint32_t bitrate) |
Requests a change to the encoding bitrate. This is only a request, fulfilled on a best-effort basis.
[in] | audio_encoder | A PP_Resource identifying the audio encoder. |
[in] | bitrate | The requested new bitrate, in bits per second. |
Definition at line 204 of file ppb_audio_encoder.h.