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; |
| 11 |
10 namespace IPC { | 12 namespace IPC { |
11 | 13 |
12 void ParamTraits<AudioParameters>::Write(Message* m, | 14 void ParamTraits<AudioParameters>::Write(Message* m, |
13 const AudioParameters& p) { | 15 const AudioParameters& p) { |
14 m->WriteInt(static_cast<int>(p.format())); | 16 m->WriteInt(static_cast<int>(p.format())); |
15 m->WriteInt(static_cast<int>(p.channel_layout())); | 17 m->WriteInt(static_cast<int>(p.channel_layout())); |
16 m->WriteInt(p.sample_rate()); | 18 m->WriteInt(p.sample_rate()); |
17 m->WriteInt(p.bits_per_sample()); | 19 m->WriteInt(p.bits_per_sample()); |
18 m->WriteInt(p.frames_per_buffer()); | 20 m->WriteInt(p.frames_per_buffer()); |
19 m->WriteInt(p.channels()); | 21 m->WriteInt(p.channels()); |
(...skipping 17 matching lines...) Expand all Loading... |
37 sample_rate, bits_per_sample, frames_per_buffer); | 39 sample_rate, bits_per_sample, frames_per_buffer); |
38 return true; | 40 return true; |
39 } | 41 } |
40 | 42 |
41 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, | 43 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, |
42 std::string* l) { | 44 std::string* l) { |
43 l->append(base::StringPrintf("<AudioParameters>")); | 45 l->append(base::StringPrintf("<AudioParameters>")); |
44 } | 46 } |
45 | 47 |
46 } | 48 } |
OLD | NEW |