| 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 // MessageFilter that handles video capture messages and delegates them to | 5 // MessageFilter that handles video capture messages and delegates them to |
| 6 // video captures. VideoCaptureMessageFilter is operated on IO thread of | 6 // video captures. VideoCaptureMessageFilter is operated on IO thread of |
| 7 // render process. It intercepts video capture messages and process them on | 7 // render process. It intercepts video capture messages and process them on |
| 8 // IO thread since these messages are time critical. | 8 // IO thread since these messages are time critical. |
| 9 | 9 |
| 10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ | 10 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 void AddDelegate(Delegate* delegate); | 73 void AddDelegate(Delegate* delegate); |
| 74 | 74 |
| 75 // Remove a delegate from the map. | 75 // Remove a delegate from the map. |
| 76 void RemoveDelegate(Delegate* delegate); | 76 void RemoveDelegate(Delegate* delegate); |
| 77 | 77 |
| 78 // Send a message asynchronously. | 78 // Send a message asynchronously. |
| 79 virtual bool Send(IPC::Message* message); | 79 virtual bool Send(IPC::Message* message); |
| 80 | 80 |
| 81 // IPC::MessageFilter override. Called on IO thread. | 81 // IPC::MessageFilter override. Called on IO thread. |
| 82 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 82 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 83 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; | 83 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; |
| 84 virtual void OnFilterRemoved() OVERRIDE; | 84 virtual void OnFilterRemoved() OVERRIDE; |
| 85 virtual void OnChannelClosing() OVERRIDE; | 85 virtual void OnChannelClosing() OVERRIDE; |
| 86 | 86 |
| 87 protected: | 87 protected: |
| 88 virtual ~VideoCaptureMessageFilter(); | 88 virtual ~VideoCaptureMessageFilter(); |
| 89 | 89 |
| 90 private: | 90 private: |
| 91 typedef std::map<int32, Delegate*> Delegates; | 91 typedef std::map<int32, Delegate*> Delegates; |
| 92 | 92 |
| 93 // Receive a newly created buffer from browser process. | 93 // Receive a newly created buffer from browser process. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const media::VideoCaptureFormats& formats_in_use); | 127 const media::VideoCaptureFormats& formats_in_use); |
| 128 | 128 |
| 129 // Finds the delegate associated with |device_id|, NULL if not found. | 129 // Finds the delegate associated with |device_id|, NULL if not found. |
| 130 Delegate* find_delegate(int device_id) const; | 130 Delegate* find_delegate(int device_id) const; |
| 131 | 131 |
| 132 // A map of device ids to delegates. | 132 // A map of device ids to delegates. |
| 133 Delegates delegates_; | 133 Delegates delegates_; |
| 134 Delegates pending_delegates_; | 134 Delegates pending_delegates_; |
| 135 int32 last_device_id_; | 135 int32 last_device_id_; |
| 136 | 136 |
| 137 IPC::Channel* channel_; | 137 IPC::Sender* sender_; |
| 138 | 138 |
| 139 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); | 139 DISALLOW_COPY_AND_ASSIGN(VideoCaptureMessageFilter); |
| 140 }; | 140 }; |
| 141 | 141 |
| 142 } // namespace content | 142 } // namespace content |
| 143 | 143 |
| 144 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ | 144 #endif // CONTENT_RENDERER_MEDIA_VIDEO_CAPTURE_MESSAGE_FILTER_H_ |
| OLD | NEW |