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 "examples/media_test/media_test.h" | 5 #include "examples/media_test/media_test.h" |
6 #include "mojo/public/cpp/application/connect.h" | 6 #include "mojo/public/cpp/application/connect.h" |
7 #include "mojo/services/media/common/cpp/timeline.h" | 7 #include "mojo/services/media/common/cpp/timeline.h" |
8 #include "mojo/services/media/common/cpp/timeline_function.h" | 8 #include "mojo/services/media/common/cpp/timeline_function.h" |
9 #include "mojo/services/media/control/interfaces/media_factory.mojom.h" | 9 #include "mojo/services/media/control/interfaces/media_factory.mojom.h" |
10 | 10 |
11 namespace mojo { | 11 namespace mojo { |
12 namespace media { | 12 namespace media { |
13 namespace examples { | 13 namespace examples { |
14 | 14 |
15 // static | 15 // static |
16 std::unique_ptr<MediaTest> MediaTest::Create( | 16 std::unique_ptr<MediaTest> MediaTest::Create( |
17 mojo::ApplicationImpl* app, | 17 mojo::Shell* shell, |
18 const std::string& input_file_name) { | 18 const std::string& input_file_name) { |
19 return std::unique_ptr<MediaTest>(new MediaTest(app, input_file_name)); | 19 return std::unique_ptr<MediaTest>(new MediaTest(shell, input_file_name)); |
20 } | 20 } |
21 | 21 |
22 MediaTest::MediaTest(mojo::ApplicationImpl* app, | 22 MediaTest::MediaTest(mojo::Shell* shell, const std::string& input_file_name) { |
23 const std::string& input_file_name) { | |
24 MediaFactoryPtr factory; | 23 MediaFactoryPtr factory; |
25 ConnectToService(app->shell(), "mojo:media_factory", GetProxy(&factory)); | 24 ConnectToService(shell, "mojo:media_factory", GetProxy(&factory)); |
26 | 25 |
27 SeekingReaderPtr reader; | 26 SeekingReaderPtr reader; |
28 factory->CreateNetworkReader(input_file_name, GetProxy(&reader)); | 27 factory->CreateNetworkReader(input_file_name, GetProxy(&reader)); |
29 factory->CreatePlayer(reader.Pass(), GetProxy(&media_player_)); | 28 factory->CreatePlayer(reader.Pass(), GetProxy(&media_player_)); |
30 | 29 |
31 HandleStatusUpdates(); | 30 HandleStatusUpdates(); |
32 } | 31 } |
33 | 32 |
34 MediaTest::~MediaTest() {} | 33 MediaTest::~MediaTest() {} |
35 | 34 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Request a status update. | 78 // Request a status update. |
80 media_player_->GetStatus( | 79 media_player_->GetStatus( |
81 version, [this](uint64_t version, MediaPlayerStatusPtr status) { | 80 version, [this](uint64_t version, MediaPlayerStatusPtr status) { |
82 HandleStatusUpdates(version, status.Pass()); | 81 HandleStatusUpdates(version, status.Pass()); |
83 }); | 82 }); |
84 } | 83 } |
85 | 84 |
86 } // namespace examples | 85 } // namespace examples |
87 } // namespace media | 86 } // namespace media |
88 } // namespace mojo | 87 } // namespace mojo |
OLD | NEW |