| Index: content/common/gpu/media/vt_video_decode_accelerator.cc
|
| diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
|
| index d4ad116c39304c12eca8c2894220897269aa7b20..d7cf558cd1b2ffb0e85d894b0e454fdf20237c69 100644
|
| --- a/content/common/gpu/media/vt_video_decode_accelerator.cc
|
| +++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
|
| @@ -359,6 +359,7 @@ void VTVideoDecodeAccelerator::DecodeTask(
|
| // Locate relevant NALUs and compute the size of the rewritten data. Also
|
| // record any parameter sets for VideoToolbox initialization.
|
| bool config_changed = false;
|
| + bool has_slice = false;
|
| size_t data_size = 0;
|
| std::vector<media::H264NALU> nalus;
|
| parser_.SetStream(buf, size);
|
| @@ -403,18 +404,14 @@ void VTVideoDecodeAccelerator::DecodeTask(
|
| case media::H264NALU::kSliceDataA:
|
| case media::H264NALU::kSliceDataB:
|
| case media::H264NALU::kSliceDataC:
|
| - DLOG(ERROR) << "Coded slide data partitions not implemented.";
|
| - NotifyError(PLATFORM_FAILURE);
|
| - return;
|
| -
|
| case media::H264NALU::kNonIDRSlice:
|
| // TODO(sandersd): Check that there has been an IDR slice since the
|
| // last reset.
|
| case media::H264NALU::kIDRSlice:
|
| - {
|
| - // TODO(sandersd): Make sure this only happens once per frame.
|
| - DCHECK_EQ(frame->pic_order_cnt, 0);
|
| -
|
| + // Compute the |pic_order_cnt| for the picture from the first slice.
|
| + // TODO(sandersd): Make sure that any further slices are part of the
|
| + // same picture or a redundant coded picture.
|
| + if (!has_slice) {
|
| media::H264SliceHeader slice_hdr;
|
| result = parser_.ParseSliceHeader(nalu, &slice_hdr);
|
| if (result != media::H264Parser::kOk) {
|
| @@ -453,6 +450,7 @@ void VTVideoDecodeAccelerator::DecodeTask(
|
| kMaxReorderQueueSize - 1);
|
| }
|
| }
|
| + has_slice = true;
|
| default:
|
| nalus.push_back(nalu);
|
| data_size += kNALUHeaderLength + nalu.size;
|
| @@ -474,9 +472,9 @@ void VTVideoDecodeAccelerator::DecodeTask(
|
| return;
|
| }
|
|
|
| - // If there are no non-configuration units, drop the bitstream buffer by
|
| - // returning an empty frame.
|
| - if (!data_size) {
|
| + // If there are no image slices, drop the bitstream buffer by returning an
|
| + // empty frame.
|
| + if (!has_slice) {
|
| if (!FinishDelayedFrames())
|
| return;
|
| gpu_task_runner_->PostTask(FROM_HERE, base::Bind(
|
|
|