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 "media/filters/opus_audio_decoder.h" | 5 #include "media/filters/opus_audio_decoder.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static const int kOpusExtraDataStreamMapOffset = | 166 static const int kOpusExtraDataStreamMapOffset = |
167 kOpusExtraDataNumStreamsOffset + 2; | 167 kOpusExtraDataNumStreamsOffset + 2; |
168 | 168 |
169 struct OpusExtraData { | 169 struct OpusExtraData { |
170 OpusExtraData() | 170 OpusExtraData() |
171 : channels(0), | 171 : channels(0), |
172 skip_samples(0), | 172 skip_samples(0), |
173 channel_mapping(0), | 173 channel_mapping(0), |
174 num_streams(0), | 174 num_streams(0), |
175 num_coupled(0), | 175 num_coupled(0), |
176 gain_db(0) { | 176 gain_db(0), |
| 177 stream_map() { |
177 memcpy(stream_map, | 178 memcpy(stream_map, |
178 kDefaultOpusChannelLayout, | 179 kDefaultOpusChannelLayout, |
179 kMaxChannelsWithDefaultLayout); | 180 kMaxChannelsWithDefaultLayout); |
180 } | 181 } |
181 int channels; | 182 int channels; |
182 uint16 skip_samples; | 183 uint16 skip_samples; |
183 int channel_mapping; | 184 int channel_mapping; |
184 int num_streams; | 185 int num_streams; |
185 int num_coupled; | 186 int num_coupled; |
186 int16 gain_db; | 187 int16 gain_db; |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 output_buffer->get()->TrimEnd(trim_frames); | 478 output_buffer->get()->TrimEnd(trim_frames); |
478 | 479 |
479 // Handles discards and timestamping. Discard the buffer if more data needed. | 480 // Handles discards and timestamping. Discard the buffer if more data needed. |
480 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) | 481 if (!discard_helper_->ProcessBuffers(input, *output_buffer)) |
481 *output_buffer = NULL; | 482 *output_buffer = NULL; |
482 | 483 |
483 return true; | 484 return true; |
484 } | 485 } |
485 | 486 |
486 } // namespace media | 487 } // namespace media |
OLD | NEW |