OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <fcntl.h> | 5 #include <fcntl.h> |
6 #include <linux/videodev2.h> | 6 #include <linux/videodev2.h> |
7 #include <poll.h> | 7 #include <poll.h> |
8 #include <sys/eventfd.h> | 8 #include <sys/eventfd.h> |
9 #include <sys/ioctl.h> | 9 #include <sys/ioctl.h> |
10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { | 1261 void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { |
1262 DVLOGF(2); | 1262 DVLOGF(2); |
1263 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); | 1263 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
1264 | 1264 |
1265 if (!surface_set_change_pending_ || !surfaces_at_device_.empty()) | 1265 if (!surface_set_change_pending_ || !surfaces_at_device_.empty()) |
1266 return; | 1266 return; |
1267 | 1267 |
1268 DCHECK_EQ(state_, kIdle); | 1268 DCHECK_EQ(state_, kIdle); |
1269 DCHECK(decoder_display_queue_.empty()); | 1269 DCHECK(decoder_display_queue_.empty()); |
1270 // All output buffers should've been returned from decoder and device by now. | 1270 // All output buffers should've been returned from decoder and device by now. |
1271 DCHECK_EQ(free_output_buffers_.size(), output_buffer_map_.size()); | 1271 // The only remaining owner of surfaces may be display (client), and we will |
| 1272 // dismiss them when destroying output buffers below. |
| 1273 DCHECK_EQ(free_output_buffers_.size() + surfaces_at_display_.size(), |
| 1274 output_buffer_map_.size()); |
1272 | 1275 |
1273 // Keep input queue running while we switch outputs. | 1276 // Keep input queue running while we switch outputs. |
1274 if (!StopDevicePoll(true)) { | 1277 if (!StopDevicePoll(true)) { |
1275 NOTIFY_ERROR(PLATFORM_FAILURE); | 1278 NOTIFY_ERROR(PLATFORM_FAILURE); |
1276 return; | 1279 return; |
1277 } | 1280 } |
1278 | 1281 |
1279 // This will return only once all buffers are dismissed and destroyed. | 1282 // This will return only once all buffers are dismissed and destroyed. |
1280 // This does not wait until they are displayed however, as display retains | 1283 // This does not wait until they are displayed however, as display retains |
1281 // references to the buffers bound to textures and will release them | 1284 // references to the buffers bound to textures and will release them |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 DCHECK_GT(picture_clearing_count_, 0); | 2469 DCHECK_GT(picture_clearing_count_, 0); |
2467 picture_clearing_count_--; | 2470 picture_clearing_count_--; |
2468 SendPictureReady(); | 2471 SendPictureReady(); |
2469 } | 2472 } |
2470 | 2473 |
2471 bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() { | 2474 bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() { |
2472 return true; | 2475 return true; |
2473 } | 2476 } |
2474 | 2477 |
2475 } // namespace content | 2478 } // namespace content |
OLD | NEW |