| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <linux/videodev2.h> | 7 #include <linux/videodev2.h> |
| 8 #include <poll.h> | 8 #include <poll.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 running_jobs_.pop(); | 554 running_jobs_.pop(); |
| 555 | 555 |
| 556 scoped_refptr<media::VideoFrame> output_frame = | 556 scoped_refptr<media::VideoFrame> output_frame = |
| 557 media::VideoFrame::WrapExternalDmabufs( | 557 media::VideoFrame::WrapExternalDmabufs( |
| 558 output_format_, | 558 output_format_, |
| 559 output_allocated_size_, | 559 output_allocated_size_, |
| 560 gfx::Rect(output_visible_size_), | 560 gfx::Rect(output_visible_size_), |
| 561 output_visible_size_, | 561 output_visible_size_, |
| 562 output_record.fds, | 562 output_record.fds, |
| 563 job_record->frame->timestamp()); | 563 job_record->frame->timestamp()); |
| 564 if (!output_frame) { |
| 565 NOTIFY_ERROR(); |
| 566 return; |
| 567 } |
| 564 output_frame->AddDestructionObserver(media::BindToCurrentLoop( | 568 output_frame->AddDestructionObserver(media::BindToCurrentLoop( |
| 565 base::Bind(&V4L2ImageProcessor::ReuseOutputBuffer, | 569 base::Bind(&V4L2ImageProcessor::ReuseOutputBuffer, |
| 566 device_weak_factory_.GetWeakPtr(), | 570 device_weak_factory_.GetWeakPtr(), |
| 567 dqbuf.index))); | 571 dqbuf.index))); |
| 568 | 572 |
| 569 DVLOG(3) << "Processing finished, returning frame, ts=" | 573 DVLOG(3) << "Processing finished, returning frame, ts=" |
| 570 << output_frame->timestamp().InMilliseconds(); | 574 << output_frame->timestamp().InMilliseconds(); |
| 571 | 575 |
| 572 child_task_runner_->PostTask( | 576 child_task_runner_->PostTask( |
| 573 FROM_HERE, base::Bind(job_record->ready_cb, output_frame)); | 577 FROM_HERE, base::Bind(job_record->ready_cb, output_frame)); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 output_record.at_device = false; | 722 output_record.at_device = false; |
| 719 if (!output_record.at_client) | 723 if (!output_record.at_client) |
| 720 free_output_buffers_.push_back(i); | 724 free_output_buffers_.push_back(i); |
| 721 } | 725 } |
| 722 output_buffer_queued_count_ = 0; | 726 output_buffer_queued_count_ = 0; |
| 723 | 727 |
| 724 return true; | 728 return true; |
| 725 } | 729 } |
| 726 | 730 |
| 727 } // namespace content | 731 } // namespace content |
| OLD | NEW |