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

Unified Diff: media/formats/mp2t/es_parser_adts.cc

Issue 497203004: Mpeg2 TS parser: Es parsing using an ES byte queue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECKs. Created 6 years, 4 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/mp2t/es_parser_adts.h ('k') | media/formats/mp2t/es_parser_h264.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/es_parser_adts.cc
diff --git a/media/formats/mp2t/es_parser_adts.cc b/media/formats/mp2t/es_parser_adts.cc
index f2a284a2004587c6a660009cd34efb878a1c0f2c..70b38fb7f61eda536eaa146619b44935c522e197 100644
--- a/media/formats/mp2t/es_parser_adts.cc
+++ b/media/formats/mp2t/es_parser_adts.cc
@@ -118,24 +118,13 @@ EsParserAdts::EsParserAdts(
bool sbr_in_mimetype)
: new_audio_config_cb_(new_audio_config_cb),
emit_buffer_cb_(emit_buffer_cb),
- sbr_in_mimetype_(sbr_in_mimetype),
- es_queue_(new media::OffsetByteQueue()) {
+ sbr_in_mimetype_(sbr_in_mimetype) {
}
EsParserAdts::~EsParserAdts() {
}
-bool EsParserAdts::Parse(const uint8* buf, int size,
- base::TimeDelta pts,
- DecodeTimestamp dts) {
- // The incoming PTS applies to the access unit that comes just after
- // the beginning of |buf|.
- if (pts != kNoTimestamp())
- pts_list_.push_back(EsPts(es_queue_->tail(), pts));
-
- // Copy the input data to the ES buffer.
- es_queue_->Push(buf, size);
-
+bool EsParserAdts::ParseFromEsQueue() {
// Look for every ADTS frame in the ES buffer.
AdtsFrame adts_frame;
while (LookForAdtsFrame(&adts_frame)) {
@@ -145,11 +134,10 @@ bool EsParserAdts::Parse(const uint8* buf, int size,
return false;
// Get the PTS & the duration of this access unit.
- while (!pts_list_.empty() &&
- pts_list_.front().first <= adts_frame.queue_offset) {
- audio_timestamp_helper_->SetBaseTimestamp(pts_list_.front().second);
- pts_list_.pop_front();
- }
+ TimingDesc current_timing_desc =
+ GetTimingDescriptor(adts_frame.queue_offset);
+ if (current_timing_desc.pts != kNoTimestamp())
+ audio_timestamp_helper_->SetBaseTimestamp(current_timing_desc.pts);
if (audio_timestamp_helper_->base_timestamp() == kNoTimestamp()) {
DVLOG(1) << "Audio frame with unknown timestamp";
@@ -187,9 +175,7 @@ bool EsParserAdts::Parse(const uint8* buf, int size,
void EsParserAdts::Flush() {
}
-void EsParserAdts::Reset() {
- es_queue_.reset(new media::OffsetByteQueue());
- pts_list_.clear();
+void EsParserAdts::ResetInternal() {
last_audio_decoder_config_ = AudioDecoderConfig();
}
« no previous file with comments | « media/formats/mp2t/es_parser_adts.h ('k') | media/formats/mp2t/es_parser_h264.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698