| 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 <signal.h> | 5 #include <signal.h> |
| 6 | 6 |
| 7 #include <iostream> // NOLINT | 7 #include <iostream> // NOLINT |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 typedef base::Callback<void(media::VideoFrame*)> PaintCB; | 84 typedef base::Callback<void(media::VideoFrame*)> PaintCB; |
| 85 void Paint(base::MessageLoop* message_loop, const PaintCB& paint_cb, | 85 void Paint(base::MessageLoop* message_loop, const PaintCB& paint_cb, |
| 86 const scoped_refptr<media::VideoFrame>& video_frame) { | 86 const scoped_refptr<media::VideoFrame>& video_frame) { |
| 87 if (message_loop != base::MessageLoop::current()) { | 87 if (message_loop != base::MessageLoop::current()) { |
| 88 message_loop->PostTask(FROM_HERE, base::Bind( | 88 message_loop->PostTask(FROM_HERE, base::Bind( |
| 89 &Paint, message_loop, paint_cb, video_frame)); | 89 &Paint, message_loop, paint_cb, video_frame)); |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 | 92 |
| 93 paint_cb.Run(video_frame); | 93 paint_cb.Run(video_frame.get()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 static void OnBufferingState(media::Pipeline::BufferingState buffering_state) {} | 96 static void OnBufferingState(media::Pipeline::BufferingState buffering_state) {} |
| 97 | 97 |
| 98 static void NeedKey(const std::string& type, scoped_ptr<uint8[]> init_data, | 98 static void NeedKey(const std::string& type, scoped_ptr<uint8[]> init_data, |
| 99 int init_data_size) { | 99 int init_data_size) { |
| 100 std::cout << "File is encrypted." << std::endl; | 100 std::cout << "File is encrypted." << std::endl; |
| 101 } | 101 } |
| 102 | 102 |
| 103 static void SaveStatusAndSignal(base::WaitableEvent* event, | 103 static void SaveStatusAndSignal(base::WaitableEvent* event, |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // Release callback which releases video renderer. Do this before cleaning up | 302 // Release callback which releases video renderer. Do this before cleaning up |
| 303 // X below since the video renderer has some X cleanup duties as well. | 303 // X below since the video renderer has some X cleanup duties as well. |
| 304 paint_cb.Reset(); | 304 paint_cb.Reset(); |
| 305 | 305 |
| 306 XDestroyWindow(g_display, g_window); | 306 XDestroyWindow(g_display, g_window); |
| 307 XCloseDisplay(g_display); | 307 XCloseDisplay(g_display); |
| 308 g_audio_manager = NULL; | 308 g_audio_manager = NULL; |
| 309 | 309 |
| 310 return 0; | 310 return 0; |
| 311 } | 311 } |
| OLD | NEW |