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

Side by Side Diff: media/base/silent_sink_suspender.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/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(AudioBus* dest, 50 int Render(base::TimeDelta delay,
51 uint32_t frames_delayed, 51 base::TimeTicks delay_timestamp,
52 uint32_t frames_skipped) override; 52 int prior_frames_skipped,
53 AudioBus* dest) override;
53 void OnRenderError() override; 54 void OnRenderError() override;
54 55
55 bool is_using_fake_sink_for_testing() const { return is_using_fake_sink_; } 56 bool is_using_fake_sink_for_testing() const { return is_using_fake_sink_; }
56 57
57 private: 58 private:
58 // If |use_fake_sink| is true, pauses |sink_| and plays |fake_sink_|; if 59 // If |use_fake_sink| is true, pauses |sink_| and plays |fake_sink_|; if
59 // false, pauses |fake_sink_| and plays |sink_|. 60 // false, pauses |fake_sink_| and plays |sink_|.
60 void TransitionSinks(bool use_fake_sink); 61 void TransitionSinks(bool use_fake_sink);
61 62
62 // Actual RenderCallback providing audio data to the output device. 63 // Actual RenderCallback providing audio data to the output device.
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // after a period of silence or first non-silent audio respective. We do this 102 // after a period of silence or first non-silent audio respective. We do this
102 // on Android to save battery consumption. 103 // on Android to save battery consumption.
103 base::CancelableCallback<void(bool)> sink_transition_callback_; 104 base::CancelableCallback<void(bool)> sink_transition_callback_;
104 105
105 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender); 106 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender);
106 }; 107 };
107 108
108 } // namespace content 109 } // namespace content
109 110
110 #endif // MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ 111 #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