OLD | NEW |
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/mojo/services/mojo_renderer_service.h" | 5 #include "media/mojo/services/mojo_renderer_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "media/audio/null_audio_sink.h" | 9 #include "media/audio/null_audio_sink.h" |
10 #include "media/base/audio_decoder.h" | 10 #include "media/base/audio_decoder.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual void Create( | 37 virtual void Create( |
38 mojo::ApplicationConnection* connection, | 38 mojo::ApplicationConnection* connection, |
39 mojo::InterfaceRequest<mojo::MediaRenderer> request) OVERRIDE { | 39 mojo::InterfaceRequest<mojo::MediaRenderer> request) OVERRIDE { |
40 mojo::BindToRequest(new MojoRendererService(connection), &request); | 40 mojo::BindToRequest(new MojoRendererService(connection), &request); |
41 } | 41 } |
42 }; | 42 }; |
43 | 43 |
44 MojoRendererService::MojoRendererService( | 44 MojoRendererService::MojoRendererService( |
45 mojo::ApplicationConnection* connection) | 45 mojo::ApplicationConnection* connection) |
46 : hardware_config_(AudioParameters(), AudioParameters()), | 46 : hardware_config_(AudioParameters(), AudioParameters()), |
47 weak_factory_(this), | 47 weak_factory_(this) { |
48 weak_this_(weak_factory_.GetWeakPtr()) { | 48 weak_this_ = weak_factory_.GetWeakPtr(); |
49 scoped_refptr<base::SingleThreadTaskRunner> runner( | 49 scoped_refptr<base::SingleThreadTaskRunner> runner( |
50 base::MessageLoop::current()->task_runner()); | 50 base::MessageLoop::current()->task_runner()); |
51 scoped_refptr<MediaLog> media_log(new MediaLog()); | 51 scoped_refptr<MediaLog> media_log(new MediaLog()); |
52 audio_renderer_.reset(new AudioRendererImpl( | 52 audio_renderer_.reset(new AudioRendererImpl( |
53 runner, | 53 runner, |
54 // TODO(tim): We should use |connection| passed to MojoRendererService | 54 // TODO(tim): We should use |connection| passed to MojoRendererService |
55 // to connect to a MojoAudioRendererSink implementation that we would | 55 // to connect to a MojoAudioRendererSink implementation that we would |
56 // wrap in an AudioRendererSink and pass in here. | 56 // wrap in an AudioRendererSink and pass in here. |
57 new NullAudioSink(runner), | 57 new NullAudioSink(runner), |
58 // TODO(tim): Figure out how to select decoders. | 58 // TODO(tim): Figure out how to select decoders. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void MojoRendererService::OnError(PipelineStatus error) { | 132 void MojoRendererService::OnError(PipelineStatus error) { |
133 client()->OnError(); | 133 client()->OnError(); |
134 } | 134 } |
135 | 135 |
136 } // namespace media | 136 } // namespace media |
137 | 137 |
138 MojoResult MojoMain(MojoHandle shell_handle) { | 138 MojoResult MojoMain(MojoHandle shell_handle) { |
139 mojo::ApplicationRunnerChromium runner(new media::MojoRendererApplication); | 139 mojo::ApplicationRunnerChromium runner(new media::MojoRendererApplication); |
140 return runner.Run(shell_handle); | 140 return runner.Run(shell_handle); |
141 } | 141 } |
OLD | NEW |