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

Side by Side Diff: media/audio/audio_io.h

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 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
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_AUDIO_AUDIO_IO_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_IO_H_
6 #define MEDIA_AUDIO_AUDIO_IO_H_ 6 #define MEDIA_AUDIO_AUDIO_IO_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "media/base/audio_bus.h" 9 #include "media/base/audio_bus.h"
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // called in a random thread which very likely is a high priority thread. Do 54 // called in a random thread which very likely is a high priority thread. Do
55 // not rely on using this thread TLS or make calls that alter the thread 55 // not rely on using this thread TLS or make calls that alter the thread
56 // itself such as creating Windows or initializing COM. 56 // itself such as creating Windows or initializing COM.
57 class MEDIA_EXPORT AudioSourceCallback { 57 class MEDIA_EXPORT AudioSourceCallback {
58 public: 58 public:
59 virtual ~AudioSourceCallback() {} 59 virtual ~AudioSourceCallback() {}
60 60
61 // Provide more data by fully filling |dest|. The source will return 61 // Provide more data by fully filling |dest|. The source will return
62 // the number of frames it filled. |total_bytes_delay| contains current 62 // the number of frames it filled. |total_bytes_delay| contains current
63 // number of bytes of delay buffered by the AudioOutputStream. 63 // number of bytes of delay buffered by the AudioOutputStream.
64 virtual int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) = 0; 64 // |frames_skipped| contains the number of frames skipped by the consumer.
65 virtual int OnMoreData(AudioBus* dest,
66 uint32_t total_bytes_delay,
67 uint32_t frames_skipped) = 0;
65 68
66 // There was an error while playing a buffer. Audio source cannot be 69 // There was an error while playing a buffer. Audio source cannot be
67 // destroyed yet. No direct action needed by the AudioStream, but it is 70 // destroyed yet. No direct action needed by the AudioStream, but it is
68 // a good place to stop accumulating sound data since is is likely that 71 // a good place to stop accumulating sound data since is is likely that
69 // playback will not continue. 72 // playback will not continue.
70 virtual void OnError(AudioOutputStream* stream) = 0; 73 virtual void OnError(AudioOutputStream* stream) = 0;
71 }; 74 };
72 75
73 virtual ~AudioOutputStream() {} 76 virtual ~AudioOutputStream() {}
74 77
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Returns the Automatic Gain Control (AGC) state. 167 // Returns the Automatic Gain Control (AGC) state.
165 virtual bool GetAutomaticGainControl() = 0; 168 virtual bool GetAutomaticGainControl() = 0;
166 169
167 // Returns the current muting state for the microphone. 170 // Returns the current muting state for the microphone.
168 virtual bool IsMuted() = 0; 171 virtual bool IsMuted() = 0;
169 }; 172 };
170 173
171 } // namespace media 174 } // namespace media
172 175
173 #endif // MEDIA_AUDIO_AUDIO_IO_H_ 176 #endif // MEDIA_AUDIO_AUDIO_IO_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698