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

Side by Side Diff: media/formats/mpeg/mpeg_audio_stream_parser_base.cc

Issue 1874413003: Convert media/formats to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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/mpeg/mpeg_audio_stream_parser_base.h" 5 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h"
6 6
7 #include <memory>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
9 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
10 #include "media/base/media_tracks.h" 12 #include "media/base/media_tracks.h"
11 #include "media/base/media_util.h" 13 #include "media/base/media_util.h"
12 #include "media/base/stream_parser_buffer.h" 14 #include "media/base/stream_parser_buffer.h"
13 #include "media/base/text_track_config.h" 15 #include "media/base/text_track_config.h"
14 #include "media/base/timestamp_constants.h" 16 #include "media/base/timestamp_constants.h"
15 #include "media/base/video_decoder_config.h" 17 #include "media/base/video_decoder_config.h"
16 18
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 sample_rate, std::vector<uint8_t>(), Unencrypted(), 212 sample_rate, std::vector<uint8_t>(), Unencrypted(),
211 base::TimeDelta(), codec_delay_); 213 base::TimeDelta(), codec_delay_);
212 214
213 base::TimeDelta base_timestamp; 215 base::TimeDelta base_timestamp;
214 if (timestamp_helper_) 216 if (timestamp_helper_)
215 base_timestamp = timestamp_helper_->GetTimestamp(); 217 base_timestamp = timestamp_helper_->GetTimestamp();
216 218
217 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate)); 219 timestamp_helper_.reset(new AudioTimestampHelper(sample_rate));
218 timestamp_helper_->SetBaseTimestamp(base_timestamp); 220 timestamp_helper_->SetBaseTimestamp(base_timestamp);
219 221
220 scoped_ptr<MediaTracks> media_tracks(new MediaTracks()); 222 std::unique_ptr<MediaTracks> media_tracks(new MediaTracks());
221 if (config_.IsValidConfig()) { 223 if (config_.IsValidConfig()) {
222 media_tracks->AddAudioTrack(config_, "audio", "", "", ""); 224 media_tracks->AddAudioTrack(config_, "audio", "", "", "");
223 } 225 }
224 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap())) 226 if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap()))
225 return -1; 227 return -1;
226 228
227 if (!init_cb_.is_null()) { 229 if (!init_cb_.is_null()) {
228 InitParameters params(kInfiniteDuration()); 230 InitParameters params(kInfiniteDuration());
229 params.detected_audio_track_count = 1; 231 params.detected_audio_track_count = 1;
230 params.auto_update_timestamp_offset = true; 232 params.auto_update_timestamp_offset = true;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 if (end_of_segment) { 415 if (end_of_segment) {
414 in_media_segment_ = false; 416 in_media_segment_ = false;
415 end_of_segment_cb_.Run(); 417 end_of_segment_cb_.Run();
416 } 418 }
417 419
418 timestamp_helper_->SetBaseTimestamp(base::TimeDelta()); 420 timestamp_helper_->SetBaseTimestamp(base::TimeDelta());
419 return true; 421 return true;
420 } 422 }
421 423
422 } // namespace media 424 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698