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

Unified Diff: media/formats/mp4/avc.cc

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: fix build break on Android Created 3 years, 10 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/formats/mp4/avc.h ('k') | media/formats/mp4/avc_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/avc.cc
diff --git a/media/formats/mp4/avc.cc b/media/formats/mp4/avc.cc
index 2067e51539f697a3b02ffa95e4c3ea97a2129a5f..cc49a4bd3ed895fdc8761e9ba88b0d311d4ebb0d 100644
--- a/media/formats/mp4/avc.cc
+++ b/media/formats/mp4/avc.cc
@@ -107,8 +107,10 @@ bool AVC::ConvertFrameToAnnexB(int length_size,
// static
bool AVC::InsertParamSetsAnnexB(const AVCDecoderConfigurationRecord& avc_config,
std::vector<uint8_t>* buffer,
- std::vector<SubsampleEntry>* subsamples) {
- DCHECK(AVC::IsValidAnnexB(*buffer, *subsamples));
+ std::vector<SubsampleEntry>* subsamples,
+ bool annexb_validation) {
+ if (annexb_validation)
+ DCHECK(AVC::IsValidAnnexB(*buffer, *subsamples));
std::unique_ptr<H264Parser> parser(new H264Parser());
const uint8_t* start = &(*buffer)[0];
@@ -143,7 +145,8 @@ bool AVC::InsertParamSetsAnnexB(const AVCDecoderConfigurationRecord& avc_config,
buffer->insert(config_insert_point,
param_sets.begin(), param_sets.end());
- DCHECK(AVC::IsValidAnnexB(*buffer, *subsamples));
+ if (annexb_validation)
+ DCHECK(AVC::IsValidAnnexB(*buffer, *subsamples));
return true;
}
@@ -316,7 +319,7 @@ bool AVC::IsValidAnnexB(const uint8_t* buffer,
AVCBitstreamConverter::AVCBitstreamConverter(
std::unique_ptr<AVCDecoderConfigurationRecord> avc_config)
- : avc_config_(std::move(avc_config)) {
+ : avc_config_(std::move(avc_config)), post_annexb_validation_(true) {
DCHECK(avc_config_);
}
@@ -339,7 +342,8 @@ bool AVCBitstreamConverter::ConvertFrame(
// If this is a keyframe, we (re-)inject SPS and PPS headers at the start of
// a frame. If subsample info is present, we also update the clear byte
// count for that first subsample.
- RCHECK(AVC::InsertParamSetsAnnexB(*avc_config_, frame_buf, subsamples));
+ RCHECK(AVC::InsertParamSetsAnnexB(*avc_config_, frame_buf, subsamples,
+ post_annexb_validation_));
}
DCHECK(AVC::IsValidAnnexB(*frame_buf, *subsamples));
« no previous file with comments | « media/formats/mp4/avc.h ('k') | media/formats/mp4/avc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698