OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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_video_frame.h" | |
9 | |
10 namespace ppapi { | |
11 | |
12 union MediaStreamFrame { | |
13 enum Type { | |
14 TYPE_UNKNOWN = 0, | |
15 TYPE_AUDIO = 1, | |
16 TYPE_VIDEO = 2, | |
17 }; | |
18 | |
19 struct Header { | |
20 Type type; | |
21 uint32_t size; | |
22 }; | |
23 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Header, 8); | |
dmichael (off chromium)
2014/01/14 16:12:03
It would be helpful to readers to comment on why i
Peng
2014/01/14 21:31:35
Done.
| |
24 | |
25 struct Audio { | |
26 Header header; | |
27 // TODO(penghuang): implement the audio frame. | |
28 }; | |
29 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Audio, 8); | |
30 | |
31 struct Video { | |
32 Header header; | |
33 PP_TimeDelta timestamp; | |
34 PP_VideoFrame_Format format; | |
35 PP_Size size; | |
36 uint32_t data_size; | |
37 // Uses 8 bytes to make sure below compile assert work in all platforms. | |
dmichael (off chromium)
2014/01/14 16:12:03
I would maybe rephrase to: "Uses 8 bytes to make s
Peng
2014/01/14 21:31:35
Done.
| |
38 uint8_t data[8]; | |
39 }; | |
40 PP_COMPILE_ASSERT_SIZE_IN_BYTES(Video, 40); | |
41 | |
42 Header header; | |
43 Video video; | |
44 Audio audio; | |
45 }; | |
46 | |
47 } // namespace ppapi | |
48 | |
49 #endif // PPAPI_SHARED_IMPL_MEDIA_STREAM_FRAME_H_ | |
OLD | NEW |