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

Unified Diff: content/common/gpu/media/vt_video_decode_accelerator.cc

Issue 776143004: Add support for redundant streams to VTVideoDecodeAccelerator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« 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