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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { | 38 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { |
39 if (message_loop_ != MessageLoop::current()) { | 39 if (message_loop_ != MessageLoop::current()) { |
40 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); | 40 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); |
41 message_loop_->PostTask(FROM_HERE, base::Bind( | 41 message_loop_->PostTask(FROM_HERE, base::Bind( |
42 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); | 42 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); |
43 return; | 43 return; |
44 } | 44 } |
45 | 45 |
| 46 // Post Cleanup() as a task so we don't recursively acquire lock_. |
| 47 message_loop_->PostTask(FROM_HERE, base::Bind( |
| 48 &VaapiVideoDecodeAccelerator::Cleanup, weak_this_)); |
| 49 |
46 DVLOG(1) << "Notifying of error " << error; | 50 DVLOG(1) << "Notifying of error " << error; |
47 | |
48 if (client_) { | 51 if (client_) { |
49 client_->NotifyError(error); | 52 client_->NotifyError(error); |
50 client_ptr_factory_.InvalidateWeakPtrs(); | 53 client_ptr_factory_.InvalidateWeakPtrs(); |
51 } | 54 } |
52 Cleanup(); | |
53 } | 55 } |
54 | 56 |
55 VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( | 57 VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator( |
56 Display* x_display, GLXContext glx_context, | 58 Display* x_display, GLXContext glx_context, |
57 Client* client, | 59 Client* client, |
58 const base::Callback<bool(void)>& make_context_current) | 60 const base::Callback<bool(void)>& make_context_current) |
59 : x_display_(x_display), | 61 : x_display_(x_display), |
60 glx_context_(glx_context), | 62 glx_context_(glx_context), |
61 make_context_current_(make_context_current), | 63 make_context_current_(make_context_current), |
62 state_(kUninitialized), | 64 state_(kUninitialized), |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 587 |
586 // static | 588 // static |
587 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() { | 589 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() { |
588 VaapiH264Decoder::PreSandboxInitialization(); | 590 VaapiH264Decoder::PreSandboxInitialization(); |
589 } | 591 } |
590 | 592 |
591 // static | 593 // static |
592 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() { | 594 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() { |
593 return VaapiH264Decoder::PostSandboxInitialization(); | 595 return VaapiH264Decoder::PostSandboxInitialization(); |
594 } | 596 } |
OLD | NEW |