OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, Basic); | 52 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, Basic); |
53 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); | 53 FRIEND_TEST_ALL_PREFIXES(MediaStreamDispatcherTest, TestFailure); |
54 | 54 |
55 struct Request; | 55 struct Request; |
56 | 56 |
57 // Private class for keeping track of opened devices and who have | 57 // Private class for keeping track of opened devices and who have |
58 // opened it. | 58 // opened it. |
59 struct Stream; | 59 struct Stream; |
60 | 60 |
61 // Messages from the browser. | 61 // Messages from the browser. |
62 virtual bool OnMessageReceived(const IPC::Message& message); | 62 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
63 void OnStreamGenerated( | 63 void OnStreamGenerated( |
64 int request_id, | 64 int request_id, |
65 const std::string& label, | 65 const std::string& label, |
66 const media_stream::StreamDeviceInfoArray& audio_array, | 66 const media_stream::StreamDeviceInfoArray& audio_array, |
67 const media_stream::StreamDeviceInfoArray& video_array); | 67 const media_stream::StreamDeviceInfoArray& video_array); |
68 void OnStreamGenerationFailed(int request_id); | 68 void OnStreamGenerationFailed(int request_id); |
69 void OnVideoDeviceFailed(const std::string& label, int index); | 69 void OnVideoDeviceFailed(const std::string& label, int index); |
70 void OnAudioDeviceFailed(const std::string& label, int index); | 70 void OnAudioDeviceFailed(const std::string& label, int index); |
71 | 71 |
72 int next_ipc_id_; | 72 int next_ipc_id_; |
73 typedef std::map<std::string, Stream> LabelStreamMap; | 73 typedef std::map<std::string, Stream> LabelStreamMap; |
74 LabelStreamMap label_stream_map_; | 74 LabelStreamMap label_stream_map_; |
75 | 75 |
76 // List of calls made to GenerateStream that has not yet completed. | 76 // List of calls made to GenerateStream that has not yet completed. |
77 typedef std::list<Request> RequestList; | 77 typedef std::list<Request> RequestList; |
78 RequestList requests_; | 78 RequestList requests_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); | 80 DISALLOW_COPY_AND_ASSIGN(MediaStreamDispatcher); |
81 }; | 81 }; |
82 | 82 |
83 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ | 83 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_DISPATCHER_H_ |
OLD | NEW |