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

Side by Side Diff: media/gpu/vt_video_decode_accelerator_mac.cc

Issue 2902693002: Use base::Optional<int32_t> in H264POC::ComputePicOrderCnt(...) (Closed)
Patch Set: Created 3 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
« no previous file with comments | « media/gpu/vt_video_decode_accelerator_mac.h ('k') | media/video/h264_poc.h » ('j') | 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 "media/gpu/vt_video_decode_accelerator_mac.h" 5 #include "media/gpu/vt_video_decode_accelerator_mac.h"
6 6
7 #include <CoreVideo/CoreVideo.h> 7 #include <CoreVideo/CoreVideo.h>
8 #include <OpenGL/CGLIOSurface.h> 8 #include <OpenGL/CGLIOSurface.h>
9 #include <OpenGL/gl.h> 9 #include <OpenGL/gl.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 615
616 // Record the configuration. 616 // Record the configuration.
617 // TODO(sandersd): Ideally this would be skipped if we know there 617 // TODO(sandersd): Ideally this would be skipped if we know there
618 // have not been any parameter sets since the last frame. 618 // have not been any parameter sets since the last frame.
619 active_sps_ = last_sps_; 619 active_sps_ = last_sps_;
620 active_spsext_ = last_spsext_; 620 active_spsext_ = last_spsext_;
621 active_pps_ = last_pps_; 621 active_pps_ = last_pps_;
622 622
623 // Compute and store frame properties. |image_size| gets filled in 623 // Compute and store frame properties. |image_size| gets filled in
624 // later, since it comes from the decoder configuration. 624 // later, since it comes from the decoder configuration.
625 int32_t pic_order_cnt; 625 base::Optional<int32_t> pic_order_cnt =
626 if (!poc_.ComputePicOrderCnt(sps, slice_hdr, &pic_order_cnt)) { 626 poc_.ComputePicOrderCnt(sps, slice_hdr);
627 if (!pic_order_cnt.has_value()) {
627 DLOG(ERROR) << "Unable to compute POC"; 628 DLOG(ERROR) << "Unable to compute POC";
628 NotifyError(UNREADABLE_INPUT, SFT_INVALID_STREAM); 629 NotifyError(UNREADABLE_INPUT, SFT_INVALID_STREAM);
629 return; 630 return;
630 } 631 }
631 632
632 frame->has_slice = true; 633 frame->has_slice = true;
633 frame->is_idr = nalu.nal_unit_type == media::H264NALU::kIDRSlice; 634 frame->is_idr = nalu.nal_unit_type == media::H264NALU::kIDRSlice;
634 frame->has_mmco5 = poc_.IsPendingMMCO5(); 635 frame->has_mmco5 = poc_.IsPendingMMCO5();
635 frame->pic_order_cnt = pic_order_cnt; 636 frame->pic_order_cnt = *pic_order_cnt;
636 frame->reorder_window = ComputeReorderWindow(sps); 637 frame->reorder_window = ComputeReorderWindow(sps);
637 } 638 }
638 639
639 // Intentional fallthrough. 640 // Intentional fallthrough.
640 default: 641 default:
641 nalus.push_back(nalu); 642 nalus.push_back(nalu);
642 data_size += kNALUHeaderLength + nalu.size; 643 data_size += kNALUHeaderLength + nalu.size;
643 break; 644 break;
644 } 645 }
645 } 646 }
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 SupportedProfile profile; 1227 SupportedProfile profile;
1227 profile.profile = supported_profile; 1228 profile.profile = supported_profile;
1228 profile.min_resolution.SetSize(16, 16); 1229 profile.min_resolution.SetSize(16, 16);
1229 profile.max_resolution.SetSize(4096, 2160); 1230 profile.max_resolution.SetSize(4096, 2160);
1230 profiles.push_back(profile); 1231 profiles.push_back(profile);
1231 } 1232 }
1232 return profiles; 1233 return profiles;
1233 } 1234 }
1234 1235
1235 } // namespace media 1236 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/vt_video_decode_accelerator_mac.h ('k') | media/video/h264_poc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698