OLD | NEW |
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 CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
7 | 7 |
8 #include "content/public/common/media_stream_request.h" | 8 #include "content/public/common/media_stream_request.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 struct MediaLogEvent; | 11 struct MediaLogEvent; |
12 } | 12 } |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 // An embedder may implement MediaObserver and return it from | 16 // An embedder may implement MediaObserver and return it from |
17 // ContentBrowserClient to receive callbacks as media events occur. | 17 // ContentBrowserClient to receive callbacks as media events occur. |
18 class MediaObserver { | 18 class MediaObserver { |
19 public: | 19 public: |
20 // Called when an audio stream is deleted. | 20 // Called when an audio stream is deleted. |
21 virtual void OnDeleteAudioStream(void* host, int stream_id) = 0; | 21 virtual void OnDeleteAudioStream(void* host, int stream_id) = 0; |
22 | 22 |
23 // Called when an audio stream is set to playing or paused. | 23 // Called when an audio stream is set to playing or paused. |
24 virtual void OnSetAudioStreamPlaying(void* host, int stream_id, | 24 virtual void OnSetAudioStreamPlaying(void* host, int stream_id, |
25 bool playing) = 0; | 25 bool playing) = 0; |
26 | 26 |
27 // Called when the status of an audio stream is set to "created", "flushed", | 27 // Called when the status of an audio stream is set to "created", "flushed", |
28 // "closed", or "error". | 28 // "closed", or "error". |
29 virtual void OnSetAudioStreamStatus(void* host, int stream_id, | 29 virtual void OnSetAudioStreamStatus(void* host, int stream_id, |
| 30 int render_process_id, |
| 31 int render_view_id, |
30 const std::string& status) = 0; | 32 const std::string& status) = 0; |
31 | 33 |
32 // Called when the volume of an audio stream is set. | 34 // Called when the volume of an audio stream is set. |
33 virtual void OnSetAudioStreamVolume(void* host, int stream_id, | 35 virtual void OnSetAudioStreamVolume(void* host, int stream_id, |
34 double volume) = 0; | 36 double volume) = 0; |
35 | 37 |
36 // Called when a MediaEvent occurs. | 38 // Called when a MediaEvent occurs. |
37 virtual void OnMediaEvent(int render_process_id, | 39 virtual void OnMediaEvent(int render_process_id, |
38 const media::MediaLogEvent& event) = 0; | 40 const media::MediaLogEvent& event) = 0; |
39 | 41 |
40 // Called when capture devices are opened. | 42 // Called when capture devices are opened. |
41 virtual void OnCaptureDevicesOpened( | 43 virtual void OnCaptureDevicesOpened( |
42 int render_process_id, | 44 int render_process_id, |
43 int render_view_id, | 45 int render_view_id, |
44 const content::MediaStreamDevices& devices) = 0; | 46 const content::MediaStreamDevices& devices) = 0; |
45 | 47 |
46 // Called when the opened capture devices are closed. | 48 // Called when the opened capture devices are closed. |
47 virtual void OnCaptureDevicesClosed( | 49 virtual void OnCaptureDevicesClosed( |
48 int render_process_id, | 50 int render_process_id, |
49 int render_view_id, | 51 int render_view_id, |
50 const content::MediaStreamDevices& devices) = 0; | 52 const content::MediaStreamDevices& devices) = 0; |
51 | 53 |
52 protected: | 54 protected: |
53 virtual ~MediaObserver() {} | 55 virtual ~MediaObserver() {} |
54 }; | 56 }; |
55 | 57 |
56 } // namespace content | 58 } // namespace content |
57 | 59 |
58 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 60 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
OLD | NEW |