| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <iostream> | 5 #include <iostream> |
| 6 #include <signal.h> | 6 #include <signal.h> |
| 7 #include <X11/keysym.h> | 7 #include <X11/keysym.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 thread->Start(); | 250 thread->Start(); |
| 251 if (InitPipeline(thread->message_loop(), filename.c_str(), | 251 if (InitPipeline(thread->message_loop(), filename.c_str(), |
| 252 enable_audio, &pipeline, &message_loop)) { | 252 enable_audio, &pipeline, &message_loop)) { |
| 253 // Main loop of the application. | 253 // Main loop of the application. |
| 254 g_running = true; | 254 g_running = true; |
| 255 | 255 |
| 256 // Check if video is present. | 256 // Check if video is present. |
| 257 audio_only = !pipeline->IsRendered(media::mime_type::kMajorTypeVideo); | 257 audio_only = !pipeline->IsRendered(media::mime_type::kMajorTypeVideo); |
| 258 | 258 |
| 259 message_loop.PostTask(FROM_HERE, | 259 message_loop.PostTask(FROM_HERE, |
| 260 NewRunnableFunction(PeriodicalUpdate, pipeline.get(), | 260 NewRunnableFunction(PeriodicalUpdate, pipeline, |
| 261 &message_loop, audio_only)); | 261 &message_loop, audio_only)); |
| 262 message_loop.Run(); | 262 message_loop.Run(); |
| 263 } else{ | 263 } else{ |
| 264 std::cout << "Pipeline initialization failed..." << std::endl; | 264 std::cout << "Pipeline initialization failed..." << std::endl; |
| 265 } | 265 } |
| 266 | 266 |
| 267 // Cleanup tasks. | 267 // Cleanup tasks. |
| 268 thread->Stop(); | 268 thread->Stop(); |
| 269 XDestroyWindow(g_display, g_window); | 269 XDestroyWindow(g_display, g_window); |
| 270 XCloseDisplay(g_display); | 270 XCloseDisplay(g_display); |
| 271 return 0; | 271 return 0; |
| 272 } | 272 } |
| OLD | NEW |