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 #include "content/renderer/media/video_capture_message_filter.h" | 5 #include "content/renderer/media/video_capture_message_filter.h" |
6 | 6 |
7 #include "content/common/media/video_capture_messages.h" | 7 #include "content/common/media/video_capture_messages.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 int length, | 106 int length, |
107 int buffer_id) { | 107 int buffer_id) { |
108 Delegate* delegate = find_delegate(device_id); | 108 Delegate* delegate = find_delegate(device_id); |
109 if (!delegate) { | 109 if (!delegate) { |
110 DLOG(WARNING) << "OnBufferCreated: Got video SHM buffer for a " | 110 DLOG(WARNING) << "OnBufferCreated: Got video SHM buffer for a " |
111 "non-existent or removed video capture."; | 111 "non-existent or removed video capture."; |
112 | 112 |
113 // Send the buffer back to Host in case it's waiting for all buffers | 113 // Send the buffer back to Host in case it's waiting for all buffers |
114 // to be returned. | 114 // to be returned. |
115 base::SharedMemory::CloseHandle(handle); | 115 base::SharedMemory::CloseHandle(handle); |
116 Send(new VideoCaptureHostMsg_BufferReady(device_id, buffer_id, 0)); | 116 Send(new VideoCaptureHostMsg_BufferReady( |
| 117 device_id, buffer_id, std::vector<uint32>())); |
117 return; | 118 return; |
118 } | 119 } |
119 | 120 |
120 delegate->OnBufferCreated(handle, length, buffer_id); | 121 delegate->OnBufferCreated(handle, length, buffer_id); |
121 } | 122 } |
122 | 123 |
123 void VideoCaptureMessageFilter::OnBufferReceived( | 124 void VideoCaptureMessageFilter::OnBufferReceived( |
124 int device_id, | 125 int device_id, |
125 int buffer_id, | 126 int buffer_id, |
126 const media::VideoCaptureFormat& format, | 127 const media::VideoCaptureFormat& format, |
127 base::TimeTicks timestamp) { | 128 base::TimeTicks timestamp) { |
128 Delegate* delegate = find_delegate(device_id); | 129 Delegate* delegate = find_delegate(device_id); |
129 if (!delegate) { | 130 if (!delegate) { |
130 DLOG(WARNING) << "OnBufferReceived: Got video SHM buffer for a " | 131 DLOG(WARNING) << "OnBufferReceived: Got video SHM buffer for a " |
131 "non-existent or removed video capture."; | 132 "non-existent or removed video capture."; |
132 | 133 |
133 // Send the buffer back to Host in case it's waiting for all buffers | 134 // Send the buffer back to Host in case it's waiting for all buffers |
134 // to be returned. | 135 // to be returned. |
135 Send(new VideoCaptureHostMsg_BufferReady(device_id, buffer_id, 0)); | 136 Send(new VideoCaptureHostMsg_BufferReady( |
| 137 device_id, buffer_id, std::vector<uint32>())); |
136 return; | 138 return; |
137 } | 139 } |
138 | 140 |
139 delegate->OnBufferReceived(buffer_id, format, timestamp); | 141 delegate->OnBufferReceived(buffer_id, format, timestamp); |
140 } | 142 } |
141 | 143 |
142 void VideoCaptureMessageFilter::OnMailboxBufferReceived( | 144 void VideoCaptureMessageFilter::OnMailboxBufferReceived( |
143 int device_id, | 145 int device_id, |
144 int buffer_id, | 146 int buffer_id, |
145 const gpu::MailboxHolder& mailbox_holder, | 147 const gpu::MailboxHolder& mailbox_holder, |
146 const media::VideoCaptureFormat& format, | 148 const media::VideoCaptureFormat& format, |
147 base::TimeTicks timestamp) { | 149 base::TimeTicks timestamp) { |
148 Delegate* delegate = find_delegate(device_id); | 150 Delegate* delegate = find_delegate(device_id); |
149 | 151 |
150 if (!delegate) { | 152 if (!delegate) { |
151 DLOG(WARNING) << "OnMailboxBufferReceived: Got video mailbox buffer for a " | 153 DLOG(WARNING) << "OnMailboxBufferReceived: Got video mailbox buffer for a " |
152 "non-existent or removed video capture."; | 154 "non-existent or removed video capture."; |
153 | 155 |
154 // Send the buffer back to Host in case it's waiting for all buffers | 156 // Send the buffer back to Host in case it's waiting for all buffers |
155 // to be returned. | 157 // to be returned. |
156 Send(new VideoCaptureHostMsg_BufferReady(device_id, buffer_id, 0)); | 158 Send(new VideoCaptureHostMsg_BufferReady( |
| 159 device_id, buffer_id, std::vector<uint32>())); |
157 return; | 160 return; |
158 } | 161 } |
159 | 162 |
160 delegate->OnMailboxBufferReceived( | 163 delegate->OnMailboxBufferReceived( |
161 buffer_id, mailbox_holder, format, timestamp); | 164 buffer_id, mailbox_holder, format, timestamp); |
162 } | 165 } |
163 | 166 |
164 void VideoCaptureMessageFilter::OnBufferDestroyed( | 167 void VideoCaptureMessageFilter::OnBufferDestroyed( |
165 int device_id, | 168 int device_id, |
166 int buffer_id) { | 169 int buffer_id) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 const media::VideoCaptureFormats& formats_in_use) { | 205 const media::VideoCaptureFormats& formats_in_use) { |
203 Delegate* delegate = find_delegate(device_id); | 206 Delegate* delegate = find_delegate(device_id); |
204 if (!delegate) { | 207 if (!delegate) { |
205 DLOG(WARNING) << "OnDeviceFormatInUse: unknown device"; | 208 DLOG(WARNING) << "OnDeviceFormatInUse: unknown device"; |
206 return; | 209 return; |
207 } | 210 } |
208 delegate->OnDeviceFormatsInUseReceived(formats_in_use); | 211 delegate->OnDeviceFormatsInUseReceived(formats_in_use); |
209 } | 212 } |
210 | 213 |
211 } // namespace content | 214 } // namespace content |
OLD | NEW |