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

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

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Comments from chcunningham@ and Dale Created 4 years 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_renderer_sink.h ('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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 11 matching lines...) Expand all
22 public AudioConverter::InputCallback { 22 public AudioConverter::InputCallback {
23 public: 23 public:
24 // The function used to fulfill Render() is f(x) = sin(2 * PI * x * |step|), 24 // The function used to fulfill Render() is f(x) = sin(2 * PI * x * |step|),
25 // where x = [|number_of_frames| * m, |number_of_frames| * (m + 1)] and m = 25 // where x = [|number_of_frames| * m, |number_of_frames| * (m + 1)] and m =
26 // the number of Render() calls fulfilled thus far. 26 // the number of Render() calls fulfilled thus far.
27 explicit FakeAudioRenderCallback(double step); 27 explicit FakeAudioRenderCallback(double step);
28 ~FakeAudioRenderCallback() override; 28 ~FakeAudioRenderCallback() override;
29 29
30 // Renders a sine wave into the provided audio data buffer. If |half_fill_| 30 // Renders a sine wave into the provided audio data buffer. If |half_fill_|
31 // is set, will only fill half the buffer. 31 // is set, will only fill half the buffer.
32 int Render(AudioBus* audio_bus, 32 int Render(base::TimeDelta delay,
33 uint32_t frames_delayed, 33 base::TimeTicks delay_timestamp,
34 uint32_t frames_skipped) override; 34 int prior_frames_skipped,
35 AudioBus* audio_bus) override;
35 MOCK_METHOD0(OnRenderError, void()); 36 MOCK_METHOD0(OnRenderError, void());
36 37
37 // AudioTransform::ProvideAudioTransformInput implementation. 38 // AudioTransform::ProvideAudioTransformInput implementation.
38 double ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) override; 39 double ProvideInput(AudioBus* audio_bus, uint32_t frames_delayed) override;
39 40
40 // Toggles only filling half the requested amount during Render(). 41 // Toggles only filling half the requested amount during Render().
41 void set_half_fill(bool half_fill) { half_fill_ = half_fill; } 42 void set_half_fill(bool half_fill) { half_fill_ = half_fill; }
42 43
43 // Reset the sine state to initial value. 44 // Reset the sine state to initial value.
44 void reset() { x_ = 0; } 45 void reset() { x_ = 0; }
(...skipping 18 matching lines...) Expand all
63 int last_frames_delayed_; 64 int last_frames_delayed_;
64 int last_channel_count_; 65 int last_channel_count_;
65 double volume_; 66 double volume_;
66 67
67 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback); 68 DISALLOW_COPY_AND_ASSIGN(FakeAudioRenderCallback);
68 }; 69 };
69 70
70 } // namespace media 71 } // namespace media
71 72
72 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_ 73 #endif // MEDIA_BASE_FAKE_AUDIO_RENDER_CALLBACK_H_
OLDNEW
« no previous file with comments | « media/base/audio_renderer_sink.h ('k') | media/base/fake_audio_render_callback.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698