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

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: Rebase 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
« no previous file with comments | « native_client_sdk/src/libraries/ppapi/library.dsc ('k') | ppapi/api/ppb_media_stream_audio_track.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/ppb_audio_frame.idl
diff --git a/ppapi/api/ppb_video_frame.idl b/ppapi/api/ppb_audio_frame.idl
similarity index 44%
copy from ppapi/api/ppb_video_frame.idl
copy to ppapi/api/ppb_audio_frame.idl
index 1cb8336738edb84c7f348af6f1f5e59030a8d8f2..b0a2a47a30b806221b83b641ab520d80d7e757ca 100644
--- a/ppapi/api/ppb_video_frame.idl
+++ b/ppapi/api/ppb_audio_frame.idl
@@ -4,105 +4,81 @@
*/
/**
- * Defines the <code>PPB_VideoFrame</code> interface.
+ * Defines the <code>PPB_AudioFrame</code> interface.
*/
label Chrome {
[channel=dev] M34 = 0.1
};
-enum PP_VideoFrame_Format {
+interface PPB_AudioFrame {
/**
- * Unknown format value.
- */
- PP_VIDEOFRAME_FORMAT_UNKNOWN = 0,
-
- /**
- * 12bpp YVU planar 1x1 Y, 2x2 VU samples.
- */
- PP_VIDEOFRAME_FORMAT_YV12 = 1,
-
- /**
- * 16bpp YVU planar 1x1 Y, 2x1 VU samples.
- */
- PP_VIDEOFRAME_FORMAT_YV16 = 2,
-
- /**
- * 12bpp YVU planar 1x1 Y, 2x2 VU samples.
- */
- PP_VIDEOFRAME_FORMAT_I420 = 3,
-
- /**
- * 20bpp YVU planar 1x1 Y, 2x2 VU, 1x1 A samples.
- */
- PP_VIDEOFRAME_FORMAT_YV12A = 4,
-
- /**
- * JPEG color range version of YV12.
- */
- PP_VIDEOFRAME_FORMAT_YV12J = 5
-};
-
-interface PPB_VideoFrame {
- /**
- * Determines if a resource is a VideoFrame resource.
+ * 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 a VideoFrame resource or <code>PP_FALSE</code> otherwise.
+ * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise.
*/
- PP_Bool IsVideoFrame([in] PP_Resource resource);
+ PP_Bool IsAudioFrame([in] PP_Resource resource);
/**
- * Gets the timestamp of the video frame.
+ * Gets the timestamp of the audio frame.
*
- * @param[in] frame A <code>PP_Resource</code> corresponding to a video 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 video
- * frame. Given in seconds since the start of the containing video stream.
+ * @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 video frame. Given in seconds since the
- * start of the containing video stream.
+ * Sets the timestamp of the audio frame.
*
- * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
+ * @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 video frame. Given in seconds since the start of the containing
- * video stream.
+ * 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 format of the video frame.
+ * 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.
+ */
+ 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 a video frame
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
* resource.
*
- * @return A <code>PP_VideoFrame_Format</code> containing the format of the
- * video frame.
+ * @return The number of channels in the audio frame.
*/
- PP_VideoFrame_Format GetFormat([in] PP_Resource frame);
+ uint32_t GetNumberOfChannels([in] PP_Resource frame);
/**
- * Gets the size of the video frame.
+ * Gets the number of samples in the audio frame.
*
- * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
* resource.
- * @param[out] size A <code>PP_Size</code>.
*
- * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> on success or
- * <code>PP_FALSE</code> on failure.
+ * @return The number of samples in the audio frame.
+ * For example, at a sampling rate of 44,100 Hz in stereo audio, a frame
+ * containing 4410 * 2 samples would have a duration of 100 milliseconds.
*/
- PP_Bool GetSize([in] PP_Resource frame, [out] PP_Size size);
+ uint32_t GetNumberOfSamples([in] PP_Resource frame);
/**
- * Gets the data buffer for video frame pixels.
+ * Gets the data buffer containing the audio frame samples.
*
- * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
* resource.
*
* @return A pointer to the beginning of the data buffer.
@@ -110,12 +86,12 @@ interface PPB_VideoFrame {
mem_t GetDataBuffer([in] PP_Resource frame);
/**
- * Gets the size of data buffer.
+ * Gets the size of the data buffer in bytes.
*
- * @param[in] frame A <code>PP_Resource</code> corresponding to a video frame
+ * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
* resource.
*
- * @return The size of the data buffer.
+ * @return The size of the data buffer in bytes.
*/
uint32_t GetDataBufferSize([in] PP_Resource frame);
};
« no previous file with comments | « native_client_sdk/src/libraries/ppapi/library.dsc ('k') | ppapi/api/ppb_media_stream_audio_track.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698