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 "media/gpu/v4l2_slice_video_decode_accelerator.h" | 5 #include "media/gpu/v4l2_slice_video_decode_accelerator.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <linux/videodev2.h> | 9 #include <linux/videodev2.h> |
10 #include <poll.h> | 10 #include <poll.h> |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1831 | 1831 |
1832 decoder_thread_task_runner_->PostTask( | 1832 decoder_thread_task_runner_->PostTask( |
1833 FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::FlushTask, | 1833 FROM_HERE, base::Bind(&V4L2SliceVideoDecodeAccelerator::FlushTask, |
1834 base::Unretained(this))); | 1834 base::Unretained(this))); |
1835 } | 1835 } |
1836 | 1836 |
1837 void V4L2SliceVideoDecodeAccelerator::FlushTask() { | 1837 void V4L2SliceVideoDecodeAccelerator::FlushTask() { |
1838 DVLOGF(3); | 1838 DVLOGF(3); |
1839 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 1839 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
1840 | 1840 |
1841 if (!decoder_input_queue_.empty()) { | 1841 // We are not done with pending inputs, so queue an empty buffer, |
Owen Lin
2016/06/17 15:57:47
Please also update the comment, how about:
Queue a
Pawel Osciak
2016/06/20 00:55:53
We actually may be done with pending inputs here a
henryhsu
2016/06/20 02:58:05
Done.
| |
1842 // We are not done with pending inputs, so queue an empty buffer, | 1842 // which - when reached - will trigger flush sequence. |
1843 // which - when reached - will trigger flush sequence. | 1843 decoder_input_queue_.push( |
1844 decoder_input_queue_.push( | 1844 linked_ptr<BitstreamBufferRef>(new BitstreamBufferRef( |
1845 linked_ptr<BitstreamBufferRef>(new BitstreamBufferRef( | 1845 decode_client_, decode_task_runner_, nullptr, kFlushBufferId))); |
1846 decode_client_, decode_task_runner_, nullptr, kFlushBufferId))); | 1846 return; |
kcwu
2016/06/17 12:17:49
delete this line
Owen Lin
2016/06/17 13:35:42
Add one line in the end:
ScheduleDecodeBufferTaskI
henryhsu
2016/06/20 02:58:05
Done.
henryhsu
2016/06/20 02:58:05
Done.
| |
1847 return; | |
1848 } | |
1849 | |
1850 // No more inputs pending, so just finish flushing here. | |
1851 InitiateFlush(); | |
1852 } | 1847 } |
1853 | 1848 |
1854 void V4L2SliceVideoDecodeAccelerator::InitiateFlush() { | 1849 void V4L2SliceVideoDecodeAccelerator::InitiateFlush() { |
1855 DVLOGF(3); | 1850 DVLOGF(3); |
1856 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 1851 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
1857 | 1852 |
1858 // This will trigger output for all remaining surfaces in the decoder. | 1853 // This will trigger output for all remaining surfaces in the decoder. |
1859 // However, not all of them may be decoded yet (they would be queued | 1854 // However, not all of them may be decoded yet (they would be queued |
1860 // in hardware then). | 1855 // in hardware then). |
1861 if (!decoder_->Flush()) { | 1856 if (!decoder_->Flush()) { |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2805 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { | 2800 V4L2SliceVideoDecodeAccelerator::GetSupportedProfiles() { |
2806 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 2801 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
2807 if (!device) | 2802 if (!device) |
2808 return SupportedProfiles(); | 2803 return SupportedProfiles(); |
2809 | 2804 |
2810 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_), | 2805 return device->GetSupportedDecodeProfiles(arraysize(supported_input_fourccs_), |
2811 supported_input_fourccs_); | 2806 supported_input_fourccs_); |
2812 } | 2807 } |
2813 | 2808 |
2814 } // namespace media | 2809 } // namespace media |
OLD | NEW |