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