| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include <iostream> | 5 #include <iostream> |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/thread.h" | 12 #include "base/thread.h" |
| 13 #include "media/base/media.h" | 13 #include "media/base/media.h" |
| 14 #include "media/base/pipeline_impl.h" | 14 #include "media/base/pipeline_impl.h" |
| 15 #include "media/filters/audio_renderer_impl.h" | 15 #include "media/filters/audio_renderer_impl.h" |
| 16 #include "media/filters/ffmpeg_audio_decoder.h" | 16 #include "media/filters/ffmpeg_audio_decoder.h" |
| 17 #include "media/filters/ffmpeg_demuxer.h" | 17 #include "media/filters/ffmpeg_demuxer.h" |
| 18 #include "media/filters/ffmpeg_video_decoder.h" | 18 #include "media/filters/ffmpeg_video_decoder.h" |
| 19 #include "media/filters/file_data_source.h" | 19 #include "media/filters/file_data_source.h" |
| 20 #include "media/filters/null_audio_renderer.h" | 20 #include "media/filters/null_audio_renderer.h" |
| 21 #include "media/player/x11_video_renderer.h" | 21 #include "media/tools/player_x11/x11_video_renderer.h" |
| 22 | 22 |
| 23 Display* g_display; | 23 Display* g_display; |
| 24 Window g_window; | 24 Window g_window; |
| 25 | 25 |
| 26 // Initialize X11. Returns true if successful. This method creates the X11 | 26 // Initialize X11. Returns true if successful. This method creates the X11 |
| 27 // window. Further initialization is done in X11VideoRenderer. | 27 // window. Further initialization is done in X11VideoRenderer. |
| 28 bool InitX11() { | 28 bool InitX11() { |
| 29 g_display = XOpenDisplay(NULL); | 29 g_display = XOpenDisplay(NULL); |
| 30 if (!g_display) { | 30 if (!g_display) { |
| 31 std::cout << "Error - cannot open display" << std::endl; | 31 std::cout << "Error - cannot open display" << std::endl; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Cleanup tasks. | 149 // Cleanup tasks. |
| 150 thread->Stop(); | 150 thread->Stop(); |
| 151 XDestroyWindow(g_display, g_window); | 151 XDestroyWindow(g_display, g_window); |
| 152 XCloseDisplay(g_display); | 152 XCloseDisplay(g_display); |
| 153 return 0; | 153 return 0; |
| 154 } | 154 } |
| OLD | NEW |