OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <X11/keysym.h> | 5 #include <X11/XKBlib.h> |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 #include <signal.h> | 7 #include <signal.h> |
8 | 8 |
9 #include <iostream> // NOLINT | 9 #include <iostream> // NOLINT |
10 | 10 |
11 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_path.h" | 14 #include "base/file_path.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 &width, | 192 &width, |
193 &height, | 193 &height, |
194 &border_width, | 194 &border_width, |
195 &depth); | 195 &depth); |
196 base::TimeDelta time = pipeline->GetMediaDuration(); | 196 base::TimeDelta time = pipeline->GetMediaDuration(); |
197 pipeline->Seek(time*e.xbutton.x/width, media::PipelineStatusCB()); | 197 pipeline->Seek(time*e.xbutton.x/width, media::PipelineStatusCB()); |
198 } | 198 } |
199 break; | 199 break; |
200 case KeyPress: | 200 case KeyPress: |
201 { | 201 { |
202 KeySym key = XKeycodeToKeysym(g_display, e.xkey.keycode, 0); | 202 KeySym key = XkbKeycodeToKeysym(g_display, e.xkey.keycode, 0, 0); |
203 if (key == XK_Escape) { | 203 if (key == XK_Escape) { |
204 g_running = false; | 204 g_running = false; |
205 // Quit message_loop only when pipeline is fully stopped. | 205 // Quit message_loop only when pipeline is fully stopped. |
206 MessageLoopQuitter* quitter = new MessageLoopQuitter(message_loop); | 206 MessageLoopQuitter* quitter = new MessageLoopQuitter(message_loop); |
207 pipeline->Stop(base::Bind(&MessageLoopQuitter::Quit, | 207 pipeline->Stop(base::Bind(&MessageLoopQuitter::Quit, |
208 base::Unretained(quitter))); | 208 base::Unretained(quitter))); |
209 return; | 209 return; |
210 } else if (key == XK_space) { | 210 } else if (key == XK_space) { |
211 if (pipeline->GetPlaybackRate() < 0.01f) // paused | 211 if (pipeline->GetPlaybackRate() < 0.01f) // paused |
212 pipeline->SetPlaybackRate(1.0f); | 212 pipeline->SetPlaybackRate(1.0f); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 // Release callback which releases video renderer. Do this before cleaning up | 310 // Release callback which releases video renderer. Do this before cleaning up |
311 // X below since the video renderer has some X cleanup duties as well. | 311 // X below since the video renderer has some X cleanup duties as well. |
312 paint_cb.Reset(); | 312 paint_cb.Reset(); |
313 | 313 |
314 XDestroyWindow(g_display, g_window); | 314 XDestroyWindow(g_display, g_window); |
315 XCloseDisplay(g_display); | 315 XCloseDisplay(g_display); |
316 g_audio_manager = NULL; | 316 g_audio_manager = NULL; |
317 | 317 |
318 return 0; | 318 return 0; |
319 } | 319 } |
OLD | NEW |