| 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_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void CloseDevice(const std::string& label); | 88 void CloseDevice(const std::string& label); |
| 89 | 89 |
| 90 // Check if the label is a valid stream. | 90 // Check if the label is a valid stream. |
| 91 virtual bool IsStream(const std::string& label); | 91 virtual bool IsStream(const std::string& label); |
| 92 // Get the video session_id given a label. The label identifies a stream. | 92 // Get the video session_id given a label. The label identifies a stream. |
| 93 // index is the index in the video_device_array of the stream. | 93 // index is the index in the video_device_array of the stream. |
| 94 virtual int video_session_id(const std::string& label, int index); | 94 virtual int video_session_id(const std::string& label, int index); |
| 95 // Returns an audio session_id given a label and an index. | 95 // Returns an audio session_id given a label and an index. |
| 96 virtual int audio_session_id(const std::string& label, int index); | 96 virtual int audio_session_id(const std::string& label, int index); |
| 97 | 97 |
| 98 // Returns true if an audio input stream is currently active that was opened |
| 99 // with audio ducking enabled. This is information is used when playing out |
| 100 // audio so that rendered audio can be excluded from the ducking operation. |
| 101 bool IsAudioDuckingActive() const; |
| 102 |
| 98 protected: | 103 protected: |
| 99 int GetNextIpcIdForTest() { return next_ipc_id_; } | 104 int GetNextIpcIdForTest() { return next_ipc_id_; } |
| 100 | 105 |
| 101 private: | 106 private: |
| 102 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicVideoDevice); | 107 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicVideoDevice); |
| 103 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); | 108 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); |
| 104 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream); | 109 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream); |
| 110 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CheckDuckingState); |
| 105 | 111 |
| 106 struct Request; | 112 struct Request; |
| 107 | 113 |
| 108 // Private class for keeping track of opened devices and who have | 114 // Private class for keeping track of opened devices and who have |
| 109 // opened it. | 115 // opened it. |
| 110 struct Stream; | 116 struct Stream; |
| 111 | 117 |
| 112 // RenderViewObserver OVERRIDE. | 118 // RenderViewObserver OVERRIDE. |
| 113 virtual bool Send(IPC::Message* message) OVERRIDE; | 119 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 114 | 120 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 144 // been canceled. | 150 // been canceled. |
| 145 typedef std::list<Request> RequestList; | 151 typedef std::list<Request> RequestList; |
| 146 RequestList requests_; | 152 RequestList requests_; |
| 147 | 153 |
| 148 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); | 154 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); |
| 149 }; | 155 }; |
| 150 | 156 |
| 151 } // namespace content | 157 } // namespace content |
| 152 | 158 |
| 153 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 159 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
| OLD | NEW |