Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: ppapi/api/ppb_audio_frame.idl

Issue 126373003: [PPAPI] API definition for audio media stream artifacts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_track_impl_cl
Patch Set: Update Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/api/ppb_audio_frame.idl
diff --git a/ppapi/api/ppb_audio_frame.idl b/ppapi/api/ppb_audio_frame.idl
new file mode 100644
index 0000000000000000000000000000000000000000..6c30945b49f0498eca1d9b177acf511772e82f26
--- /dev/null
+++ b/ppapi/api/ppb_audio_frame.idl
@@ -0,0 +1,99 @@
+/* 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 <code>PPB_AudioFrame</code> interface.
+ */
+label Chrome {
+ [channel=dev] M34 = 0.1
+};
+
+interface PPB_AudioFrame {
+ /**
+ * Determines if a resource is an AudioFrame resource.
+ *
+ * @param[in] resource The <code>PP_Resource</code> to test.
+ *
+ * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
+ * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise.
+ */
+ PP_Bool IsAudioFrame([in] PP_Resource resource);
+
+ /**
+ * Gets the timestamp of the audio frame.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio
+ * frame. Given in seconds since the start of the containing audio stream.
+ */
+ PP_TimeDelta GetTimestamp([in] PP_Resource frame);
+
+ /**
+ * Sets the timestamp of the audio frame. Given in seconds since the
+ * start of the containing audio stream.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
+ * of the audio frame. Given in seconds since the start of the containing
+ * audio stream.
+ */
+ void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp);
+
+ /**
+ * Gets the sample size of the audio frame.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return The sample size of the audio frame. It always returns 2 (16 bits)
+ * rignt now.
dmichael (off chromium) 2014/01/07 22:00:59 rignt->right
Peng 2014/01/07 22:29:27 Done.
+ */
+ uint32_t GetSampleSize([in] PP_Resource frame);
+
+ /**
+ * Gets the number of channels in the audio frame.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return The number of channles in the audio frame.
dmichael (off chromium) 2014/01/07 22:00:59 channles->channels
Peng 2014/01/07 22:29:27 Done.
+ */
+ uint32_t GetNumberOfChannels([in] PP_Resource frame);
+
+ /**
+ * Gets the number of samples in the audio frame.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return The number of samples in the audio frame.
+ * For 1 second sample rate 44100 stereo audio frame, the number of samples
dmichael (off chromium) 2014/01/07 22:00:59 This is kind of confusingly worded to me. I think
Peng 2014/01/07 22:29:27 Done.
+ * should be 1 * 44100 * 2.
+ */
+ uint32_t GetNumberOfSamples([in] PP_Resource frame);
+
+ /**
+ * Gets the data buffer for audio frame samples.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return A pointer to the beginning of the data buffer.
+ */
+ mem_t GetDataBuffer([in] PP_Resource frame);
+
+ /**
+ * Gets the size of data buffer.
dmichael (off chromium) 2014/01/07 22:00:59 of +the+ data buffer +in bytes+.
Peng 2014/01/07 22:29:27 Done.
+ *
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
+ * resource.
+ *
+ * @return The size of the data buffer in bytes.
+ */
+ uint32_t GetDataBufferSize([in] PP_Resource frame);
+};

Powered by Google App Engine
This is Rietveld 408576698