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

Side by Side Diff: ppapi/shared_impl/media_stream_frame.h

Issue 142023008: [PPAPI][MediaStream] Rename AudioFrame to AudioBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 6 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
6 #define PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
7
8 #include "ppapi/c/ppb_audio_frame.h"
9 #include "ppapi/c/ppb_video_frame.h"
10
11 namespace ppapi {
12
13 union MediaStreamFrame {
14 enum Type {
15 TYPE_UNKNOWN = 0,
16 TYPE_AUDIO = 1,
17 TYPE_VIDEO = 2,
18 };
19
20 struct Header {
21 Type type;
22 uint32_t size;
23 };
24
25 struct Audio {
26 Header header;
27 PP_TimeDelta timestamp;
28 PP_AudioFrame_SampleRate sample_rate;
29 uint32_t number_of_channels;
30 uint32_t number_of_samples;
31 uint32_t data_size;
32 // Uses 8 bytes to make sure the Audio struct has consistent size between
33 // NaCl code and renderer code.
34 uint8_t data[8];
35 };
36
37 struct Video {
38 Header header;
39 PP_TimeDelta timestamp;
40 PP_VideoFrame_Format format;
41 PP_Size size;
42 uint32_t data_size;
43 // Uses 8 bytes to make sure the Video struct has consistent size between
44 // NaCl code and renderer code.
45 uint8_t data[8];
46 };
47
48 // Because these structs are written and read in shared memory, we need
49 // the size and alighment to be consistent between NaCl and its host trusted
50 // platform.
51 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Header, 8);
52 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio, 40);
53 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Video, 40);
54
55 Header header;
56 Video video;
57 Audio audio;
58 };
59
60 } // namespace ppapi
61
62 #endif // PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/media_stream_buffer_manager.cc ('k') | ppapi/shared_impl/media_stream_frame_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698