Chromium Code Reviews| 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 "media/gpu/v4l2_video_decode_accelerator.h" | 5 #include "media/gpu/v4l2_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <fcntl.h> | 9 #include <fcntl.h> |
| 10 #include <linux/videodev2.h> | 10 #include <linux/videodev2.h> |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 641 if (decoder_state_ != kInitialized && decoder_state_ != kDecoding) { | 641 if (decoder_state_ != kInitialized && decoder_state_ != kDecoding) { |
| 642 DVLOGF(2) << "early out: state=" << decoder_state_; | 642 DVLOGF(2) << "early out: state=" << decoder_state_; |
| 643 return; | 643 return; |
| 644 } | 644 } |
| 645 | 645 |
| 646 if (decoder_current_bitstream_buffer_ == NULL) { | 646 if (decoder_current_bitstream_buffer_ == NULL) { |
| 647 if (decoder_input_queue_.empty()) { | 647 if (decoder_input_queue_.empty()) { |
| 648 // We're waiting for a new buffer -- exit without scheduling a new task. | 648 // We're waiting for a new buffer -- exit without scheduling a new task. |
| 649 return; | 649 return; |
| 650 } | 650 } |
| 651 linked_ptr<BitstreamBufferRef>& buffer_ref = decoder_input_queue_.front(); | 651 std::unique_ptr<BitstreamBufferRef>& buffer_ref = |
|
sandersd (OOO until July 31)
2016/09/13 18:30:59
This change does not make sense to me, since the q
| |
| 652 decoder_input_queue_.front(); | |
| 652 if (decoder_delay_bitstream_buffer_id_ == buffer_ref->input_id) { | 653 if (decoder_delay_bitstream_buffer_id_ == buffer_ref->input_id) { |
| 653 // We're asked to delay decoding on this and subsequent buffers. | 654 // We're asked to delay decoding on this and subsequent buffers. |
| 654 return; | 655 return; |
| 655 } | 656 } |
| 656 | 657 |
| 657 // Setup to use the next buffer. | 658 // Setup to use the next buffer. |
| 658 decoder_current_bitstream_buffer_.reset(buffer_ref.release()); | 659 decoder_current_bitstream_buffer_ = std::move(buffer_ref); |
| 659 decoder_input_queue_.pop(); | 660 decoder_input_queue_.pop(); |
| 660 const auto& shm = decoder_current_bitstream_buffer_->shm; | 661 const auto& shm = decoder_current_bitstream_buffer_->shm; |
| 661 if (shm) { | 662 if (shm) { |
| 662 DVLOGF(3) << "reading input_id=" | 663 DVLOGF(3) << "reading input_id=" |
| 663 << decoder_current_bitstream_buffer_->input_id | 664 << decoder_current_bitstream_buffer_->input_id |
| 664 << ", addr=" << shm->memory() << ", size=" << shm->size(); | 665 << ", addr=" << shm->memory() << ", size=" << shm->size(); |
| 665 } else { | 666 } else { |
| 666 DCHECK_EQ(decoder_current_bitstream_buffer_->input_id, kFlushBufferId); | 667 DCHECK_EQ(decoder_current_bitstream_buffer_->input_id, kFlushBufferId); |
| 667 DVLOGF(3) << "reading input_id=kFlushBufferId"; | 668 DVLOGF(3) << "reading input_id=kFlushBufferId"; |
| 668 } | 669 } |
| (...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2289 Enqueue(); | 2290 Enqueue(); |
| 2290 } | 2291 } |
| 2291 } | 2292 } |
| 2292 | 2293 |
| 2293 void V4L2VideoDecodeAccelerator::ImageProcessorError() { | 2294 void V4L2VideoDecodeAccelerator::ImageProcessorError() { |
| 2294 LOGF(ERROR) << "Image processor error"; | 2295 LOGF(ERROR) << "Image processor error"; |
| 2295 NOTIFY_ERROR(PLATFORM_FAILURE); | 2296 NOTIFY_ERROR(PLATFORM_FAILURE); |
| 2296 } | 2297 } |
| 2297 | 2298 |
| 2298 } // namespace media | 2299 } // namespace media |
| OLD | NEW |