Chromium Code Reviews| 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 <memory> | 10 #include <memory> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 virtual void CancelOpenDevice( | 68 virtual void CancelOpenDevice( |
| 69 int request_id, | 69 int request_id, |
| 70 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler); | 70 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler); |
| 71 | 71 |
| 72 // Close a started device. |label| is provided in OnDeviceOpened. | 72 // Close a started device. |label| is provided in OnDeviceOpened. |
| 73 void CloseDevice(const std::string& label); | 73 void CloseDevice(const std::string& label); |
| 74 | 74 |
| 75 // This method is called when the stream is started successfully. | 75 // This method is called when the stream is started successfully. |
| 76 void OnStreamStarted(const std::string& label); | 76 void OnStreamStarted(const std::string& label); |
| 77 | 77 |
| 78 // Get all the media devices of video capture, e.g. webcam. | |
| 79 void GetVideoCaptureDevices(StreamDeviceInfoArray& video_array); | |
|
tommi (sloooow) - chröme
2017/03/21 09:21:17
StreamDeviceInfoArray*
or change the method to re
braveyao
2017/03/22 00:45:32
Done.
I'm more comfortable to pass it in as a par
| |
| 80 | |
| 78 // Check if the label is a valid stream. | 81 // Check if the label is a valid stream. |
| 79 virtual bool IsStream(const std::string& label); | 82 virtual bool IsStream(const std::string& label); |
| 80 // Get the video session_id given a label. The label identifies a stream. | 83 // Get the video session_id given a label. The label identifies a stream. |
| 81 // index is the index in the video_device_array of the stream. | 84 // index is the index in the video_device_array of the stream. |
| 82 virtual int video_session_id(const std::string& label, int index); | 85 virtual int video_session_id(const std::string& label, int index); |
| 83 // Returns an audio session_id given a label and an index. | 86 // Returns an audio session_id given a label and an index. |
| 84 virtual int audio_session_id(const std::string& label, int index); | 87 virtual int audio_session_id(const std::string& label, int index); |
| 85 | 88 |
| 86 protected: | 89 protected: |
| 87 int GetNextIpcIdForTest() { return next_ipc_id_; } | 90 int GetNextIpcIdForTest() { return next_ipc_id_; } |
| 88 | 91 |
| 89 private: | 92 private: |
| 90 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicVideoDevice); | 93 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, BasicVideoDevice); |
| 91 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); | 94 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); |
| 92 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream); | 95 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, CancelGenerateStream); |
| 96 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, GetVideoCaptureDevices); | |
| 93 | 97 |
| 94 struct Request; | 98 struct Request; |
| 95 | 99 |
| 96 // Private class for keeping track of opened devices and who have | 100 // Private class for keeping track of opened devices and who have |
| 97 // opened it. | 101 // opened it. |
| 98 struct Stream; | 102 struct Stream; |
| 99 | 103 |
| 100 // RenderFrameObserver override. | 104 // RenderFrameObserver override. |
| 101 void OnDestruct() override; | 105 void OnDestruct() override; |
| 102 bool Send(IPC::Message* message) override; | 106 bool Send(IPC::Message* message) override; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 130 // been canceled. | 134 // been canceled. |
| 131 typedef std::list<Request> RequestList; | 135 typedef std::list<Request> RequestList; |
| 132 RequestList requests_; | 136 RequestList requests_; |
| 133 | 137 |
| 134 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); | 138 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); |
| 135 }; | 139 }; |
| 136 | 140 |
| 137 } // namespace content | 141 } // namespace content |
| 138 | 142 |
| 139 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 143 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
| OLD | NEW |