OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_state.h" | 5 #include "media/filters/source_buffer_state.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 if (state_ == PENDING_PARSER_CONFIG) | 788 if (state_ == PENDING_PARSER_CONFIG) |
789 state_ = PENDING_PARSER_INIT; | 789 state_ = PENDING_PARSER_INIT; |
790 DCHECK(!init_segment_received_cb_.is_null()); | 790 DCHECK(!init_segment_received_cb_.is_null()); |
791 init_segment_received_cb_.Run(std::move(tracks)); | 791 init_segment_received_cb_.Run(std::move(tracks)); |
792 } | 792 } |
793 | 793 |
794 return success; | 794 return success; |
795 } | 795 } |
796 | 796 |
797 void SourceBufferState::SetStreamMemoryLimits() { | 797 void SourceBufferState::SetStreamMemoryLimits() { |
798 auto cmd_line = base::CommandLine::ForCurrentProcess(); | 798 auto* cmd_line = base::CommandLine::ForCurrentProcess(); |
799 | 799 |
800 std::string audio_buf_limit_switch = | 800 std::string audio_buf_limit_switch = |
801 cmd_line->GetSwitchValueASCII(switches::kMSEAudioBufferSizeLimit); | 801 cmd_line->GetSwitchValueASCII(switches::kMSEAudioBufferSizeLimit); |
802 unsigned audio_buf_size_limit = 0; | 802 unsigned audio_buf_size_limit = 0; |
803 if (base::StringToUint(audio_buf_limit_switch, &audio_buf_size_limit) && | 803 if (base::StringToUint(audio_buf_limit_switch, &audio_buf_size_limit) && |
804 audio_buf_size_limit > 0) { | 804 audio_buf_size_limit > 0) { |
805 MEDIA_LOG(INFO, media_log_) | 805 MEDIA_LOG(INFO, media_log_) |
806 << "Custom audio per-track SourceBuffer size limit=" | 806 << "Custom audio per-track SourceBuffer size limit=" |
807 << audio_buf_size_limit; | 807 << audio_buf_size_limit; |
808 for (const auto& it : audio_streams_) { | 808 for (const auto& it : audio_streams_) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 } | 908 } |
909 void SourceBufferState::OnSourceInitDone( | 909 void SourceBufferState::OnSourceInitDone( |
910 const StreamParser::InitParameters& params) { | 910 const StreamParser::InitParameters& params) { |
911 DCHECK_EQ(state_, PENDING_PARSER_INIT); | 911 DCHECK_EQ(state_, PENDING_PARSER_INIT); |
912 state_ = PARSER_INITIALIZED; | 912 state_ = PARSER_INITIALIZED; |
913 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset; | 913 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset; |
914 base::ResetAndReturn(&init_cb_).Run(params); | 914 base::ResetAndReturn(&init_cb_).Run(params); |
915 } | 915 } |
916 | 916 |
917 } // namespace media | 917 } // namespace media |
OLD | NEW |