From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- .../ppapi/api/ppb_media_stream_audio_track.idl | 201 +++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 chromium/ppapi/api/ppb_media_stream_audio_track.idl (limited to 'chromium/ppapi/api/ppb_media_stream_audio_track.idl') diff --git a/chromium/ppapi/api/ppb_media_stream_audio_track.idl b/chromium/ppapi/api/ppb_media_stream_audio_track.idl new file mode 100644 index 00000000000..4ffa9461aef --- /dev/null +++ b/chromium/ppapi/api/ppb_media_stream_audio_track.idl @@ -0,0 +1,201 @@ +/* Copyright 2014 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Defines the PPB_MediaStreamAudioTrack interface. Used for + * receiving audio samples from a MediaStream audio track in the browser. + */ + +[generate_thunk] + +label Chrome { + [channel=dev] M34 = 0.1, + M35 = 0.1 +}; + +/** + * This enumeration contains audio track attributes which are used by + * Configure(). + */ +enum PP_MediaStreamAudioTrack_Attrib { + /** + * Attribute list terminator. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE = 0, + + /** + * The maximum number of buffers to hold audio samples. + * Note: this is only used as advisory; the browser may allocate more or fewer + * based on available resources. How many buffers depends on usage - + * request at least 2 to make sure latency doesn't cause lost samples. If + * the plugin expects to hold on to more than one buffer at a time (e.g. to do + * multi-buffer processing), it should request that many more. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS = 1, + + /** + * The sample rate of audio data in buffers. The attribute value is a + * PP_AudioBuffer_SampleRate. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_RATE = 2, + + /** + * The sample size of audio data in buffers in bytes. The attribute value is a + * PP_AudioBuffer_SampleSize. + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_SAMPLE_SIZE = 3, + + /** + * The number of channels in audio buffers. + * + * Supported values: 1, 2 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_CHANNELS = 4, + + /** + * The duration of an audio buffer in milliseconds. + * + * Valid range: 10 to 10000 + */ + PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION = 5 +}; + +[version=0.1] +interface PPB_MediaStreamAudioTrack { + /** + * Determines if a resource is a MediaStream audio track resource. + * + * @param[in] resource The PP_Resource to test. + * + * @return A PP_Bool with PP_TRUE if the given + * resource is a Mediastream audio track resource or PP_FALSE + * otherwise. + */ + PP_Bool IsMediaStreamAudioTrack([in] PP_Resource resource); + + /** + * 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: + * @code + * int32_t attribs[] = { + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_BUFFERS, 4, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_DURATION, 10, + * PP_MEDIASTREAMAUDIOTRACK_ATTRIB_NONE}; + * track_if->Configure(track, attribs, callback); + * @endcode + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[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. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of Configure(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t Configure([in] PP_Resource audio_track, + [in] int32_t[] attrib_list, + [in] PP_CompletionCallback callback); + + /** + * Gets attribute value for a given attribute name. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] attrib A PP_MediaStreamAudioTrack_Attrib for + * querying. + * @param[out] value A int32_t for storing the attribute value on success. + * Otherwise, the value will not be changed. + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetAttrib([in] PP_Resource audio_track, + [in] PP_MediaStreamAudioTrack_Attrib attrib, + [out] int32_t value); + + /** + * Returns the track ID of the underlying MediaStream audio track. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Var containing the MediaStream track ID as + * a string. + */ + PP_Var GetId([in] 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. + * + * @param[in] audio_track The PP_Resource to check. + * + * @return A PP_Bool with PP_TRUE if the given + * MediaStream track has ended or PP_FALSE otherwise. + */ + [on_failure=PP_TRUE] + PP_Bool HasEnded([in] PP_Resource audio_track); + + /** + * 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. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[out] buffer A PP_Resource corresponding to + * an AudioBuffer resource. + * @param[in] callback A PP_CompletionCallback to be called upon + * completion of GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t GetBuffer([in] PP_Resource audio_track, + [out] PP_Resource buffer, + [in] PP_CompletionCallback callback); + + /** + * 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. + * + * @param[in] audio_track A PP_Resource corresponding to an audio + * resource. + * @param[in] buffer A PP_Resource corresponding to + * an AudioBuffer resource returned by GetBuffer(). + * + * @return An int32_t containing a result code from pp_errors.h. + */ + int32_t RecycleBuffer([in] PP_Resource audio_track, + [in] PP_Resource buffer); + + /** + * Closes the MediaStream audio track and disconnects it from the audio + * source. After calling Close(), no new buffers will be + * received. + * + * @param[in] audio_track A PP_Resource corresponding to a + * MediaStream audio track resource. + */ + void Close([in] PP_Resource audio_track); +}; + -- cgit v1.2.3