| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
| 8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
| 9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
| 10 #include "mojo/public/cpp/application/application_runner.h" | 10 #include "mojo/public/cpp/application/application_runner.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const std::set<uint16_t> PlayWAVApp::VALID_FRAME_RATES({ | 150 const std::set<uint16_t> PlayWAVApp::VALID_FRAME_RATES({ |
| 151 8000, 16000, 24000, 32000, 48000, | 151 8000, 16000, 24000, 32000, 48000, |
| 152 11025, 22050, 44100, | 152 11025, 22050, 44100, |
| 153 }); | 153 }); |
| 154 | 154 |
| 155 const std::set<uint16_t> PlayWAVApp::VALID_BITS_PER_SAMPLES({ | 155 const std::set<uint16_t> PlayWAVApp::VALID_BITS_PER_SAMPLES({ |
| 156 8, 16, | 156 8, 16, |
| 157 }); | 157 }); |
| 158 | 158 |
| 159 void PlayWAVApp::Initialize(ApplicationImpl* app) { | 159 void PlayWAVApp::Initialize(ApplicationImpl* app) { |
| 160 app->ConnectToService("mojo:audio_server", &audio_server_); | 160 app->ConnectToServiceDeprecated("mojo:audio_server", &audio_server_); |
| 161 audio_server_.set_connection_error_handler([this]() { | 161 audio_server_.set_connection_error_handler([this]() { |
| 162 OnConnectionError("audio_server"); | 162 OnConnectionError("audio_server"); |
| 163 }); | 163 }); |
| 164 | 164 |
| 165 app->ConnectToService("mojo:network_service", &network_service_); | 165 app->ConnectToServiceDeprecated("mojo:network_service", &network_service_); |
| 166 audio_server_.set_connection_error_handler([this]() { | 166 audio_server_.set_connection_error_handler([this]() { |
| 167 OnConnectionError("network_service"); | 167 OnConnectionError("network_service"); |
| 168 }); | 168 }); |
| 169 | 169 |
| 170 network_service_->CreateURLLoader(GetProxy(&url_loader_)); | 170 network_service_->CreateURLLoader(GetProxy(&url_loader_)); |
| 171 url_loader_.set_connection_error_handler([this]() { | 171 url_loader_.set_connection_error_handler([this]() { |
| 172 OnConnectionError("url_loader"); | 172 OnConnectionError("url_loader"); |
| 173 }); | 173 }); |
| 174 | 174 |
| 175 playout_complete_cbk_ = PacketCbk([this](MediaConsumer::SendResult res) { | 175 playout_complete_cbk_ = PacketCbk([this](MediaConsumer::SendResult res) { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } // namespace audio | 551 } // namespace audio |
| 552 } // namespace media | 552 } // namespace media |
| 553 } // namespace mojo | 553 } // namespace mojo |
| 554 | 554 |
| 555 MojoResult MojoMain(MojoHandle app_request) { | 555 MojoResult MojoMain(MojoHandle app_request) { |
| 556 mojo::ApplicationRunner runner( | 556 mojo::ApplicationRunner runner( |
| 557 std::unique_ptr<mojo::media::audio::examples::PlayWAVApp>( | 557 std::unique_ptr<mojo::media::audio::examples::PlayWAVApp>( |
| 558 new mojo::media::audio::examples::PlayWAVApp())); | 558 new mojo::media::audio::examples::PlayWAVApp())); |
| 559 return runner.Run(app_request); | 559 return runner.Run(app_request); |
| 560 } | 560 } |
| OLD | NEW |