OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/base/audio_buffer.h" | 5 #include "media/base/audio_buffer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/audio_bus.h" | 8 #include "media/base/audio_bus.h" |
9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
10 #include "media/base/limits.h" | 10 #include "media/base/limits.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 ConvertF32ToS32); | 330 ConvertF32ToS32); |
331 break; | 331 break; |
332 case kSampleFormatPlanarS32: | 332 case kSampleFormatPlanarS32: |
333 // Format is planar signed 32 bit. Convert each value into int32 and | 333 // Format is planar signed 32 bit. Convert each value into int32 and |
334 // insert into output channel data. | 334 // insert into output channel data. |
335 InterleaveToS32<int32>(channel_data_, | 335 InterleaveToS32<int32>(channel_data_, |
336 frames_to_copy, | 336 frames_to_copy, |
337 trim_start_, | 337 trim_start_, |
338 dest_data, | 338 dest_data, |
339 ConvertS32ToS32); | 339 ConvertS32ToS32); |
| 340 break; |
340 case kUnknownSampleFormat: | 341 case kUnknownSampleFormat: |
341 NOTREACHED(); | 342 NOTREACHED(); |
342 break; | 343 break; |
343 } | 344 } |
344 } | 345 } |
345 | 346 |
346 void AudioBuffer::TrimStart(int frames_to_trim) { | 347 void AudioBuffer::TrimStart(int frames_to_trim) { |
347 CHECK_GE(frames_to_trim, 0); | 348 CHECK_GE(frames_to_trim, 0); |
348 CHECK_LE(frames_to_trim, adjusted_frame_count_); | 349 CHECK_LE(frames_to_trim, adjusted_frame_count_); |
349 | 350 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 } | 405 } |
405 } else { | 406 } else { |
406 CHECK_EQ(frames_to_copy, 0); | 407 CHECK_EQ(frames_to_copy, 0); |
407 } | 408 } |
408 | 409 |
409 // Trim the leftover data off the end of the buffer and update duration. | 410 // Trim the leftover data off the end of the buffer and update duration. |
410 TrimEnd(frames_to_trim); | 411 TrimEnd(frames_to_trim); |
411 } | 412 } |
412 | 413 |
413 } // namespace media | 414 } // namespace media |
OLD | NEW |