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

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

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/fake_audio_renderer_sink.cc ('k') | media/base/silent_sink_suspender.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SILENT_SINK_SUSPENDER_H_ 5 #ifndef MEDIA_BASE_SILENT_SINK_SUSPENDER_H_
6 #define MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ 6 #define MEDIA_BASE_SILENT_SINK_SUSPENDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 29 matching lines...) Expand all
40 // amount of silence to allow before suspension is |silence_timeout|. 40 // amount of silence to allow before suspension is |silence_timeout|.
41 SilentSinkSuspender( 41 SilentSinkSuspender(
42 AudioRendererSink::RenderCallback* callback, 42 AudioRendererSink::RenderCallback* callback,
43 base::TimeDelta silence_timeout, 43 base::TimeDelta silence_timeout,
44 const AudioParameters& params, 44 const AudioParameters& params,
45 const scoped_refptr<AudioRendererSink>& sink, 45 const scoped_refptr<AudioRendererSink>& sink,
46 const scoped_refptr<base::SingleThreadTaskRunner>& worker); 46 const scoped_refptr<base::SingleThreadTaskRunner>& worker);
47 ~SilentSinkSuspender() override; 47 ~SilentSinkSuspender() override;
48 48
49 // AudioRendererSink::RenderCallback implementation. 49 // AudioRendererSink::RenderCallback implementation.
50 int Render(base::TimeDelta delay, 50 int Render(AudioBus* dest,
51 base::TimeTicks delay_timestamp, 51 uint32_t frames_delayed,
52 int prior_frames_skipped, 52 uint32_t frames_skipped) override;
53 AudioBus* dest) override;
54 void OnRenderError() override; 53 void OnRenderError() override;
55 54
56 bool is_using_fake_sink_for_testing() const { return is_using_fake_sink_; } 55 bool is_using_fake_sink_for_testing() const { return is_using_fake_sink_; }
57 56
58 private: 57 private:
59 // If |use_fake_sink| is true, pauses |sink_| and plays |fake_sink_|; if 58 // If |use_fake_sink| is true, pauses |sink_| and plays |fake_sink_|; if
60 // false, pauses |fake_sink_| and plays |sink_|. 59 // false, pauses |fake_sink_| and plays |sink_|.
61 void TransitionSinks(bool use_fake_sink); 60 void TransitionSinks(bool use_fake_sink);
62 61
63 // Actual RenderCallback providing audio data to the output device. 62 // Actual RenderCallback providing audio data to the output device.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // after a period of silence or first non-silent audio respective. We do this 101 // after a period of silence or first non-silent audio respective. We do this
103 // on Android to save battery consumption. 102 // on Android to save battery consumption.
104 base::CancelableCallback<void(bool)> sink_transition_callback_; 103 base::CancelableCallback<void(bool)> sink_transition_callback_;
105 104
106 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender); 105 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender);
107 }; 106 };
108 107
109 } // namespace content 108 } // namespace content
110 109
111 #endif // MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ 110 #endif // MEDIA_BASE_SILENT_SINK_SUSPENDER_H_
OLDNEW
« no previous file with comments | « media/base/fake_audio_renderer_sink.cc ('k') | media/base/silent_sink_suspender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698