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

Side by Side Diff: media/base/fake_audio_renderer_sink.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_render_callback.cc ('k') | media/base/fake_audio_renderer_sink.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 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 #ifndef MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_ 5 #ifndef MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_ 6 #define MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 24 matching lines...) Expand all
35 RenderCallback* callback) override; 35 RenderCallback* callback) override;
36 void Start() override; 36 void Start() override;
37 void Stop() override; 37 void Stop() override;
38 void Pause() override; 38 void Pause() override;
39 void Play() override; 39 void Play() override;
40 bool SetVolume(double volume) override; 40 bool SetVolume(double volume) override;
41 OutputDeviceInfo GetOutputDeviceInfo() override; 41 OutputDeviceInfo GetOutputDeviceInfo() override;
42 bool CurrentThreadIsRenderingThread() override; 42 bool CurrentThreadIsRenderingThread() override;
43 43
44 // Attempts to call Render() on the callback provided to 44 // Attempts to call Render() on the callback provided to
45 // Initialize() with |dest| and |frames_delayed|. 45 // Initialize() with |dest| and |delay|.
46 // Returns true and sets |frames_written| to the return value of the 46 // Returns true and sets |frames_written| to the return value of the
47 // Render() call. 47 // Render() call.
48 // Returns false if this object is in a state where calling Render() 48 // Returns false if this object is in a state where calling Render()
49 // should not occur. (i.e., in the kPaused or kStopped state.) The 49 // should not occur. (i.e., in the kPaused or kStopped state.) The
50 // value of |frames_written| is undefined if false is returned. 50 // value of |frames_written| is undefined if false is returned.
51 bool Render(AudioBus* dest, uint32_t frames_delayed, int* frames_written); 51 bool Render(AudioBus* dest, base::TimeDelta delay, int* frames_written);
52 void OnRenderError(); 52 void OnRenderError();
53 53
54 State state() const { return state_; } 54 State state() const { return state_; }
55 55
56 protected: 56 protected:
57 ~FakeAudioRendererSink() override; 57 ~FakeAudioRendererSink() override;
58 58
59 private: 59 private:
60 void ChangeState(State new_state); 60 void ChangeState(State new_state);
61 61
62 State state_; 62 State state_;
63 RenderCallback* callback_; 63 RenderCallback* callback_;
64 OutputDeviceInfo output_device_info_; 64 OutputDeviceInfo output_device_info_;
65 65
66 DISALLOW_COPY_AND_ASSIGN(FakeAudioRendererSink); 66 DISALLOW_COPY_AND_ASSIGN(FakeAudioRendererSink);
67 }; 67 };
68 68
69 } // namespace media 69 } // namespace media
70 70
71 #endif // MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_ 71 #endif // MEDIA_BASE_FAKE_AUDIO_RENDERER_SINK_H_
OLDNEW
« no previous file with comments | « media/base/fake_audio_render_callback.cc ('k') | media/base/fake_audio_renderer_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698