| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 scoped_ptr<media::cast::ReceiverTimeOffsetEstimatorImpl> estimator) { | 180 scoped_ptr<media::cast::ReceiverTimeOffsetEstimatorImpl> estimator) { |
| 181 cast_environment->Logging()->RemoveRawEventSubscriber( | 181 cast_environment->Logging()->RemoveRawEventSubscriber( |
| 182 video_event_subscriber.get()); | 182 video_event_subscriber.get()); |
| 183 cast_environment->Logging()->RemoveRawEventSubscriber( | 183 cast_environment->Logging()->RemoveRawEventSubscriber( |
| 184 audio_event_subscriber.get()); | 184 audio_event_subscriber.get()); |
| 185 cast_environment->Logging()->RemoveRawEventSubscriber(estimator.get()); | 185 cast_environment->Logging()->RemoveRawEventSubscriber(estimator.get()); |
| 186 | 186 |
| 187 scoped_ptr<base::DictionaryValue> stats = video_event_subscriber->GetStats(); | 187 scoped_ptr<base::DictionaryValue> stats = video_event_subscriber->GetStats(); |
| 188 std::string json; | 188 std::string json; |
| 189 base::JSONWriter::WriteWithOptions( | 189 base::JSONWriter::WriteWithOptions( |
| 190 stats.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); | 190 *stats, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); |
| 191 VLOG(0) << "Video stats: " << json; | 191 VLOG(0) << "Video stats: " << json; |
| 192 | 192 |
| 193 stats = audio_event_subscriber->GetStats(); | 193 stats = audio_event_subscriber->GetStats(); |
| 194 json.clear(); | 194 json.clear(); |
| 195 base::JSONWriter::WriteWithOptions( | 195 base::JSONWriter::WriteWithOptions( |
| 196 stats.get(), base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); | 196 *stats, base::JSONWriter::OPTIONS_PRETTY_PRINT, &json); |
| 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 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 base::Unretained(cast_sender.get()), | 371 base::Unretained(cast_sender.get()), |
| 372 audio_config, | 372 audio_config, |
| 373 base::Bind(&QuitLoopOnInitializationResult))); | 373 base::Bind(&QuitLoopOnInitializationResult))); |
| 374 io_message_loop.Run(); // Wait for audio initialization. | 374 io_message_loop.Run(); // Wait for audio initialization. |
| 375 | 375 |
| 376 fake_media_source->Start(cast_sender->audio_frame_input(), | 376 fake_media_source->Start(cast_sender->audio_frame_input(), |
| 377 cast_sender->video_frame_input()); | 377 cast_sender->video_frame_input()); |
| 378 io_message_loop.Run(); | 378 io_message_loop.Run(); |
| 379 return 0; | 379 return 0; |
| 380 } | 380 } |
| OLD | NEW |