| 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 // Notes about usage of this object by VideoCaptureImplManager. | 5 // Notes about usage of this object by VideoCaptureImplManager. |
| 6 // | 6 // |
| 7 // VideoCaptureImplManager access this object by using a Unretained() | 7 // VideoCaptureImplManager access this object by using a Unretained() |
| 8 // binding and tasks on the IO thread. It is then important that | 8 // binding and tasks on the IO thread. It is then important that |
| 9 // VideoCaptureImpl never post task to itself. All operations must be | 9 // VideoCaptureImpl never post task to itself. All operations must be |
| 10 // synchronous. | 10 // synchronous. |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 TRACE_EVENT_INSTANT2( | 231 TRACE_EVENT_INSTANT2( |
| 232 "cast_perf_test", "OnBufferReceived", | 232 "cast_perf_test", "OnBufferReceived", |
| 233 TRACE_EVENT_SCOPE_THREAD, | 233 TRACE_EVENT_SCOPE_THREAD, |
| 234 "timestamp", timestamp.ToInternalValue(), | 234 "timestamp", timestamp.ToInternalValue(), |
| 235 "time_delta", (timestamp - first_frame_timestamp_).ToInternalValue()); | 235 "time_delta", (timestamp - first_frame_timestamp_).ToInternalValue()); |
| 236 | 236 |
| 237 const ClientBufferMap::const_iterator iter = client_buffers_.find(buffer_id); | 237 const ClientBufferMap::const_iterator iter = client_buffers_.find(buffer_id); |
| 238 DCHECK(iter != client_buffers_.end()); | 238 DCHECK(iter != client_buffers_.end()); |
| 239 scoped_refptr<ClientBuffer> buffer = iter->second; | 239 scoped_refptr<ClientBuffer> buffer = iter->second; |
| 240 scoped_refptr<media::VideoFrame> frame = | 240 scoped_refptr<media::VideoFrame> frame = |
| 241 media::VideoFrame::WrapExternalPackedMemory( | 241 media::VideoFrame::WrapExternalSharedMemory( |
| 242 media::VideoFrame::I420, | 242 media::VideoFrame::I420, |
| 243 coded_size, | 243 coded_size, |
| 244 visible_rect, | 244 visible_rect, |
| 245 gfx::Size(visible_rect.width(), visible_rect.height()), | 245 gfx::Size(visible_rect.width(), visible_rect.height()), |
| 246 reinterpret_cast<uint8*>(buffer->buffer->memory()), | 246 reinterpret_cast<uint8*>(buffer->buffer->memory()), |
| 247 buffer->buffer_size, | 247 buffer->buffer_size, |
| 248 buffer->buffer->handle(), | 248 buffer->buffer->handle(), |
| 249 0, | 249 0, |
| 250 timestamp - first_frame_timestamp_); | 250 timestamp - first_frame_timestamp_); |
| 251 frame->AddDestructionObserver( | 251 frame->AddDestructionObserver( |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 const ClientInfoMap::iterator it = clients->find(client_id); | 423 const ClientInfoMap::iterator it = clients->find(client_id); |
| 424 if (it != clients->end()) { | 424 if (it != clients->end()) { |
| 425 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); | 425 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); |
| 426 clients->erase(it); | 426 clients->erase(it); |
| 427 found = true; | 427 found = true; |
| 428 } | 428 } |
| 429 return found; | 429 return found; |
| 430 } | 430 } |
| 431 | 431 |
| 432 } // namespace content | 432 } // namespace content |
| OLD | NEW |