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 "content/common/gpu/media/dxva_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
6 | 6 |
7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
10 | 10 |
11 #include <ks.h> | 11 #include <ks.h> |
12 #include <codecapi.h> | 12 #include <codecapi.h> |
13 #include <d3dx9tex.h> | 13 #include <d3dx9tex.h> |
14 #include <mfapi.h> | 14 #include <mfapi.h> |
15 #include <mferror.h> | 15 #include <mferror.h> |
16 #include <wmcodecdsp.h> | 16 #include <wmcodecdsp.h> |
17 | 17 |
18 #include "base/bind.h" | 18 #include "base/bind.h" |
19 #include "base/callback.h" | 19 #include "base/callback.h" |
20 #include "base/debug/trace_event.h" | 20 #include "base/debug/trace_event.h" |
21 #include "base/logging.h" | 21 #include "base/logging.h" |
22 #include "base/memory/scoped_handle.h" | 22 #include "base/memory/scoped_handle.h" |
23 #include "base/memory/scoped_ptr.h" | 23 #include "base/memory/scoped_ptr.h" |
24 #include "base/message_loop.h" | 24 #include "base/message_loop.h" |
25 #include "base/process_util.h" | 25 #include "base/process_util.h" |
26 #include "base/shared_memory.h" | 26 #include "base/shared_memory.h" |
27 #include "media/video/video_decode_accelerator.h" | 27 #include "media/video/video_decode_accelerator.h" |
28 #include "third_party/angle/include/EGL/egl.h" | 28 #include "third_party/angle/include/EGL/egl.h" |
29 #include "third_party/angle/include/EGL/eglext.h" | 29 #include "third_party/angle/include/EGL/eglext.h" |
30 #include "ui/gfx/gl/gl_bindings.h" | 30 #include "ui/gl/gl_bindings.h" |
31 #include "ui/gfx/gl/gl_surface.h" | 31 #include "ui/gl/gl_surface.h" |
32 | 32 |
33 // We only request 5 picture buffers from the client which are used to hold the | 33 // We only request 5 picture buffers from the client which are used to hold the |
34 // decoded samples. These buffers are then reused when the client tells us that | 34 // decoded samples. These buffers are then reused when the client tells us that |
35 // it is done with the buffer. | 35 // it is done with the buffer. |
36 static const int kNumPictureBuffers = 5; | 36 static const int kNumPictureBuffers = 5; |
37 | 37 |
38 bool DXVAVideoDecodeAccelerator::pre_sandbox_init_done_ = false; | 38 bool DXVAVideoDecodeAccelerator::pre_sandbox_init_done_ = false; |
39 uint32 DXVAVideoDecodeAccelerator::dev_manager_reset_token_ = 0; | 39 uint32 DXVAVideoDecodeAccelerator::dev_manager_reset_token_ = 0; |
40 IDirect3DDeviceManager9* DXVAVideoDecodeAccelerator::device_manager_ = NULL; | 40 IDirect3DDeviceManager9* DXVAVideoDecodeAccelerator::device_manager_ = NULL; |
41 IDirect3DDevice9Ex* DXVAVideoDecodeAccelerator::device_ = NULL; | 41 IDirect3DDevice9Ex* DXVAVideoDecodeAccelerator::device_ = NULL; |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 gfx::Size(width, height)); | 1018 gfx::Size(width, height)); |
1019 } | 1019 } |
1020 } | 1020 } |
1021 | 1021 |
1022 void DXVAVideoDecodeAccelerator::NotifyPictureReady( | 1022 void DXVAVideoDecodeAccelerator::NotifyPictureReady( |
1023 const media::Picture& picture) { | 1023 const media::Picture& picture) { |
1024 // This task could execute after the decoder has been torn down. | 1024 // This task could execute after the decoder has been torn down. |
1025 if (state_ != kUninitialized && client_) | 1025 if (state_ != kUninitialized && client_) |
1026 client_->PictureReady(picture); | 1026 client_->PictureReady(picture); |
1027 } | 1027 } |
OLD | NEW |