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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { | 1259 void V4L2SliceVideoDecodeAccelerator::FinishSurfaceSetChangeIfNeeded() { |
1260 DVLOGF(2); | 1260 DVLOGF(2); |
1261 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); | 1261 DCHECK(decoder_thread_proxy_->BelongsToCurrentThread()); |
1262 | 1262 |
1263 if (!surface_set_change_pending_ || !surfaces_at_device_.empty()) | 1263 if (!surface_set_change_pending_ || !surfaces_at_device_.empty()) |
1264 return; | 1264 return; |
1265 | 1265 |
1266 DCHECK_EQ(state_, kIdle); | 1266 DCHECK_EQ(state_, kIdle); |
1267 DCHECK(decoder_display_queue_.empty()); | 1267 DCHECK(decoder_display_queue_.empty()); |
| 1268 // All output buffers should've been returned from decoder and device by now. |
| 1269 DCHECK_EQ(free_output_buffers_.size(), output_buffer_map_.size()); |
1268 | 1270 |
1269 // Keep input queue running while we switch outputs. | 1271 // Keep input queue running while we switch outputs. |
1270 if (!StopDevicePoll(true)) { | 1272 if (!StopDevicePoll(true)) { |
1271 NOTIFY_ERROR(PLATFORM_FAILURE); | 1273 NOTIFY_ERROR(PLATFORM_FAILURE); |
1272 return; | 1274 return; |
1273 } | 1275 } |
1274 | 1276 |
1275 // This will return only once all buffers are dismissed and destroyed. | 1277 // This will return only once all buffers are dismissed and destroyed. |
1276 // This does not wait until they are displayed however, as display retains | 1278 // This does not wait until they are displayed however, as display retains |
1277 // references to the buffers bound to textures and will release them | 1279 // references to the buffers bound to textures and will release them |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 DCHECK_GT(picture_clearing_count_, 0); | 2460 DCHECK_GT(picture_clearing_count_, 0); |
2459 picture_clearing_count_--; | 2461 picture_clearing_count_--; |
2460 SendPictureReady(); | 2462 SendPictureReady(); |
2461 } | 2463 } |
2462 | 2464 |
2463 bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() { | 2465 bool V4L2SliceVideoDecodeAccelerator::CanDecodeOnIOThread() { |
2464 return true; | 2466 return true; |
2465 } | 2467 } |
2466 | 2468 |
2467 } // namespace content | 2469 } // namespace content |
OLD | NEW |