| 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/media_param_traits.h" | 5 #include "content/common/media/media_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 #include "media/base/limits.h" | 9 #include "media/base/limits.h" |
| 10 #include "media/video/capture/video_capture_types.h" | 10 #include "media/video/capture/video_capture_types.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 if (!m->ReadInt(iter, &format) || | 36 if (!m->ReadInt(iter, &format) || |
| 37 !m->ReadInt(iter, &channel_layout) || | 37 !m->ReadInt(iter, &channel_layout) || |
| 38 !m->ReadInt(iter, &sample_rate) || | 38 !m->ReadInt(iter, &sample_rate) || |
| 39 !m->ReadInt(iter, &bits_per_sample) || | 39 !m->ReadInt(iter, &bits_per_sample) || |
| 40 !m->ReadInt(iter, &frames_per_buffer) || | 40 !m->ReadInt(iter, &frames_per_buffer) || |
| 41 !m->ReadInt(iter, &channels) || | 41 !m->ReadInt(iter, &channels) || |
| 42 !m->ReadInt(iter, &input_channels)) | 42 !m->ReadInt(iter, &input_channels)) |
| 43 return false; | 43 return false; |
| 44 r->Reset(static_cast<AudioParameters::Format>(format), | 44 r->Reset(static_cast<AudioParameters::Format>(format), |
| 45 static_cast<ChannelLayout>(channel_layout), input_channels, | 45 static_cast<ChannelLayout>(channel_layout), channels, |
| 46 sample_rate, bits_per_sample, frames_per_buffer); | 46 input_channels, sample_rate, bits_per_sample, frames_per_buffer); |
| 47 if (!r->IsValid()) | 47 if (!r->IsValid()) |
| 48 return false; | 48 return false; |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, | 52 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, |
| 53 std::string* l) { | 53 std::string* l) { |
| 54 l->append(base::StringPrintf("<AudioParameters>")); | 54 l->append(base::StringPrintf("<AudioParameters>")); |
| 55 } | 55 } |
| 56 | 56 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 return true; | 87 return true; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ParamTraits<VideoCaptureParams>::Log(const VideoCaptureParams& p, | 90 void ParamTraits<VideoCaptureParams>::Log(const VideoCaptureParams& p, |
| 91 std::string* l) { | 91 std::string* l) { |
| 92 l->append(base::StringPrintf("<VideoCaptureParams>")); | 92 l->append(base::StringPrintf("<VideoCaptureParams>")); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } | 95 } |
| OLD | NEW |