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

Unified Diff: media/webm/webm_cluster_parser.cc

Issue 8921010: Revert 114030 - Adding support for incremental cluster parsing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | « media/webm/webm_cluster_parser.h ('k') | media/webm/webm_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_cluster_parser.cc
===================================================================
--- media/webm/webm_cluster_parser.cc (revision 114032)
+++ media/webm/webm_cluster_parser.cc (working copy)
@@ -26,7 +26,6 @@
audio_default_duration_(audio_default_duration),
video_track_num_(video_track_num),
video_default_duration_(video_default_duration),
- parser_(kWebMIdCluster),
last_block_timecode_(-1),
cluster_timecode_(-1) {
}
@@ -34,25 +33,12 @@
WebMClusterParser::~WebMClusterParser() {}
int WebMClusterParser::Parse(const uint8* buf, int size) {
+ last_block_timecode_ = -1;
+ cluster_timecode_ = -1;
audio_buffers_.clear();
video_buffers_.clear();
- int result = parser_.Parse(buf, size, this);
-
- if (result <= 0)
- return result;
-
- if (parser_.IsParsingComplete()) {
- // Reset the parser if we're done parsing so that
- // it is ready to accept another cluster on the next
- // call.
- parser_.Reset();
-
- last_block_timecode_ = -1;
- cluster_timecode_ = -1;
- }
-
- return result;
+ return WebMParseListElement(buf, size, kWebMIdCluster, 1, this);
}
bool WebMClusterParser::OnListStart(int id) {
@@ -81,17 +67,17 @@
}
bool WebMClusterParser::OnFloat(int id, double val) {
- DVLOG(1) << "Unexpected float element with ID " << std::hex << id;
+ VLOG(1) << "Unexpected float element with ID " << std::hex << id;
return false;
}
bool WebMClusterParser::OnBinary(int id, const uint8* data, int size) {
- DVLOG(1) << "Unexpected binary element with ID " << std::hex << id;
+ VLOG(1) << "Unexpected binary element with ID " << std::hex << id;
return false;
}
bool WebMClusterParser::OnString(int id, const std::string& str) {
- DVLOG(1) << "Unexpected string element with ID " << std::hex << id;
+ VLOG(1) << "Unexpected string element with ID " << std::hex << id;
return false;
}
@@ -99,17 +85,17 @@
int flags,
const uint8* data, int size) {
if (cluster_timecode_ == -1) {
- DVLOG(1) << "Got SimpleBlock before cluster timecode.";
+ VLOG(1) << "Got SimpleBlock before cluster timecode.";
return false;
}
if (timecode < 0) {
- DVLOG(1) << "Got SimpleBlock with negative timecode offset " << timecode;
+ VLOG(1) << "Got SimpleBlock with negative timecode offset " << timecode;
return false;
}
if (last_block_timecode_ != -1 && timecode < last_block_timecode_) {
- DVLOG(1) << "Got SimpleBlock with a timecode before the previous block.";
+ VLOG(1) << "Got SimpleBlock with a timecode before the previous block.";
return false;
}
@@ -129,13 +115,13 @@
buffer->SetDuration(video_default_duration_);
queue = &video_buffers_;
} else {
- DVLOG(1) << "Unexpected track number " << track_num;
+ VLOG(1) << "Unexpected track number " << track_num;
return false;
}
if (!queue->empty() &&
buffer->GetTimestamp() == queue->back()->GetTimestamp()) {
- DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
+ VLOG(1) << "Got SimpleBlock timecode is not strictly monotonically "
<< "increasing for track " << track_num;
return false;
}
« no previous file with comments | « media/webm/webm_cluster_parser.h ('k') | media/webm/webm_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698