Data Fields
Field Documentation
Closes the MediaStream audio track and disconnects it from the audio source.
After calling Close()
, no new frames will be received.
- Parameters:
-
[in] | audio_track | A PP_Resource corresponding to a MediaStream audio track resource. |
Configures underlying frame buffers for incoming frames.
If the application doesn't want to drop frames, then the PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERED_FRAMES
should be chosen such that inter-frame processing time variability won't overrun the input buffer. If the buffer is overfilled, then frames will be dropped. The application can detect this by examining the timestamp on returned frames. If Configure()
is not called, default settings will be used. Example usage from plugin code:
- Parameters:
-
[in] | audio_track | A PP_Resource corresponding to an audio resource. |
[in] | attrib_list | A 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] | callback | A PP_CompletionCallback to be called upon completion of Configure() . |
- Returns:
- An int32_t containing a result code from
pp_errors.h
.
Gets attribute value for a given attribute name.
- Parameters:
-
[in] | audio_track | A PP_Resource corresponding to an audio resource. |
[in] | attrib | A PP_MediaStreamAudioTrack_Attrib for querying. |
[out] | value | A 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
.
Gets the next audio frame from the MediaStream track.
If internal processing is slower than the incoming frame rate, new frames will be dropped from the incoming stream. Once the input buffer is full, frames will be dropped until RecycleFrame()
is called to free a spot for another frame to be buffered. If there are no frames in the input buffer, PP_OK_COMPLETIONPENDING
will be returned immediately and the callback
will be called, when a new frame is received or an error happens.
- Parameters:
-
[in] | audio_track | A PP_Resource corresponding to an audio resource. |
[out] | frame | A PP_Resource corresponding to an AudioFrame resource. |
[in] | callback | A PP_CompletionCallback to be called upon completion of GetFrame(). |
- Returns:
- An int32_t containing a result code from
pp_errors.h
. Returns PP_ERROR_NOMEMORY if max_buffered_frames
frames buffer was not allocated successfully.
Returns the track ID of the underlying MediaStream audio track.
- Parameters:
-
[in] | audio_track | The PP_Resource to check. |
- Returns:
- A
PP_Var
containing the MediaStream track ID as a string.
Checks whether the underlying MediaStream track has ended.
Calls to GetFrame while the track has ended are safe to make and will complete, but will fail.
- Parameters:
-
[in] | audio_track | The PP_Resource to check. |
- Returns:
- A
PP_Bool
with PP_TRUE
if the given MediaStream track has ended or PP_FALSE
otherwise.
Determines if a resource is a MediaStream audio track resource.
- Parameters:
-
[in] | resource | The 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.
Recycles a frame returned by GetFrame()
, so the track can reuse the underlying buffer of this frame.
And the frame will become invalid. The caller should release all references it holds to frame
and not use it anymore.
- Parameters:
-
[in] | audio_track | A PP_Resource corresponding to an audio resource. |
[in] | frame | A PP_Resource corresponding to an AudioFrame resource returned by GetFrame() . |
- Returns:
- An int32_t containing a result code from
pp_errors.h
.
The documentation for this struct was generated from the following file: