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

Side by Side Diff: services/media/factory_service/audio_track_controller.cc

Issue 1915403002: ApplicationImpl::ConnectToServiceDeprecated() -> mojo::ConnectToService() conversion, part 2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh 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
« no previous file with comments | « services/js/pingpong_apptest.cc ('k') | services/media/factory_service/media_player_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <list> 5 #include <list>
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/public/cpp/application/connect.h"
9 #include "mojo/services/media/audio/interfaces/audio_server.mojom.h" 10 #include "mojo/services/media/audio/interfaces/audio_server.mojom.h"
10 #include "mojo/services/media/audio/interfaces/audio_track.mojom.h" 11 #include "mojo/services/media/audio/interfaces/audio_track.mojom.h"
11 #include "services/media/factory_service/audio_track_controller.h" 12 #include "services/media/factory_service/audio_track_controller.h"
12 #include "services/media/framework_mojo/mojo_type_conversions.h" 13 #include "services/media/framework_mojo/mojo_type_conversions.h"
13 14
14 namespace mojo { 15 namespace mojo {
15 namespace media { 16 namespace media {
16 17
17 AudioTrackController::AudioTrackController(const String& url, 18 AudioTrackController::AudioTrackController(const String& url,
18 ApplicationImpl* app) { 19 ApplicationImpl* app) {
19 // TODO(dalesat): Handle connection errors. 20 // TODO(dalesat): Handle connection errors.
20 DCHECK(app); 21 DCHECK(app);
21 22
22 AudioServerPtr audio_server; 23 AudioServerPtr audio_server;
23 app->ConnectToServiceDeprecated(url, &audio_server); 24 ConnectToService(app->shell(), url, GetProxy(&audio_server));
24 audio_server->CreateTrack(GetProxy(&audio_track_)); 25 audio_server->CreateTrack(GetProxy(&audio_track_));
25 } 26 }
26 27
27 AudioTrackController::~AudioTrackController() {} 28 AudioTrackController::~AudioTrackController() {}
28 29
29 void AudioTrackController::GetSupportedMediaTypes( 30 void AudioTrackController::GetSupportedMediaTypes(
30 const GetSupportedMediaTypesCallback& callback) { 31 const GetSupportedMediaTypesCallback& callback) {
31 // Query the track's format capabilities. 32 // Query the track's format capabilities.
32 audio_track_->Describe([this, callback](AudioTrackDescriptorPtr descriptor) { 33 audio_track_->Describe([this, callback](AudioTrackDescriptorPtr descriptor) {
33 callback(Convert(descriptor->supported_media_types)); 34 callback(Convert(descriptor->supported_media_types));
(...skipping 10 matching lines...) Expand all
44 audio_track_->Configure(config.Pass(), GetProxy(&consumer)); 45 audio_track_->Configure(config.Pass(), GetProxy(&consumer));
45 46
46 RateControlPtr rate_control; 47 RateControlPtr rate_control;
47 audio_track_->GetRateControl(GetProxy(&rate_control)); 48 audio_track_->GetRateControl(GetProxy(&rate_control));
48 49
49 callback(consumer.Pass(), rate_control.Pass()); 50 callback(consumer.Pass(), rate_control.Pass());
50 } 51 }
51 52
52 } // namespace media 53 } // namespace media
53 } // namespace mojo 54 } // namespace mojo
OLDNEW
« no previous file with comments | « services/js/pingpong_apptest.cc ('k') | services/media/factory_service/media_player_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698