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

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

Issue 1487983002: 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: 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 virtual int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) = 0;
65 65
66 // Informs that the consumer has skipped |frames_skipped| frames. The source
DaleCurtis 2015/12/01 18:12:46 Why a new method instead of rolling this into OnMo
Henrik Grunell 2015/12/03 17:01:06 (See previous comment exchange.) Put this in OnMor
67 // can handle this appropriately depending on the type of source. An
68 // ordinary file playout would ignore this.
69 // TODO BEFORE COMMIT: Pure virtual and update subclasses.
70 virtual void OnSkippedData(uint32_t frames_skipped){};
71
66 // There was an error while playing a buffer. Audio source cannot be 72 // 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 73 // 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 74 // a good place to stop accumulating sound data since is is likely that
69 // playback will not continue. 75 // playback will not continue.
70 virtual void OnError(AudioOutputStream* stream) = 0; 76 virtual void OnError(AudioOutputStream* stream) = 0;
71 }; 77 };
72 78
73 virtual ~AudioOutputStream() {} 79 virtual ~AudioOutputStream() {}
74 80
75 // Open the stream. false is returned if the stream cannot be opened. Open() 81 // Open the stream. false is returned if the stream cannot be opened. Open()
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Returns the Automatic Gain Control (AGC) state. 170 // Returns the Automatic Gain Control (AGC) state.
165 virtual bool GetAutomaticGainControl() = 0; 171 virtual bool GetAutomaticGainControl() = 0;
166 172
167 // Returns the current muting state for the microphone. 173 // Returns the current muting state for the microphone.
168 virtual bool IsMuted() = 0; 174 virtual bool IsMuted() = 0;
169 }; 175 };
170 176
171 } // namespace media 177 } // namespace media
172 178
173 #endif // MEDIA_AUDIO_AUDIO_IO_H_ 179 #endif // MEDIA_AUDIO_AUDIO_IO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698