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

Unified Diff: ppapi/shared_impl/media_stream_frame.h

Issue 140783004: [PPAPI] Pepper MediaStream API audio track implementation and example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/shared_impl/media_stream_frame.h
diff --git a/ppapi/shared_impl/media_stream_frame.h b/ppapi/shared_impl/media_stream_frame.h
index b3ec8bb213f93fbcef2c0323367ac5968f8282ba..72eeef937040d2013e9a18ab109a0ebb940ad127 100644
--- a/ppapi/shared_impl/media_stream_frame.h
+++ b/ppapi/shared_impl/media_stream_frame.h
@@ -5,6 +5,7 @@
#ifndef PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
#define PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
+#include "ppapi/c/ppb_audio_frame.h"
#include "ppapi/c/ppb_video_frame.h"
namespace ppapi {
@@ -23,7 +24,14 @@ union MediaStreamFrame {
struct Audio {
Header header;
- // TODO(penghuang): implement the audio frame.
+ PP_TimeDelta timestamp;
+ PP_AudioFrame_SampleRate sample_rate;
+ uint32_t number_of_channels;
+ uint32_t number_of_samples;
+ uint32_t data_size;
+ // Uses 8 bytes to make sure the Audio struct has consistent size between
+ // NaCl code and renderer code.
+ uint8_t data[8];
};
struct Video {
@@ -33,7 +41,7 @@ union MediaStreamFrame {
PP_Size size;
uint32_t data_size;
// Uses 8 bytes to make sure the Video struct has consistent size between
- // Nacl code and renderer code.
+ // NaCl code and renderer code.
uint8_t data[8];
};
@@ -41,7 +49,7 @@ union MediaStreamFrame {
// the size and alighment to be consistent between NaCl and its host trusted
// platform.
PP_COMPILE_ASSERT_SIZE_IN_BYTES(Header, 8);
- PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio, 8);
+ PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio, 40);
PP_COMPILE_ASSERT_SIZE_IN_BYTES(Video, 40);
Header header;

Powered by Google App Engine
This is Rietveld 408576698