OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 module mojo { | 5 module mojo { |
6 | 6 |
7 // See media/base/buffering_state.h for descriptions. | |
8 // Kept in sync with media::BufferingState via COMPILE_ASSERTs. | |
scherkus (not reviewing)
2014/09/09 20:35:32
mojo development question: is it perhaps better to
tim (not reviewing)
2014/09/10 23:08:28
I asked an analogous question to mojo-dev about st
| |
7 enum BufferingState { | 9 enum BufferingState { |
8 // Indicates that there is no data buffered. | |
9 // | |
10 // Typical reason is data underflow and hence playback should be paused. | |
11 HAVE_NOTHING, | 10 HAVE_NOTHING, |
11 HAVE_ENOUGH, | |
12 }; | |
12 | 13 |
13 // Indicates that enough data has been buffered. | 14 // See media/base/audio_decoder_config.h for descriptions. |
14 // | 15 // Kept in sync with media::AudioCodec via COMPILE_ASSERTs. |
15 // Typical reason is enough data has been prerolled to start playback. | 16 enum AudioCodec { |
16 HAVE_ENOUGH, | 17 UNKNOWN = 0, |
18 AAC = 1, | |
19 MP3 = 2, | |
20 PCM = 3, | |
21 Vorbis = 4, | |
22 FLAC = 5, | |
23 AMR_NB = 6, | |
24 AMR_WB = 7, | |
25 PCM_MULAW = 8, | |
26 GSM_MS = 9, | |
27 PCM_S16BE = 10, | |
28 PCM_S24BE = 11, | |
29 Opus = 12, | |
30 // EAC3 = 13, | |
31 PCM_ALAW = 14, | |
32 MAX = PCM_ALAW, | |
33 }; | |
34 | |
35 // See media/base/channel_layout.h for descriptions. | |
36 // Kept in sync with media::ChannelLayout via COMPILE_ASSERTs. | |
37 // TODO(tim): The bindings generators will always prepend the enum name, should | |
38 // mojom therefore allow enum values starting with numbers? | |
scherkus (not reviewing)
2014/09/09 20:35:32
good question ... yeah this seems kind of gross
| |
39 enum ChannelLayout { | |
40 k_NONE = 0, | |
41 k_UNSUPPORTED = 1, | |
42 k_MONO = 2, | |
43 k_STEREO = 3, | |
44 k_2_1 = 4, | |
45 k_SURROUND = 5, | |
46 k_4_0 = 6, | |
47 k_2_2 = 7, | |
48 k_QUAD = 8, | |
49 k_5_0 = 9, | |
50 k_5_1 = 10, | |
51 k_5_0_BACK = 11, | |
52 k_5_1_BACK = 12, | |
53 k_7_0 = 13, | |
54 k_7_1 = 14, | |
55 k_7_1_WIDE = 15, | |
56 k_STEREO_DOWNMIX = 16, | |
57 k_2POINT1 = 17, | |
58 k_3_1 = 18, | |
59 k_4_1 = 19, | |
60 k_6_0 = 20, | |
61 k_6_0_FRONT = 21, | |
62 k_HEXAGONAL = 22, | |
63 k_6_1 = 23, | |
64 k_6_1_BACK = 24, | |
65 k_6_1_FRONT = 25, | |
66 k_7_0_FRONT = 26, | |
67 k_7_1_WIDE_BACK = 27, | |
68 k_OCTAGONAL = 28, | |
69 k_DISCRETE = 29, | |
70 k_STEREO_AND_KEYBOARD_MIC = 30, | |
71 k_MAX = k_STEREO_AND_KEYBOARD_MIC | |
72 }; | |
73 | |
74 // See media/base/sample_format.h for descriptions. | |
75 // Kept in sync with media::SampleFormat via COMPILE_ASSERTs. | |
76 enum SampleFormat { | |
77 UNKNOWN = 0, | |
78 U8, | |
79 S16, | |
80 S32, | |
81 F32, | |
82 PlanarS16, | |
83 PlanarF32, | |
84 Max = PlanarF32, | |
85 }; | |
86 | |
87 // This defines a mojo transport format for media::AudioDecoderConfig. | |
88 // See media/base/audio_decoder_config.h for descriptions. | |
89 struct AudioDecoderConfig { | |
90 AudioCodec codec; | |
91 SampleFormat sample_format; | |
92 ChannelLayout channel_layout; | |
93 int32 samples_per_second; | |
94 uint8[]? extra_data; | |
95 int64 seek_preroll_usec; | |
96 int32 codec_delay; | |
17 }; | 97 }; |
xhwang
2014/09/10 00:00:52
I understand these are required to serialize a med
tim (not reviewing)
2014/09/10 23:08:28
Hm, well, the only real point to using mojo is tha
| |
18 | 98 |
19 // This defines a mojo transport format for media::DecoderBuffer. | 99 // This defines a mojo transport format for media::DecoderBuffer. |
20 struct MediaDecoderBuffer { | 100 struct MediaDecoderBuffer { |
21 // See media/base/buffers.h for details. | 101 // See media/base/buffers.h for details. |
22 int64 timestamp_usec; | 102 int64 timestamp_usec; |
23 int64 duration_usec; | 103 int64 duration_usec; |
24 | 104 |
25 // The number of bytes in |data|. | 105 // The number of bytes in |data|. |
26 uint32 data_size; | 106 uint32 data_size; |
27 | 107 |
(...skipping 10 matching lines...) Expand all Loading... | |
38 int64 splice_timestamp_usec; | 118 int64 splice_timestamp_usec; |
39 | 119 |
40 // The payload. | 120 // The payload. |
41 // TODO(tim): This currently results in allocating a new, largeish DataPipe | 121 // TODO(tim): This currently results in allocating a new, largeish DataPipe |
42 // for each buffer. Remove this once framed data pipes exist, but using this | 122 // for each buffer. Remove this once framed data pipes exist, but using this |
43 // for now for prototyping audio. | 123 // for now for prototyping audio. |
44 handle<data_pipe_consumer> data; | 124 handle<data_pipe_consumer> data; |
45 }; | 125 }; |
46 | 126 |
47 } // module mojo | 127 } // module mojo |
OLD | NEW |