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

Side by Side Diff: media/base/fake_audio_render_callback.h

Issue 1070923002: Fix incorrect AudioConverter setup for discrete channel layouts. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_converter_unittest.cc ('k') | media/base/fake_audio_render_callback.cc » ('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 (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 #ifndef MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ 5 #ifndef MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_
6 #define MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ 6 #define MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_
7 7
8 #include "media/base/audio_converter.h" 8 #include "media/base/audio_converter.h"
9 #include "media/base/audio_renderer_sink.h" 9 #include "media/base/audio_renderer_sink.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 24 matching lines...) Expand all
35 base::TimeDelta buffer_delay) override; 35 base::TimeDelta buffer_delay) override;
36 36
37 // Toggles only filling half the requested amount during Render(). 37 // Toggles only filling half the requested amount during Render().
38 void set_half_fill(bool half_fill) { half_fill_ = half_fill; } 38 void set_half_fill(bool half_fill) { half_fill_ = half_fill; }
39 39
40 // Reset the sine state to initial value. 40 // Reset the sine state to initial value.
41 void reset() { x_ = 0; } 41 void reset() { x_ = 0; }
42 42
43 // Returns the last |audio_delay_milliseconds| provided to Render() or -1 if 43 // Returns the last |audio_delay_milliseconds| provided to Render() or -1 if
44 // no Render() call occurred. 44 // no Render() call occurred.
45 int last_audio_delay_milliseconds() { return last_audio_delay_milliseconds_; } 45 int last_audio_delay_milliseconds() const {
46 return last_audio_delay_milliseconds_;
47 }
46 48
47 // Set volume information used by ProvideAudioTransformInput(). 49 // Set volume information used by ProvideAudioTransformInput().
48 void set_volume(double volume) { volume_ = volume; } 50 void set_volume(double volume) { volume_ = volume; }
49 51
52 int last_channel_count() const { return last_channel_count_; }
53
50 private: 54 private:
51 bool half_fill_; 55 bool half_fill_;
52 double x_; 56 double x_;
53 double step_; 57 double step_;
54 int last_audio_delay_milliseconds_; 58 int last_audio_delay_milliseconds_;
59 int last_channel_count_;
55 double volume_; 60 double volume_;
56 61
57 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback); 62 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback);
58 }; 63 };
59 64
60 } // namespace media 65 } // namespace media
61 66
62 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ 67 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_
OLDNEW
« no previous file with comments | « media/base/audio_converter_unittest.cc ('k') | media/base/fake_audio_render_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698