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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/vt_video_decode_accelerator_mac.cc
diff --git a/media/gpu/vt_video_decode_accelerator_mac.cc b/media/gpu/vt_video_decode_accelerator_mac.cc
index c16bb568f38c07ded7d189c7c7320e1f9c14fd47..1be78dbbe9d85edfb36e93eeb0f4d12dc09cbabb 100644
--- a/media/gpu/vt_video_decode_accelerator_mac.cc
+++ b/media/gpu/vt_video_decode_accelerator_mac.cc
@@ -622,8 +622,9 @@ void VTVideoDecodeAccelerator::DecodeTask(const BitstreamBuffer& bitstream,
// Compute and store frame properties. |image_size| gets filled in
// later, since it comes from the decoder configuration.
- int32_t pic_order_cnt;
- if (!poc_.ComputePicOrderCnt(sps, slice_hdr, &pic_order_cnt)) {
+ base::Optional<int32_t> pic_order_cnt =
+ poc_.ComputePicOrderCnt(sps, slice_hdr);
+ if (!pic_order_cnt.has_value()) {
DLOG(ERROR) << "Unable to compute POC";
NotifyError(UNREADABLE_INPUT, SFT_INVALID_STREAM);
return;
@@ -632,7 +633,7 @@ void VTVideoDecodeAccelerator::DecodeTask(const BitstreamBuffer& bitstream,
frame->has_slice = true;
frame->is_idr = nalu.nal_unit_type == media::H264NALU::kIDRSlice;
frame->has_mmco5 = poc_.IsPendingMMCO5();
- frame->pic_order_cnt = pic_order_cnt;
+ frame->pic_order_cnt = *pic_order_cnt;
frame->reorder_window = ComputeReorderWindow(sps);
}
« 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