Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / content / public / renderer / media_stream_audio_renderer.h
blob5a5d68d3d6234171c33df2e2462e8d430e9c0402
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_RENDERER_H_
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_RENDERER_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/time/time.h"
13 #include "media/base/output_device.h"
14 #include "url/gurl.h"
16 namespace content {
18 class MediaStreamAudioRenderer
19 : public base::RefCountedThreadSafe<MediaStreamAudioRenderer> {
20 public:
21 // Starts rendering audio.
22 virtual void Start() = 0;
24 // Stops rendering audio.
25 virtual void Stop() = 0;
27 // Resumes rendering audio after being paused.
28 virtual void Play() = 0;
30 // Temporarily suspends rendering audio. The audio stream might still be
31 // active but new audio data is not provided to the consumer.
32 virtual void Pause() = 0;
34 // Sets the output volume.
35 virtual void SetVolume(float volume) = 0;
37 // Returns a pointer to the internal output device.
38 // The pointer is not to be owned by the caller and is valid only during
39 // the lifetime of the MediaStreamAudioRenderer.
40 // It can be null, which means that access to the output device is not
41 // supported.
42 virtual media::OutputDevice* GetOutputDevice() = 0;
44 // Time stamp that reflects the current render time. Should not be updated
45 // when paused.
46 virtual base::TimeDelta GetCurrentRenderTime() const = 0;
48 // Returns true if the implementation is a local renderer and false
49 // otherwise.
50 virtual bool IsLocalRenderer() const = 0;
52 protected:
53 friend class base::RefCountedThreadSafe<MediaStreamAudioRenderer>;
55 virtual ~MediaStreamAudioRenderer() {}
58 } // namespace content
60 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_AUDIO_RENDERER_H_