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

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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::kSPS: 652 case media::H264NALU::kSPS:
653 case media::H264NALU::kPPS: 653 case media::H264NALU::kPPS:
654 case media::H264NALU::kAUD:
654 case media::H264NALU::kEOSeq: 655 case media::H264NALU::kEOSeq:
acolwell GONE FROM CHROMIUM 2014/05/08 17:56:34 I think you need to also include kSEIMessage & kRe
Pawel Osciak 2014/05/09 00:37:14 Oh, I didn't notice you added new defines to the e
655 case media::H264NALU::kEOStream: 656 case media::H264NALU::kEOStream:
656 // These unconditionally signal a frame boundary. 657 // These unconditionally signal a frame boundary.
657 end_of_frame = true; 658 end_of_frame = true;
658 break; 659 break;
659 default: 660 default:
660 // For all others, keep going. 661 // For all others, keep going.
661 break; 662 break;
662 } 663 }
663 if (end_of_frame) { 664 if (end_of_frame) {
664 if (!decoder_partial_frame_pending_ && *endpos == 0) { 665 if (!decoder_partial_frame_pending_ && *endpos == 0) {
acolwell GONE FROM CHROMIUM 2014/05/08 17:56:34 I'm a little fuzzy on how this code is supposed to
Pawel Osciak 2014/05/09 00:37:14 It actually splits everything but slices of the sa
665 // The frame was previously restarted, and we haven't filled the 666 // The frame was previously restarted, and we haven't filled the
666 // current frame with any contents yet. Start the new frame here and 667 // current frame with any contents yet. Start the new frame here and
667 // continue parsing NALs. 668 // continue parsing NALs.
668 } else { 669 } else {
669 // The frame wasn't previously restarted and/or we have contents for 670 // The frame wasn't previously restarted and/or we have contents for
670 // the current frame; signal the start of a new frame here: we don't 671 // the current frame; signal the start of a new frame here: we don't
671 // have a partial frame anymore. 672 // have a partial frame anymore.
672 decoder_partial_frame_pending_ = false; 673 decoder_partial_frame_pending_ = false;
673 return true; 674 return true;
674 } 675 }
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1921 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), 1922 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width),
1922 base::checked_cast<int>(format.fmt.pix_mp.height)); 1923 base::checked_cast<int>(format.fmt.pix_mp.height));
1923 if (frame_buffer_size_ != new_size) { 1924 if (frame_buffer_size_ != new_size) {
1924 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; 1925 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected";
1925 return true; 1926 return true;
1926 } 1927 }
1927 return false; 1928 return false;
1928 } 1929 }
1929 1930
1930 } // namespace content 1931 } // 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