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

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

Issue 2471733004: Revert of Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Created 4 years, 1 month 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_converter_unittest.cc ('k') | media/base/audio_renderer_mixer.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 <memory> 5 #include <memory>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "media/base/audio_bus.h" 9 #include "media/base/audio_bus.h"
10 #include "media/base/audio_hash.h" 10 #include "media/base/audio_hash.h"
(...skipping 19 matching lines...) Expand all
30 30
31 void GenerateUniqueChannels(AudioBus* audio_bus) { 31 void GenerateUniqueChannels(AudioBus* audio_bus) {
32 // Use an AudioBus wrapper to avoid an extra memcpy when filling channels. 32 // Use an AudioBus wrapper to avoid an extra memcpy when filling channels.
33 std::unique_ptr<AudioBus> wrapped_bus = AudioBus::CreateWrapper(1); 33 std::unique_ptr<AudioBus> wrapped_bus = AudioBus::CreateWrapper(1);
34 wrapped_bus->set_frames(audio_bus->frames()); 34 wrapped_bus->set_frames(audio_bus->frames());
35 35
36 // Since FakeAudioRenderCallback generates only a single channel of unique 36 // Since FakeAudioRenderCallback generates only a single channel of unique
37 // audio data, we need to fill each channel manually. 37 // audio data, we need to fill each channel manually.
38 for (int ch = 0; ch < audio_bus->channels(); ++ch) { 38 for (int ch = 0; ch < audio_bus->channels(); ++ch) {
39 wrapped_bus->SetChannelData(0, audio_bus->channel(ch)); 39 wrapped_bus->SetChannelData(0, audio_bus->channel(ch));
40 fake_callback_.Render(base::TimeDelta(), base::TimeTicks::Now(), 0, 40 fake_callback_.Render(wrapped_bus.get(), 0, 0);
41 wrapped_bus.get());
42 } 41 }
43 } 42 }
44 43
45 ~AudioHashTest() override {} 44 ~AudioHashTest() override {}
46 45
47 protected: 46 protected:
48 std::unique_ptr<AudioBus> bus_one_; 47 std::unique_ptr<AudioBus> bus_one_;
49 std::unique_ptr<AudioBus> bus_two_; 48 std::unique_ptr<AudioBus> bus_two_;
50 FakeAudioRenderCallback fake_callback_; 49 FakeAudioRenderCallback fake_callback_;
51 50
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Twiddle the values too much... 161 // Twiddle the values too much...
163 for (int i = 0; i < bus_one_->frames(); ++i) 162 for (int i = 0; i < bus_one_->frames(); ++i)
164 channel[i] += 0.0001f; 163 channel[i] += 0.0001f;
165 164
166 AudioHash hash_three; 165 AudioHash hash_three;
167 hash_three.Update(bus_one_.get(), bus_one_->frames()); 166 hash_three.Update(bus_one_.get(), bus_one_->frames());
168 EXPECT_NE(hash_one.ToString(), hash_three.ToString()); 167 EXPECT_NE(hash_one.ToString(), hash_three.ToString());
169 } 168 }
170 169
171 } // namespace media 170 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_converter_unittest.cc ('k') | media/base/audio_renderer_mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698