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(int render_process_id, |
| 22 int render_view_id, |
| 23 int stream_id) = 0; |
22 | 24 |
23 // Called when an audio stream is set to playing or paused. | 25 // Called when an audio stream is set to playing or paused. |
24 virtual void OnSetAudioStreamPlaying(void* host, int stream_id, | 26 virtual void OnSetAudioStreamPlaying(int render_process_id, |
| 27 int render_view_id, |
| 28 int stream_id, |
25 bool playing) = 0; | 29 bool playing) = 0; |
26 | 30 |
27 // Called when the status of an audio stream is set to "created", "flushed", | 31 // Called when the status of an audio stream is set to "created", "flushed", |
28 // "closed", or "error". | 32 // "closed", or "error". |
29 virtual void OnSetAudioStreamStatus(void* host, int stream_id, | 33 virtual void OnSetAudioStreamStatus(int render_process_id, |
| 34 int render_view_id, |
| 35 int stream_id, |
30 const std::string& status) = 0; | 36 const std::string& status) = 0; |
31 | 37 |
32 // Called when the volume of an audio stream is set. | 38 // Called when the volume of an audio stream is set. |
33 virtual void OnSetAudioStreamVolume(void* host, int stream_id, | 39 virtual void OnSetAudioStreamVolume(int render_process_id, |
| 40 int render_view_id, |
| 41 int stream_id, |
34 double volume) = 0; | 42 double volume) = 0; |
35 | 43 |
36 // Called when a MediaEvent occurs. | 44 // Called when a MediaEvent occurs. |
37 virtual void OnMediaEvent(int render_process_id, | 45 virtual void OnMediaEvent(int render_process_id, |
38 const media::MediaLogEvent& event) = 0; | 46 const media::MediaLogEvent& event) = 0; |
39 | 47 |
40 // Called when capture devices are opened. | 48 // Called when capture devices are opened. |
41 virtual void OnCaptureDevicesOpened( | 49 virtual void OnCaptureDevicesOpened( |
42 int render_process_id, | 50 int render_process_id, |
43 int render_view_id, | 51 int render_view_id, |
44 const content::MediaStreamDevices& devices) = 0; | 52 const content::MediaStreamDevices& devices) = 0; |
45 | 53 |
46 // Called when the opened capture devices are closed. | 54 // Called when the opened capture devices are closed. |
47 virtual void OnCaptureDevicesClosed( | 55 virtual void OnCaptureDevicesClosed( |
48 int render_process_id, | 56 int render_process_id, |
49 int render_view_id, | 57 int render_view_id, |
50 const content::MediaStreamDevices& devices) = 0; | 58 const content::MediaStreamDevices& devices) = 0; |
51 | 59 |
52 protected: | 60 protected: |
53 virtual ~MediaObserver() {} | 61 virtual ~MediaObserver() {} |
54 }; | 62 }; |
55 | 63 |
56 } // namespace content | 64 } // namespace content |
57 | 65 |
58 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_MEDIA_OBSERVER_H_ |
OLD | NEW |