Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 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), input_channels, |
| 46 sample_rate, bits_per_sample, frames_per_buffer); | 46 sample_rate, bits_per_sample, frames_per_buffer); |
| 47 if (channel_layout == media::CHANNEL_LAYOUT_DISCRETE) | |
|
DaleCurtis
2013/03/07 02:41:39
Does anything use Reset() that doesn't provide all
Chris Rogers
2013/03/09 01:37:50
Done.
| |
| 48 r->SetDiscreteChannels(channels); | |
| 47 if (!r->IsValid()) | 49 if (!r->IsValid()) |
| 48 return false; | 50 return false; |
| 49 return true; | 51 return true; |
| 50 } | 52 } |
| 51 | 53 |
| 52 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, | 54 void ParamTraits<AudioParameters>::Log(const AudioParameters& p, |
| 53 std::string* l) { | 55 std::string* l) { |
| 54 l->append(base::StringPrintf("<AudioParameters>")); | 56 l->append(base::StringPrintf("<AudioParameters>")); |
| 55 } | 57 } |
| 56 | 58 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 86 | 88 |
| 87 return true; | 89 return true; |
| 88 } | 90 } |
| 89 | 91 |
| 90 void ParamTraits<VideoCaptureParams>::Log(const VideoCaptureParams& p, | 92 void ParamTraits<VideoCaptureParams>::Log(const VideoCaptureParams& p, |
| 91 std::string* l) { | 93 std::string* l) { |
| 92 l->append(base::StringPrintf("<VideoCaptureParams>")); | 94 l->append(base::StringPrintf("<VideoCaptureParams>")); |
| 93 } | 95 } |
| 94 | 96 |
| 95 } | 97 } |
| OLD | NEW |