Pepper_47_C_interfaces
Public Attributes | List of all members
PPB_MediaStreamAudioTrack_0_1 Struct Reference

#include <ppb_media_stream_audio_track.h>

Collaboration diagram for PPB_MediaStreamAudioTrack_0_1:
Collaboration graph

Public Attributes

PP_Bool(* IsMediaStreamAudioTrack )(PP_Resource resource)
 
int32_t(* Configure )(PP_Resource audio_track, const int32_t attrib_list[], struct PP_CompletionCallback callback)
 
int32_t(* GetAttrib )(PP_Resource audio_track, PP_MediaStreamAudioTrack_Attrib attrib, int32_t *value)
 
struct PP_Var(* GetId )(PP_Resource audio_track)
 
PP_Bool(* HasEnded )(PP_Resource audio_track)
 
int32_t(* GetBuffer )(PP_Resource audio_track, PP_Resource *buffer, struct PP_CompletionCallback callback)
 
int32_t(* RecycleBuffer )(PP_Resource audio_track, PP_Resource buffer)
 
void(* Close )(PP_Resource audio_track)
 

Detailed Description

Definition at line 82 of file ppb_media_stream_audio_track.h.

Member Data Documentation

void(* PPB_MediaStreamAudioTrack_0_1::Close)(PP_Resource audio_track)

Closes the MediaStream audio track and disconnects it from the audio source. After calling Close(), no new buffers will be received.

Parameters
[in]audio_trackA PP_Resource corresponding to a MediaStream audio track resource.

Definition at line 206 of file ppb_media_stream_audio_track.h.

int32_t(* PPB_MediaStreamAudioTrack_0_1::Configure)(PP_Resource audio_track, const int32_t attrib_list[], struct PP_CompletionCallback callback)

Configures underlying buffers for incoming audio samples. If the application doesn't want to drop samples, then the PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS should be chosen such that inter-buffer processing time variability won't overrun all the input buffers. If all buffers are filled, then samples will be dropped. The application can detect this by examining the timestamp on returned buffers. If Configure() is not called, default settings will be used. Calls to Configure while the plugin holds buffers will fail. Example usage from plugin code:

int32_t attribs[] = {
track_if->Configure(track, attribs, callback);
Parameters
[in]audio_trackA PP_Resource corresponding to an audio resource.
[in]attrib_listA list of attribute name-value pairs in which each attribute is immediately followed by the corresponding desired value. The list is terminated by PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE.
[in]callbackA PP_CompletionCallback to be called upon completion of Configure().
Returns
An int32_t containing a result code from pp_errors.h.

Definition at line 123 of file ppb_media_stream_audio_track.h.

int32_t(* PPB_MediaStreamAudioTrack_0_1::GetAttrib)(PP_Resource audio_track, PP_MediaStreamAudioTrack_Attrib attrib, int32_t *value)

Gets attribute value for a given attribute name.

Parameters
[in]audio_trackA PP_Resource corresponding to an audio resource.
[in]attribA PP_MediaStreamAudioTrack_Attrib for querying.
[out]valueA int32_t for storing the attribute value on success. Otherwise, the value will not be changed.
Returns
An int32_t containing a result code from pp_errors.h.

Definition at line 138 of file ppb_media_stream_audio_track.h.

int32_t(* PPB_MediaStreamAudioTrack_0_1::GetBuffer)(PP_Resource audio_track, PP_Resource *buffer, struct PP_CompletionCallback callback)

Gets the next audio buffer from the MediaStream track. If internal processing is slower than the incoming buffer rate, new buffers will be dropped from the incoming stream. Once all buffers are full, audio samples will be dropped until RecycleBuffer() is called to free a slot for another buffer. If there are no audio data in the input buffer, PP_OK_COMPLETIONPENDING will be returned immediately and the callback will be called, when a new buffer of audio samples is received or an error happens.

Parameters
[in]audio_trackA PP_Resource corresponding to an audio resource.
[out]bufferA PP_Resource corresponding to an AudioBuffer resource.
[in]callbackA PP_CompletionCallback to be called upon completion of GetBuffer().
Returns
An int32_t containing a result code from pp_errors.h.

Definition at line 181 of file ppb_media_stream_audio_track.h.

struct PP_Var(* PPB_MediaStreamAudioTrack_0_1::GetId)(PP_Resource audio_track)

Returns the track ID of the underlying MediaStream audio track.

Parameters
[in]audio_trackThe PP_Resource to check.
Returns
A PP_Var containing the MediaStream track ID as a string.

Definition at line 149 of file ppb_media_stream_audio_track.h.

PP_Bool(* PPB_MediaStreamAudioTrack_0_1::HasEnded)(PP_Resource audio_track)

Checks whether the underlying MediaStream track has ended. Calls to GetBuffer while the track has ended are safe to make and will complete, but will fail.

Parameters
[in]audio_trackThe PP_Resource to check.
Returns
A PP_Bool with PP_TRUE if the given MediaStream track has ended or PP_FALSE otherwise.

Definition at line 160 of file ppb_media_stream_audio_track.h.

PP_Bool(* PPB_MediaStreamAudioTrack_0_1::IsMediaStreamAudioTrack)(PP_Resource resource)

Determines if a resource is a MediaStream audio track resource.

Parameters
[in]resourceThe PP_Resource to test.
Returns
A PP_Bool with PP_TRUE if the given resource is a Mediastream audio track resource or PP_FALSE otherwise.

Definition at line 92 of file ppb_media_stream_audio_track.h.

int32_t(* PPB_MediaStreamAudioTrack_0_1::RecycleBuffer)(PP_Resource audio_track, PP_Resource buffer)

Recycles a buffer returned by GetBuffer(), so the track can reuse the buffer. And the buffer will become invalid. The caller should release all references it holds to buffer and not use it anymore.

Parameters
[in]audio_trackA PP_Resource corresponding to an audio resource.
[in]bufferA PP_Resource corresponding to an AudioBuffer resource returned by GetBuffer().
Returns
An int32_t containing a result code from pp_errors.h.

Definition at line 197 of file ppb_media_stream_audio_track.h.


The documentation for this struct was generated from the following file: