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

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

Issue 268363018: V4L2VDA: Add more NALU types that indicate end of current frame data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ~ Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <dlfcn.h> 5 #include <dlfcn.h>
6 #include <errno.h> 6 #include <errno.h>
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <linux/videodev2.h> 8 #include <linux/videodev2.h>
9 #include <poll.h> 9 #include <poll.h>
10 #include <sys/eventfd.h> 10 #include <sys/eventfd.h>
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 // For these two, if the "first_mb_in_slice" field is zero, start a 642 // For these two, if the "first_mb_in_slice" field is zero, start a
643 // new frame and return. This field is Exp-Golomb coded starting on 643 // new frame and return. This field is Exp-Golomb coded starting on
644 // the eighth data bit of the NAL; a zero value is encoded with a 644 // the eighth data bit of the NAL; a zero value is encoded with a
645 // leading '1' bit in the byte, which we can detect as the byte being 645 // leading '1' bit in the byte, which we can detect as the byte being
646 // (unsigned) greater than or equal to 0x80. 646 // (unsigned) greater than or equal to 0x80.
647 if (nalu.data[1] >= 0x80) { 647 if (nalu.data[1] >= 0x80) {
648 end_of_frame = true; 648 end_of_frame = true;
649 break; 649 break;
650 } 650 }
651 break; 651 break;
652 case media::H264NALU::kSEIMessage:
652 case media::H264NALU::kSPS: 653 case media::H264NALU::kSPS:
653 case media::H264NALU::kPPS: 654 case media::H264NALU::kPPS:
655 case media::H264NALU::kAUD:
654 case media::H264NALU::kEOSeq: 656 case media::H264NALU::kEOSeq:
655 case media::H264NALU::kEOStream: 657 case media::H264NALU::kEOStream:
658 case media::H264NALU::kReserved14:
659 case media::H264NALU::kReserved15:
660 case media::H264NALU::kReserved16:
661 case media::H264NALU::kReserved17:
662 case media::H264NALU::kReserved18:
656 // These unconditionally signal a frame boundary. 663 // These unconditionally signal a frame boundary.
657 end_of_frame = true; 664 end_of_frame = true;
658 break; 665 break;
659 default: 666 default:
660 // For all others, keep going. 667 // For all others, keep going.
661 break; 668 break;
662 } 669 }
663 if (end_of_frame) { 670 if (end_of_frame) {
664 if (!decoder_partial_frame_pending_ && *endpos == 0) { 671 if (!decoder_partial_frame_pending_ && *endpos == 0) {
665 // The frame was previously restarted, and we haven't filled the 672 // The frame was previously restarted, and we haven't filled the
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), 1928 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width),
1922 base::checked_cast<int>(format.fmt.pix_mp.height)); 1929 base::checked_cast<int>(format.fmt.pix_mp.height));
1923 if (frame_buffer_size_ != new_size) { 1930 if (frame_buffer_size_ != new_size) {
1924 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; 1931 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected";
1925 return true; 1932 return true;
1926 } 1933 }
1927 return false; 1934 return false;
1928 } 1935 }
1929 1936
1930 } // namespace content 1937 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698