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

Side by Side Diff: media/filters/source_buffer_stream.cc

Issue 177333003: Add support for midstream audio configuration changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ABS
Patch Set: Created 6 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/source_buffer_stream.h" 5 #include "media/filters/source_buffer_stream.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) { 1324 bool SourceBufferStream::UpdateAudioConfig(const AudioDecoderConfig& config) {
1325 DCHECK(!audio_configs_.empty()); 1325 DCHECK(!audio_configs_.empty());
1326 DCHECK(video_configs_.empty()); 1326 DCHECK(video_configs_.empty());
1327 DVLOG(3) << "UpdateAudioConfig."; 1327 DVLOG(3) << "UpdateAudioConfig.";
1328 1328
1329 if (audio_configs_[0].codec() != config.codec()) { 1329 if (audio_configs_[0].codec() != config.codec()) {
1330 MEDIA_LOG(log_cb_) << "Audio codec changes not allowed."; 1330 MEDIA_LOG(log_cb_) << "Audio codec changes not allowed.";
1331 return false; 1331 return false;
1332 } 1332 }
1333 1333
1334 if (audio_configs_[0].samples_per_second() != config.samples_per_second()) { 1334 /*if (audio_configs_[0].samples_per_second() != config.samples_per_second()) {
1335 MEDIA_LOG(log_cb_) << "Audio sample rate changes not allowed."; 1335 MEDIA_LOG(log_cb_) << "Audio sample rate changes not allowed.";
1336 return false; 1336 return false;
1337 } 1337 }
1338 1338
1339 if (audio_configs_[0].channel_layout() != config.channel_layout()) { 1339 if (audio_configs_[0].channel_layout() != config.channel_layout()) {
1340 MEDIA_LOG(log_cb_) << "Audio channel layout changes not allowed."; 1340 MEDIA_LOG(log_cb_) << "Audio channel layout changes not allowed.";
1341 return false; 1341 return false;
1342 } 1342 }
1343 1343
1344 if (audio_configs_[0].bits_per_channel() != config.bits_per_channel()) { 1344 if (audio_configs_[0].bits_per_channel() != config.bits_per_channel()) {
1345 MEDIA_LOG(log_cb_) << "Audio bits per channel changes not allowed."; 1345 MEDIA_LOG(log_cb_) << "Audio bits per channel changes not allowed.";
1346 return false; 1346 return false;
1347 } 1347 }*/
1348 1348
1349 if (audio_configs_[0].is_encrypted() != config.is_encrypted()) { 1349 if (audio_configs_[0].is_encrypted() != config.is_encrypted()) {
1350 MEDIA_LOG(log_cb_) << "Audio encryption changes not allowed."; 1350 MEDIA_LOG(log_cb_) << "Audio encryption changes not allowed.";
1351 return false; 1351 return false;
1352 } 1352 }
1353 1353
1354 // Check to see if the new config matches an existing one. 1354 // Check to see if the new config matches an existing one.
1355 for (size_t i = 0; i < audio_configs_.size(); ++i) { 1355 for (size_t i = 0; i < audio_configs_.size(); ++i) {
1356 if (config.Matches(audio_configs_[i])) { 1356 if (config.Matches(audio_configs_[i])) {
1357 append_config_index_ = i; 1357 append_config_index_ = i;
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 return ComputeFudgeRoom(GetApproximateDuration()); 2078 return ComputeFudgeRoom(GetApproximateDuration());
2079 } 2079 }
2080 2080
2081 base::TimeDelta SourceBufferRange::GetApproximateDuration() const { 2081 base::TimeDelta SourceBufferRange::GetApproximateDuration() const {
2082 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run(); 2082 base::TimeDelta max_interbuffer_distance = interbuffer_distance_cb_.Run();
2083 DCHECK(max_interbuffer_distance != kNoTimestamp()); 2083 DCHECK(max_interbuffer_distance != kNoTimestamp());
2084 return max_interbuffer_distance; 2084 return max_interbuffer_distance;
2085 } 2085 }
2086 2086
2087 } // namespace media 2087 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698