| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/renderer_host/media/video_capture_buffer_pool.h" | 5 #include "content/browser/renderer_host/media/video_capture_buffer_pool.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "media/base/video_util.h" | 10 #include "media/base/video_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 size_.width() / 2, // u stride | 84 size_.width() / 2, // u stride |
| 85 size_.width() / 2, // v stride | 85 size_.width() / 2, // v stride |
| 86 base_ptr, // y address | 86 base_ptr, // y address |
| 87 base_ptr + u_offset, // u address | 87 base_ptr + u_offset, // u address |
| 88 base_ptr + v_offset, // v address | 88 base_ptr + v_offset, // v address |
| 89 base::TimeDelta(), // timestamp (unused). | 89 base::TimeDelta(), // timestamp (unused). |
| 90 disposal_handler); | 90 disposal_handler); |
| 91 | 91 |
| 92 if (buffer->rotation != rotation) { | 92 if (buffer->rotation != rotation) { |
| 93 // TODO(nick): Generalize the |rotation| mechanism. | 93 // TODO(nick): Generalize the |rotation| mechanism. |
| 94 media::FillYUV(frame, 0, 128, 128); | 94 media::FillYUV(frame.get(), 0, 128, 128); |
| 95 buffer->rotation = rotation; | 95 buffer->rotation = rotation; |
| 96 } | 96 } |
| 97 | 97 |
| 98 return frame; | 98 return frame; |
| 99 } | 99 } |
| 100 | 100 |
| 101 void VideoCaptureBufferPool::HoldForConsumers( | 101 void VideoCaptureBufferPool::HoldForConsumers( |
| 102 const scoped_refptr<media::VideoFrame>& producer_held_buffer, | 102 const scoped_refptr<media::VideoFrame>& producer_held_buffer, |
| 103 int buffer_id, | 103 int buffer_id, |
| 104 int num_clients) { | 104 int num_clients) { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 buffer->held_by_producer = false; | 172 buffer->held_by_producer = false; |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool VideoCaptureBufferPool::IsAllocated() const { | 175 bool VideoCaptureBufferPool::IsAllocated() const { |
| 176 lock_.AssertAcquired(); | 176 lock_.AssertAcquired(); |
| 177 return !buffers_.empty(); | 177 return !buffers_.empty(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace content | 180 } // namespace content |
| 181 | 181 |
| OLD | NEW |