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 10 matching lines...) Expand all Loading... |
21 do { \ | 21 do { \ |
22 if (!(result)) { \ | 22 if (!(result)) { \ |
23 DVLOG(1) << log; \ | 23 DVLOG(1) << log; \ |
24 NotifyError(error_code); \ | 24 NotifyError(error_code); \ |
25 return ret; \ | 25 return ret; \ |
26 } \ | 26 } \ |
27 } while (0) | 27 } while (0) |
28 | 28 |
29 using content::VaapiH264Decoder; | 29 using content::VaapiH264Decoder; |
30 | 30 |
31 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() { | 31 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { |
32 } | 32 } |
33 | 33 |
34 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { | 34 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { |
35 } | 35 } |
36 | 36 |
37 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { | 37 void VaapiVideoDecodeAccelerator::NotifyError(Error error) { |
38 if (message_loop_ != MessageLoop::current()) { | 38 if (message_loop_ != MessageLoop::current()) { |
39 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); | 39 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); |
40 message_loop_->PostTask(FROM_HERE, base::Bind( | 40 message_loop_->PostTask(FROM_HERE, base::Bind( |
41 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); | 41 &VaapiVideoDecodeAccelerator::NotifyError, weak_this_, error)); |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 "Input id", input_id, "Picture id", output_id); | 549 "Input id", input_id, "Picture id", output_id); |
550 DVLOG(4) << "Outputting picture, input id: " << input_id | 550 DVLOG(4) << "Outputting picture, input id: " << input_id |
551 << " output id: " << output_id; | 551 << " output id: " << output_id; |
552 | 552 |
553 // Forward the request to the main thread. | 553 // Forward the request to the main thread. |
554 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); | 554 DCHECK_EQ(decoder_thread_.message_loop(), MessageLoop::current()); |
555 message_loop_->PostTask(FROM_HERE, base::Bind( | 555 message_loop_->PostTask(FROM_HERE, base::Bind( |
556 &VaapiVideoDecodeAccelerator::SyncAndNotifyPictureReady, weak_this_, | 556 &VaapiVideoDecodeAccelerator::SyncAndNotifyPictureReady, weak_this_, |
557 input_id, output_id)); | 557 input_id, output_id)); |
558 } | 558 } |
OLD | NEW |