1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_H_
6 #define PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_H_
8 #include "ppapi/c/ppb_audio_buffer.h"
9 #include "ppapi/c/ppb_video_frame.h"
13 union MediaStreamBuffer
{
14 enum Type
{ TYPE_UNKNOWN
= 0, TYPE_AUDIO
= 1, TYPE_VIDEO
= 2, };
23 PP_TimeDelta timestamp
;
24 PP_AudioBuffer_SampleRate sample_rate
;
25 uint32_t number_of_channels
;
26 uint32_t number_of_samples
;
28 // Uses 8 bytes to make sure the Audio struct has consistent size between
29 // NaCl code and renderer code.
35 PP_TimeDelta timestamp
;
36 PP_VideoFrame_Format format
;
39 // Uses 8 bytes to make sure the Video struct has consistent size between
40 // NaCl code and renderer code.
44 // Because these structs are written and read in shared memory, we need
45 // the size and alighment to be consistent between NaCl and its host trusted
47 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Header
, 8);
48 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio
, 40);
49 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Video
, 40);
58 #endif // PPAPI_SHARED_IMPL_MEDIA_STREAM_BUFFER_H_