Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc

Issue 1369673002: H264Decoder: Handle gaps in frame_num. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1770 void V4L2SliceVideoDecodeAccelerator::V4L2H264Accelerator::H264DPBToV4L2DPB( 1770 void V4L2SliceVideoDecodeAccelerator::V4L2H264Accelerator::H264DPBToV4L2DPB(
1771 const H264DPB& dpb, 1771 const H264DPB& dpb,
1772 std::vector<scoped_refptr<V4L2DecodeSurface>>* ref_surfaces) { 1772 std::vector<scoped_refptr<V4L2DecodeSurface>>* ref_surfaces) {
1773 memset(v4l2_decode_param_.dpb, 0, sizeof(v4l2_decode_param_.dpb)); 1773 memset(v4l2_decode_param_.dpb, 0, sizeof(v4l2_decode_param_.dpb));
1774 size_t i = 0; 1774 size_t i = 0;
1775 for (const auto& pic : dpb) { 1775 for (const auto& pic : dpb) {
1776 if (i >= arraysize(v4l2_decode_param_.dpb)) { 1776 if (i >= arraysize(v4l2_decode_param_.dpb)) {
1777 DVLOG(1) << "Invalid DPB size"; 1777 DVLOG(1) << "Invalid DPB size";
1778 break; 1778 break;
1779 } 1779 }
1780
1781 int index = VIDEO_MAX_FRAME;
1782 if (!pic->nonexisting) {
1783 scoped_refptr<V4L2DecodeSurface> dec_surface =
1784 H264PictureToV4L2DecodeSurface(pic);
1785 index = dec_surface->output_record();
1786 ref_surfaces->push_back(dec_surface);
1787 }
1788
1780 struct v4l2_h264_dpb_entry& entry = v4l2_decode_param_.dpb[i++]; 1789 struct v4l2_h264_dpb_entry& entry = v4l2_decode_param_.dpb[i++];
1781 scoped_refptr<V4L2DecodeSurface> dec_surface = 1790 entry.buf_index = index;
1782 H264PictureToV4L2DecodeSurface(pic);
1783 entry.buf_index = dec_surface->output_record();
1784 entry.frame_num = pic->frame_num; 1791 entry.frame_num = pic->frame_num;
1785 entry.pic_num = pic->pic_num; 1792 entry.pic_num = pic->pic_num;
1786 entry.top_field_order_cnt = pic->top_field_order_cnt; 1793 entry.top_field_order_cnt = pic->top_field_order_cnt;
1787 entry.bottom_field_order_cnt = pic->bottom_field_order_cnt; 1794 entry.bottom_field_order_cnt = pic->bottom_field_order_cnt;
1788 entry.flags = (pic->ref ? V4L2_H264_DPB_ENTRY_FLAG_ACTIVE : 0) | 1795 entry.flags = (pic->ref ? V4L2_H264_DPB_ENTRY_FLAG_ACTIVE : 0) |
1789 (pic->long_term ? V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM : 0); 1796 (pic->long_term ? V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM : 0);
1790
1791 ref_surfaces->push_back(dec_surface);
1792 } 1797 }
1793 } 1798 }
1794 1799
1795 bool V4L2SliceVideoDecodeAccelerator::V4L2H264Accelerator::SubmitFrameMetadata( 1800 bool V4L2SliceVideoDecodeAccelerator::V4L2H264Accelerator::SubmitFrameMetadata(
1796 const media::H264SPS* sps, 1801 const media::H264SPS* sps,
1797 const media::H264PPS* pps, 1802 const media::H264PPS* pps,
1798 const H264DPB& dpb, 1803 const H264DPB& dpb,
1799 const H264Picture::Vector& ref_pic_listp0, 1804 const H264Picture::Vector& ref_pic_listp0,
1800 const H264Picture::Vector& ref_pic_listb0, 1805 const H264Picture::Vector& ref_pic_listb0,
1801 const H264Picture::Vector& ref_pic_listb1, 1806 const H264Picture::Vector& ref_pic_listb1,
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
2533 if (!device) 2538 if (!device)
2534 return SupportedProfiles(); 2539 return SupportedProfiles();
2535 2540
2536 const uint32_t supported_formats[] = { 2541 const uint32_t supported_formats[] = {
2537 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME}; 2542 V4L2_PIX_FMT_H264_SLICE, V4L2_PIX_FMT_VP8_FRAME};
2538 return device->GetSupportedDecodeProfiles(arraysize(supported_formats), 2543 return device->GetSupportedDecodeProfiles(arraysize(supported_formats),
2539 supported_formats); 2544 supported_formats);
2540 } 2545 }
2541 2546
2542 } // namespace content 2547 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698