Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1248)

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator.h

Issue 11411249: Do DXVA pre-sandbox initialization off the main thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <d3d9.h> 8 #include <d3d9.h>
9 #include <dxva2api.h> 9 #include <dxva2api.h>
10 #include <list> 10 #include <list>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; 54 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE;
55 virtual void Flush() OVERRIDE; 55 virtual void Flush() OVERRIDE;
56 virtual void Reset() OVERRIDE; 56 virtual void Reset() OVERRIDE;
57 virtual void Destroy() OVERRIDE; 57 virtual void Destroy() OVERRIDE;
58 58
59 // Initialization work needed before the process is sandboxed. 59 // Initialization work needed before the process is sandboxed.
60 // This includes:- 60 // This includes:-
61 // 1. Loads the dlls like mf/mfplat/d3d9, etc required for decoding. 61 // 1. Loads the dlls like mf/mfplat/d3d9, etc required for decoding.
62 // 2. Setting up the device manager instance which is shared between all 62 // 2. Setting up the device manager instance which is shared between all
63 // decoder instances. 63 // decoder instances.
64 static void PreSandboxInitialization(); 64 // Invokes the completion task, potentially on another thread, when complete.
65 static void PreSandboxInitialization(
66 const base::Closure& completion_task);
65 67
66 private: 68 private:
67 typedef void* EGLConfig; 69 typedef void* EGLConfig;
68 typedef void* EGLSurface; 70 typedef void* EGLSurface;
69 // Creates and initializes an instance of the D3D device and the 71 // Creates and initializes an instance of the D3D device and the
70 // corresponding device manager. The device manager instance is eventually 72 // corresponding device manager. The device manager instance is eventually
71 // passed to the IMFTransform interface implemented by the h.264 decoder. 73 // passed to the IMFTransform interface implemented by the h.264 decoder.
72 static bool CreateD3DDevManager(); 74 // Invokes the completion task, potentially on another thread, when complete.
75 static void CreateD3DDevManager(
76 const base::Closure& completion_task);
73 77
74 // Creates, initializes and sets the media types for the h.264 decoder. 78 // Creates, initializes and sets the media types for the h.264 decoder.
75 bool InitDecoder(); 79 bool InitDecoder();
76 80
77 // Validates whether the h.264 decoder supports hardware video acceleration. 81 // Validates whether the h.264 decoder supports hardware video acceleration.
78 bool CheckDecoderDxvaSupport(); 82 bool CheckDecoderDxvaSupport();
79 83
80 // Returns information about the input and output streams. This includes 84 // Returns information about the input and output streams. This includes
81 // alignment information, decoder support flags, minimum sample size, etc. 85 // alignment information, decoder support flags, minimum sample size, etc.
82 bool GetStreamsInfoAndBufferReqs(); 86 bool GetStreamsInfoAndBufferReqs();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 typedef std::list<media::BitstreamBuffer> PendingInputs; 219 typedef std::list<media::BitstreamBuffer> PendingInputs;
216 PendingInputs pending_input_buffers_; 220 PendingInputs pending_input_buffers_;
217 221
218 // Callback to set the correct gl context. 222 // Callback to set the correct gl context.
219 base::Callback<bool(void)> make_context_current_; 223 base::Callback<bool(void)> make_context_current_;
220 }; 224 };
221 225
222 } // namespace content 226 } // namespace content
223 227
224 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 228 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/dxva_video_decode_accelerator.cc » ('j') | content/gpu/gpu_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698