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

Unified Diff: media/filters/h264_parser.cc

Issue 816353010: Implemented HEVC video demuxing and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved back h265_parser_unittest.cc in media/BUILD.gn Created 5 years, 3 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/filters/h264_parser.h ('k') | media/filters/h265_parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/h264_parser.cc
diff --git a/media/filters/h264_parser.cc b/media/filters/h264_parser.cc
index 22d420bcc6902387f152dda6f2dc53ce5d16df65..fe2a443e32845c77575fb101baa25a6101d56567 100644
--- a/media/filters/h264_parser.cc
+++ b/media/filters/h264_parser.cc
@@ -213,6 +213,7 @@ bool H264Parser::LocateNALU(off_t* nalu_size, off_t* start_code_size) {
off_t annexb_start_code_size = 0;
if (!FindStartCodeInClearRanges(stream_, bytes_left_,
+ encrypted_ranges_,
&nalu_start_off, &annexb_start_code_size)) {
DVLOG(4) << "Could not find start code, end of stream?";
return false;
@@ -238,6 +239,7 @@ bool H264Parser::LocateNALU(off_t* nalu_size, off_t* start_code_size) {
off_t next_start_code_size = 0;
off_t nalu_size_without_start_code = 0;
if (!FindStartCodeInClearRanges(nalu_data, max_nalu_data_size,
+ encrypted_ranges_,
&nalu_size_without_start_code,
&next_start_code_size)) {
nalu_size_without_start_code = max_nalu_data_size;
@@ -250,9 +252,10 @@ bool H264Parser::LocateNALU(off_t* nalu_size, off_t* start_code_size) {
bool H264Parser::FindStartCodeInClearRanges(
const uint8* data,
off_t data_size,
+ const Ranges<const uint8*>& encrypted_ranges,
off_t* offset,
off_t* start_code_size) {
- if (encrypted_ranges_.size() == 0)
+ if (encrypted_ranges.size() == 0)
return FindStartCode(data, data_size, offset, start_code_size);
DCHECK_GE(data_size, 0);
@@ -270,7 +273,7 @@ bool H264Parser::FindStartCodeInClearRanges(
Ranges<const uint8*> start_code_range;
start_code_range.Add(start_code, start_code_end + 1);
- if (encrypted_ranges_.IntersectionWith(start_code_range).size() > 0) {
+ if (encrypted_ranges.IntersectionWith(start_code_range).size() > 0) {
// The start code is inside an encrypted section so we need to scan
// for another start code.
*start_code_size = 0;
« no previous file with comments | « media/filters/h264_parser.h ('k') | media/filters/h265_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698