OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Test application that simulates a cast sender - Data can be either generated | 5 // Test application that simulates a cast sender - Data can be either generated |
6 // or read from a file. | 6 // or read from a file. |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 VLOG(0) << "Audio stats: " << json; | 197 VLOG(0) << "Audio stats: " << json; |
198 } | 198 } |
199 | 199 |
200 } // namespace | 200 } // namespace |
201 | 201 |
202 int main(int argc, char** argv) { | 202 int main(int argc, char** argv) { |
203 base::AtExitManager at_exit; | 203 base::AtExitManager at_exit; |
204 base::CommandLine::Init(argc, argv); | 204 base::CommandLine::Init(argc, argv); |
205 InitLogging(logging::LoggingSettings()); | 205 InitLogging(logging::LoggingSettings()); |
206 | 206 |
207 // Prepare media module for FFmpeg decoding. | 207 // Load the media module for FFmpeg decoding. |
208 media::InitializeMediaLibrary(); | 208 base::FilePath path; |
| 209 PathService::Get(base::DIR_MODULE, &path); |
| 210 if (!media::InitializeMediaLibrary(path)) { |
| 211 LOG(ERROR) << "Could not initialize media library."; |
| 212 return 1; |
| 213 } |
209 | 214 |
210 base::Thread test_thread("Cast sender test app thread"); | 215 base::Thread test_thread("Cast sender test app thread"); |
211 base::Thread audio_thread("Cast audio encoder thread"); | 216 base::Thread audio_thread("Cast audio encoder thread"); |
212 base::Thread video_thread("Cast video encoder thread"); | 217 base::Thread video_thread("Cast video encoder thread"); |
213 test_thread.Start(); | 218 test_thread.Start(); |
214 audio_thread.Start(); | 219 audio_thread.Start(); |
215 video_thread.Start(); | 220 video_thread.Start(); |
216 | 221 |
217 base::MessageLoopForIO io_message_loop; | 222 base::MessageLoopForIO io_message_loop; |
218 | 223 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 base::Unretained(cast_sender.get()), | 371 base::Unretained(cast_sender.get()), |
367 audio_config, | 372 audio_config, |
368 base::Bind(&QuitLoopOnInitializationResult))); | 373 base::Bind(&QuitLoopOnInitializationResult))); |
369 io_message_loop.Run(); // Wait for audio initialization. | 374 io_message_loop.Run(); // Wait for audio initialization. |
370 | 375 |
371 fake_media_source->Start(cast_sender->audio_frame_input(), | 376 fake_media_source->Start(cast_sender->audio_frame_input(), |
372 cast_sender->video_frame_input()); | 377 cast_sender->video_frame_input()); |
373 io_message_loop.Run(); | 378 io_message_loop.Run(); |
374 return 0; | 379 return 0; |
375 } | 380 } |
OLD | NEW |