Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: content/renderer/media/video_capture_message_filter.cc

Issue 2398463003: 16 bit capture and GPU&CPU memory buffer support.
Patch Set: fixes. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "ipc/ipc_sender.h" 9 #include "ipc/ipc_sender.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return; 118 return;
119 } 119 }
120 120
121 delegate->OnBufferCreated(handle, length, buffer_id); 121 delegate->OnBufferCreated(handle, length, buffer_id);
122 } 122 }
123 123
124 void VideoCaptureMessageFilter::OnBufferCreated2( 124 void VideoCaptureMessageFilter::OnBufferCreated2(
125 int device_id, 125 int device_id,
126 const std::vector<gfx::GpuMemoryBufferHandle>& handles, 126 const std::vector<gfx::GpuMemoryBufferHandle>& handles,
127 const gfx::Size& size, 127 const gfx::Size& size,
128 media::VideoPixelFormat format,
128 int buffer_id) { 129 int buffer_id) {
129 Delegate* const delegate = find_delegate(device_id); 130 Delegate* const delegate = find_delegate(device_id);
130 if (!delegate) { 131 if (!delegate) {
131 DLOG(WARNING) << "OnBufferCreated: Got video GMB buffer for a " 132 DLOG(WARNING) << "OnBufferCreated: Got video GMB buffer for a "
132 "non-existent or removed video capture."; 133 "non-existent or removed video capture.";
133 Send(new VideoCaptureHostMsg_BufferReady( 134 Send(new VideoCaptureHostMsg_BufferReady(
134 device_id, buffer_id, gpu::SyncToken() /* release_sync_token */, 135 device_id, buffer_id, gpu::SyncToken() /* release_sync_token */,
135 -1.0 /* consumer_resource_utilization */)); 136 -1.0 /* consumer_resource_utilization */));
136 return; 137 return;
137 } 138 }
138 139
139 delegate->OnBufferCreated2(handles, size, buffer_id); 140 delegate->OnBufferCreated2(handles, size, format, buffer_id);
140 } 141 }
141 142
142 void VideoCaptureMessageFilter::OnBufferReceived( 143 void VideoCaptureMessageFilter::OnBufferReceived(
143 const VideoCaptureMsg_BufferReady_Params& params) { 144 const VideoCaptureMsg_BufferReady_Params& params) {
144 Delegate* const delegate = find_delegate(params.device_id); 145 Delegate* const delegate = find_delegate(params.device_id);
145 if (!delegate) { 146 if (!delegate) {
146 DLOG(WARNING) << "OnBufferReceived: Got video SHM buffer for a " 147 DLOG(WARNING) << "OnBufferReceived: Got video SHM buffer for a "
147 "non-existent or removed video capture."; 148 "non-existent or removed video capture.";
148 149
149 // Send the buffer back to Host in case it's waiting for all buffers 150 // Send the buffer back to Host in case it's waiting for all buffers
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 const media::VideoCaptureFormats& formats_in_use) { 203 const media::VideoCaptureFormats& formats_in_use) {
203 Delegate* const delegate = find_delegate(device_id); 204 Delegate* const delegate = find_delegate(device_id);
204 if (!delegate) { 205 if (!delegate) {
205 DLOG(WARNING) << "OnDeviceFormatInUse: unknown device"; 206 DLOG(WARNING) << "OnDeviceFormatInUse: unknown device";
206 return; 207 return;
207 } 208 }
208 delegate->OnDeviceFormatsInUseReceived(formats_in_use); 209 delegate->OnDeviceFormatsInUseReceived(formats_in_use);
209 } 210 }
210 211
211 } // namespace content 212 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/video_capture_message_filter.h ('k') | content/renderer/media/video_capture_message_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698