#include "media/formats/mp2t/es_parser.h"
#include "media/formats/mp2t/es_parser_adts.h"
#include "media/formats/mp2t/es_parser_h264.h"
+#include "media/formats/mp2t/es_parser_mpeg1audio.h"
#include "media/formats/mp2t/mp2t_common.h"
#include "media/formats/mp2t/ts_packet.h"
#include "media/formats/mp2t/ts_section.h"
// Reset the selected PIDs.
selected_audio_pid_ = -1;
selected_video_pid_ = -1;
+
+ // Reset the timestamp unroller.
+ timestamp_unroller_.Reset();
}
bool Mp2tStreamParser::Parse(const uint8* buf, int size) {
pes_pid),
sbr_in_mimetype_));
is_audio = true;
+ } else if (stream_type == kStreamTypeMpeg1Audio) {
+ es_parser.reset(
+ new EsParserMpeg1Audio(
+ base::Bind(&Mp2tStreamParser::OnAudioConfigChanged,
+ base::Unretained(this),
+ pes_pid),
+ base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer,
+ base::Unretained(this),
+ pes_pid),
+ log_cb_));
+ is_audio = true;
} else {
return;
}
// Create the PES state here.
DVLOG(1) << "Create a new PES state";
scoped_ptr<TsSection> pes_section_parser(
- new TsSectionPes(es_parser.Pass()));
+ new TsSectionPes(es_parser.Pass(), ×tamp_unroller_));
PidState::PidType pid_type =
is_audio ? PidState::kPidAudioPes : PidState::kPidVideoPes;
scoped_ptr<PidState> pes_pid_state(
<< stream_parser_buffer->timestamp().InMilliseconds()
<< " dur="
<< stream_parser_buffer->duration().InMilliseconds();
- stream_parser_buffer->set_timestamp(
- stream_parser_buffer->timestamp() - time_offset_);
- stream_parser_buffer->SetDecodeTimestamp(
- stream_parser_buffer->GetDecodeTimestamp() - time_offset_);
// Ignore the incoming buffer if it is not associated with any config.
if (buffer_queue_chain_.empty()) {
<< stream_parser_buffer->duration().InMilliseconds()
<< " IsKeyframe="
<< stream_parser_buffer->IsKeyframe();
- stream_parser_buffer->set_timestamp(
- stream_parser_buffer->timestamp() - time_offset_);
- stream_parser_buffer->SetDecodeTimestamp(
- stream_parser_buffer->GetDecodeTimestamp() - time_offset_);
// Ignore the incoming buffer if it is not associated with any config.
if (buffer_queue_chain_.empty()) {