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
3 // found in the LICENSE file.
5 #ifndef WEBKIT_MEDIA_MEDIA_STREAM_AUDIO_RENDERER_H_
6 #define WEBKIT_MEDIA_MEDIA_STREAM_AUDIO_RENDERER_H_
8 #include "base/memory/ref_counted.h"
11 namespace webkit_media
{
13 class MediaStreamAudioRenderer
14 : public base::RefCountedThreadSafe
<MediaStreamAudioRenderer
> {
16 // Starts rendering audio.
17 virtual void Start() = 0;
19 // Stops rendering audio.
20 virtual void Stop() = 0;
22 // Resumes rendering audio after being paused.
23 virtual void Play() = 0;
25 // Temporarily suspends rendering audio. The audio stream might still be
26 // active but new audio data is not provided to the consumer.
27 virtual void Pause() = 0;
29 // Sets the output volume.
30 virtual void SetVolume(float volume
) = 0;
32 // Time stamp that reflects the current render time. Should not be updated
34 virtual base::TimeDelta
GetCurrentRenderTime() const = 0;
36 // Returns true if the implementation is a local renderer and false
38 virtual bool IsLocalRenderer() const = 0;
41 friend class base::RefCountedThreadSafe
<MediaStreamAudioRenderer
>;
43 MediaStreamAudioRenderer();
44 virtual ~MediaStreamAudioRenderer();
47 DISALLOW_COPY_AND_ASSIGN(MediaStreamAudioRenderer
);
50 } // namespace webkit_media
52 #endif // WEBKIT_MEDIA_MEDIA_STREAM_AUDIO_RENDERER_H_