Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: media/base/audio_buffer_unittest.cc

Issue 881603002: Adding an ALAC enum to AudioDecoderConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation error Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/audio_buffer.cc ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/base/audio_bus.h" 6 #include "media/base/audio_bus.h"
7 #include "media/base/test_helpers.h" 7 #include "media/base/test_helpers.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 case kSampleFormatPlanarF32: 481 case kSampleFormatPlanarF32:
482 return MakeAudioBuffer<float>( 482 return MakeAudioBuffer<float>(
483 sample_format, 483 sample_format,
484 channel_layout, 484 channel_layout,
485 channel_count, 485 channel_count,
486 sample_rate, 486 sample_rate,
487 0.0f, 487 0.0f,
488 65536.0f / std::numeric_limits<int32>::max(), 488 65536.0f / std::numeric_limits<int32>::max(),
489 frames, 489 frames,
490 base::TimeDelta::FromSeconds(0)); 490 base::TimeDelta::FromSeconds(0));
491 case kSampleFormatPlanarS32:
492 return MakeAudioBuffer<int32>(
493 sample_format,
494 channel_layout,
495 channel_count,
496 sample_rate,
497 0.0f,
498 65536.0f / std::numeric_limits<int32>::max(),
499 frames,
500 base::TimeDelta::FromSeconds(0));
491 case kSampleFormatU8: 501 case kSampleFormatU8:
492 case kUnknownSampleFormat: 502 case kUnknownSampleFormat:
493 EXPECT_FALSE(true); 503 EXPECT_FALSE(true);
494 break; 504 break;
495 } 505 }
496 return AudioBuffer::CreateEOSBuffer(); 506 return AudioBuffer::CreateEOSBuffer();
497 } 507 }
498 508
499 static void ReadFramesInterleavedS32Test(SampleFormat sample_format) { 509 static void ReadFramesInterleavedS32Test(SampleFormat sample_format) {
500 const ChannelLayout channel_layout = CHANNEL_LAYOUT_4_0; 510 const ChannelLayout channel_layout = CHANNEL_LAYOUT_4_0;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 542
533 TEST(AudioBufferTest, ReadFramesInterleavedS32FromPlanarS16) { 543 TEST(AudioBufferTest, ReadFramesInterleavedS32FromPlanarS16) {
534 ReadFramesInterleavedS32Test(kSampleFormatPlanarS16); 544 ReadFramesInterleavedS32Test(kSampleFormatPlanarS16);
535 } 545 }
536 546
537 TEST(AudioBufferTest, ReadFramesInterleavedS32FromPlanarF32) { 547 TEST(AudioBufferTest, ReadFramesInterleavedS32FromPlanarF32) {
538 ReadFramesInterleavedS32Test(kSampleFormatPlanarF32); 548 ReadFramesInterleavedS32Test(kSampleFormatPlanarF32);
539 } 549 }
540 550
541 } // namespace media 551 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_buffer.cc ('k') | media/base/audio_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698