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 // Load the media module for FFmpeg decoding. | 207 // Prepare media module for FFmpeg decoding. |
208 base::FilePath path; | 208 media::InitializeMediaLibrary(); |
209 PathService::Get(base::DIR_MODULE, &path); | |
210 if (!media::InitializeMediaLibrary(path)) { | |
211 LOG(ERROR) << "Could not initialize media library."; | |
212 return 1; | |
213 } | |
214 | 209 |
215 base::Thread test_thread("Cast sender test app thread"); | 210 base::Thread test_thread("Cast sender test app thread"); |
216 base::Thread audio_thread("Cast audio encoder thread"); | 211 base::Thread audio_thread("Cast audio encoder thread"); |
217 base::Thread video_thread("Cast video encoder thread"); | 212 base::Thread video_thread("Cast video encoder thread"); |
218 test_thread.Start(); | 213 test_thread.Start(); |
219 audio_thread.Start(); | 214 audio_thread.Start(); |
220 video_thread.Start(); | 215 video_thread.Start(); |
221 | 216 |
222 base::MessageLoopForIO io_message_loop; | 217 base::MessageLoopForIO io_message_loop; |
223 | 218 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 base::Unretained(cast_sender.get()), | 366 base::Unretained(cast_sender.get()), |
372 audio_config, | 367 audio_config, |
373 base::Bind(&QuitLoopOnInitializationResult))); | 368 base::Bind(&QuitLoopOnInitializationResult))); |
374 io_message_loop.Run(); // Wait for audio initialization. | 369 io_message_loop.Run(); // Wait for audio initialization. |
375 | 370 |
376 fake_media_source->Start(cast_sender->audio_frame_input(), | 371 fake_media_source->Start(cast_sender->audio_frame_input(), |
377 cast_sender->video_frame_input()); | 372 cast_sender->video_frame_input()); |
378 io_message_loop.Run(); | 373 io_message_loop.Run(); |
379 return 0; | 374 return 0; |
380 } | 375 } |
OLD | NEW |