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

Unified Diff: webrtc/media/base/audiosource.h

Issue 1741933002: Prevent a voice channel from sending data before a renderer is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Modifying copyright header to satisfy presubmit bot. Created 4 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/base/audiorenderer.h ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/audiosource.h
diff --git a/webrtc/media/base/audiorenderer.h b/webrtc/media/base/audiosource.h
similarity index 58%
copy from webrtc/media/base/audiorenderer.h
copy to webrtc/media/base/audiosource.h
index 4544c7fc634aeb96cb56b922df5929199e8b3664..97743bc2660254099e718ffbe8ba0e665110ad1d 100644
--- a/webrtc/media/base/audiorenderer.h
+++ b/webrtc/media/base/audiosource.h
@@ -8,40 +8,42 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
-#define WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
+#ifndef WEBRTC_MEDIA_BASE_AUDIOSOURCE_H_
+#define WEBRTC_MEDIA_BASE_AUDIOSOURCE_H_
#include <cstddef>
namespace cricket {
-// Abstract interface for rendering the audio data.
-class AudioRenderer {
+// Abstract interface for providing the audio data.
+// TODO(deadbeef): Rename this to AudioSourceInterface, and rename
+// webrtc::AudioSourceInterface to AudioTrackSourceInterface.
+class AudioSource {
public:
class Sink {
public:
- // Callback to receive data from the AudioRenderer.
+ // Callback to receive data from the AudioSource.
virtual void OnData(const void* audio_data,
int bits_per_sample,
int sample_rate,
size_t number_of_channels,
size_t number_of_frames) = 0;
- // Called when the AudioRenderer is going away.
+ // Called when the AudioSource is going away.
virtual void OnClose() = 0;
protected:
virtual ~Sink() {}
};
- // Sets a sink to the AudioRenderer. There can be only one sink connected
- // to the renderer at a time.
- virtual void SetSink(Sink* sink) {}
+ // Sets a sink to the AudioSource. There can be only one sink connected
+ // to the source at a time.
+ virtual void SetSink(Sink* sink) = 0;
protected:
- virtual ~AudioRenderer() {}
+ virtual ~AudioSource() {}
};
} // namespace cricket
-#endif // WEBRTC_MEDIA_BASE_AUDIORENDERER_H_
+#endif // WEBRTC_MEDIA_BASE_AUDIOSOURCE_H_
« no previous file with comments | « webrtc/media/base/audiorenderer.h ('k') | webrtc/media/base/fakemediaengine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698