OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/webm/webm_cluster_parser.h" | 5 #include "media/webm/webm_cluster_parser.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/data_buffer.h" | 8 #include "media/base/data_buffer.h" |
9 #include "media/webm/webm_constants.h" | 9 #include "media/webm/webm_constants.h" |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 audio_default_duration_(audio_default_duration), | 26 audio_default_duration_(audio_default_duration), |
27 video_track_num_(video_track_num), | 27 video_track_num_(video_track_num), |
28 video_default_duration_(video_default_duration), | 28 video_default_duration_(video_default_duration), |
29 parser_(kWebMIdCluster), | 29 parser_(kWebMIdCluster), |
30 last_block_timecode_(-1), | 30 last_block_timecode_(-1), |
31 cluster_timecode_(-1) { | 31 cluster_timecode_(-1) { |
32 } | 32 } |
33 | 33 |
34 WebMClusterParser::~WebMClusterParser() {} | 34 WebMClusterParser::~WebMClusterParser() {} |
35 | 35 |
| 36 void WebMClusterParser::Reset() { |
| 37 audio_buffers_.clear(); |
| 38 video_buffers_.clear(); |
| 39 last_block_timecode_ = -1; |
| 40 cluster_timecode_ = -1; |
| 41 parser_.Reset(); |
| 42 } |
| 43 |
36 int WebMClusterParser::Parse(const uint8* buf, int size) { | 44 int WebMClusterParser::Parse(const uint8* buf, int size) { |
37 audio_buffers_.clear(); | 45 audio_buffers_.clear(); |
38 video_buffers_.clear(); | 46 video_buffers_.clear(); |
39 | 47 |
40 int result = parser_.Parse(buf, size, this); | 48 int result = parser_.Parse(buf, size, this); |
41 | 49 |
42 if (result <= 0) | 50 if (result <= 0) |
43 return result; | 51 return result; |
44 | 52 |
45 if (parser_.IsParsingComplete()) { | 53 if (parser_.IsParsingComplete()) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " | 146 DVLOG(1) << "Got SimpleBlock timecode is not strictly monotonically " |
139 << "increasing for track " << track_num; | 147 << "increasing for track " << track_num; |
140 return false; | 148 return false; |
141 } | 149 } |
142 | 150 |
143 queue->push_back(buffer); | 151 queue->push_back(buffer); |
144 return true; | 152 return true; |
145 } | 153 } |
146 | 154 |
147 } // namespace media | 155 } // namespace media |
OLD | NEW |