OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/common/media/audio_param_traits.h" | 5 #include "content/common/media/audio_param_traits.h" |
6 | 6 |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "media/audio/audio_parameters.h" | 8 #include "media/audio/audio_parameters.h" |
9 | 9 |
10 using media::AudioParameters; | 10 using media::AudioParameters; |
| 11 using media::ChannelLayout; |
11 | 12 |
12 namespace IPC { | 13 namespace IPC { |
13 | 14 |
14 void ParamTraits<AudioParameters>::Write(Message* m, | 15 void ParamTraits<AudioParameters>::Write(Message* m, |
15 const AudioParameters& p) { | 16 const AudioParameters& p) { |
16 m->WriteInt(static_cast<int>(p.format())); | 17 m->WriteInt(static_cast<int>(p.format())); |
17 m->WriteInt(static_cast<int>(p.channel_layout())); | 18 m->WriteInt(static_cast<int>(p.channel_layout())); |
18 m->WriteInt(p.sample_rate()); | 19 m->WriteInt(p.sample_rate()); |
19 m->WriteInt(p.bits_per_sample()); | 20 m->WriteInt(p.bits_per_sample()); |
20 m->WriteInt(p.frames_per_buffer()); | 21 m->WriteInt(p.frames_per_buffer()); |
(...skipping 18 matching lines...) Expand all Loading... |
39 sample_rate, bits_per_sample, frames_per_buffer); | 40 sample_rate, bits_per_sample, frames_per_buffer); |
40 return true; | 41 return true; |
41 } | 42 } |
42 | 43 |
43 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, | 44 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, |
44 std::string* l) { | 45 std::string* l) { |
45 l->append(base::StringPrintf("<AudioParameters>")); | 46 l->append(base::StringPrintf("<AudioParameters>")); |
46 } | 47 } |
47 | 48 |
48 } | 49 } |
OLD | NEW |