Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/formats/mp2t/es_parser_adts.h" | 5 #include "media/formats/mp2t/es_parser_adts.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 | 152 |
| 153 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 153 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 154 // type and allow multiple audio tracks. See https://crbug.com/341581. | 154 // type and allow multiple audio tracks. See https://crbug.com/341581. |
| 155 scoped_refptr<StreamParserBuffer> stream_parser_buffer = | 155 scoped_refptr<StreamParserBuffer> stream_parser_buffer = |
| 156 StreamParserBuffer::CopyFrom( | 156 StreamParserBuffer::CopyFrom( |
| 157 adts_frame.data, | 157 adts_frame.data, |
| 158 adts_frame.size, | 158 adts_frame.size, |
| 159 is_key_frame, | 159 is_key_frame, |
| 160 DemuxerStream::AUDIO, 0); | 160 DemuxerStream::AUDIO, 0); |
| 161 stream_parser_buffer->set_timestamp(current_pts); | 161 stream_parser_buffer->set_timestamp(current_pts); |
| 162 stream_parser_buffer->SetDecodeTimestamp( | |
|
wolenetz
2014/09/05 21:18:49
If not set, buffer's DTS will be assumed to be PTS
damienv1
2014/09/05 21:52:03
Yes, I know. But this implicit DTS assignment is n
| |
| 163 DecodeTimestamp::FromPresentationTime(current_pts)); | |
| 162 stream_parser_buffer->set_duration(frame_duration); | 164 stream_parser_buffer->set_duration(frame_duration); |
| 163 emit_buffer_cb_.Run(stream_parser_buffer); | 165 emit_buffer_cb_.Run(stream_parser_buffer); |
| 164 | 166 |
| 165 // Update the PTS of the next frame. | 167 // Update the PTS of the next frame. |
| 166 audio_timestamp_helper_->AddFrames(kSamplesPerAACFrame); | 168 audio_timestamp_helper_->AddFrames(kSamplesPerAACFrame); |
| 167 | 169 |
| 168 // Skip the current frame. | 170 // Skip the current frame. |
| 169 SkipAdtsFrame(adts_frame); | 171 SkipAdtsFrame(adts_frame); |
| 170 } | 172 } |
| 171 | 173 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 // Audio config notification. | 251 // Audio config notification. |
| 250 last_audio_decoder_config_ = audio_decoder_config; | 252 last_audio_decoder_config_ = audio_decoder_config; |
| 251 new_audio_config_cb_.Run(audio_decoder_config); | 253 new_audio_config_cb_.Run(audio_decoder_config); |
| 252 } | 254 } |
| 253 | 255 |
| 254 return true; | 256 return true; |
| 255 } | 257 } |
| 256 | 258 |
| 257 } // namespace mp2t | 259 } // namespace mp2t |
| 258 } // namespace media | 260 } // namespace media |
| OLD | NEW |