| 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" |
| 11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "gpu/command_buffer/service/gpu_switches.h" | 12 #include "gpu/command_buffer/service/gpu_switches.h" |
| 13 #include "content/public/common/content_switches.h" | 13 #include "content/public/common/content_switches.h" |
| 14 #include "content/common/gpu/gpu_channel.h" | 14 #include "content/common/gpu/gpu_channel.h" |
| 15 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 15 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 16 #include "media/base/bind_to_loop.h" | 16 #include "media/base/bind_to_loop.h" |
| 17 #include "media/video/picture.h" | 17 #include "media/video/picture.h" |
| 18 #include "third_party/libva/va/va.h" | 18 #include "third_party/libva/va/va.h" |
| 19 #include "ui/gl/gl_bindings.h" | 19 #include "ui/gl/gl_bindings.h" |
| 20 | 20 |
| 21 namespace content { |
| 22 |
| 21 #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \ | 23 #define RETURN_AND_NOTIFY_ON_FAILURE(result, log, error_code, ret) \ |
| 22 do { \ | 24 do { \ |
| 23 if (!(result)) { \ | 25 if (!(result)) { \ |
| 24 DVLOG(1) << log; \ | 26 DVLOG(1) << log; \ |
| 25 NotifyError(error_code); \ | 27 NotifyError(error_code); \ |
| 26 return ret; \ | 28 return ret; \ |
| 27 } \ | 29 } \ |
| 28 } while (0) | 30 } while (0) |
| 29 | 31 |
| 30 using content::VaapiH264Decoder; | |
| 31 | |
| 32 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { | 32 VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() : id(0), size(0) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { | 35 VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() { |
| 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( |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 | 594 |
| 595 // static | 595 // static |
| 596 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() { | 596 void VaapiVideoDecodeAccelerator::PreSandboxInitialization() { |
| 597 VaapiH264Decoder::PreSandboxInitialization(); | 597 VaapiH264Decoder::PreSandboxInitialization(); |
| 598 } | 598 } |
| 599 | 599 |
| 600 // static | 600 // static |
| 601 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() { | 601 bool VaapiVideoDecodeAccelerator::PostSandboxInitialization() { |
| 602 return VaapiH264Decoder::PostSandboxInitialization(); | 602 return VaapiH264Decoder::PostSandboxInitialization(); |
| 603 } | 603 } |
| 604 |
| 605 } // namespace content |
| OLD | NEW |