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 #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 21 matching lines...) Expand all Loading... |
32 public: | 32 public: |
33 enum State { | 33 enum State { |
34 kUninitialized, // un-initialized. | 34 kUninitialized, // un-initialized. |
35 kNormal, // normal playing state. | 35 kNormal, // normal playing state. |
36 kResetting, // upon received Reset(), before ResetDone() | 36 kResetting, // upon received Reset(), before ResetDone() |
37 kEosDrain, // upon input EOS received. | 37 kEosDrain, // upon input EOS received. |
38 kStopped, // upon output EOS received. | 38 kStopped, // upon output EOS received. |
39 }; | 39 }; |
40 | 40 |
41 // Does not take ownership of |client| which must outlive |*this|. | 41 // Does not take ownership of |client| which must outlive |*this|. |
42 DXVAVideoDecodeAccelerator( | 42 explicit DXVAVideoDecodeAccelerator( |
43 media::VideoDecodeAccelerator::Client* client, | 43 media::VideoDecodeAccelerator::Client* client); |
44 base::ProcessHandle renderer_process); | |
45 virtual ~DXVAVideoDecodeAccelerator(); | 44 virtual ~DXVAVideoDecodeAccelerator(); |
46 | 45 |
47 // media::VideoDecodeAccelerator implementation. | 46 // media::VideoDecodeAccelerator implementation. |
48 virtual bool Initialize(media::VideoCodecProfile) OVERRIDE; | 47 virtual bool Initialize(media::VideoCodecProfile) OVERRIDE; |
49 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; | 48 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; |
50 virtual void AssignPictureBuffers( | 49 virtual void AssignPictureBuffers( |
51 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; | 50 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; |
52 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; | 51 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; |
53 virtual void Flush() OVERRIDE; | 52 virtual void Flush() OVERRIDE; |
54 virtual void Reset() OVERRIDE; | 53 virtual void Reset() OVERRIDE; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // The key is the picture buffer id. | 179 // The key is the picture buffer id. |
181 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers; | 180 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers; |
182 OutputBuffers output_picture_buffers_; | 181 OutputBuffers output_picture_buffers_; |
183 | 182 |
184 // Set to true if we requested picture slots from the client. | 183 // Set to true if we requested picture slots from the client. |
185 bool pictures_requested_; | 184 bool pictures_requested_; |
186 | 185 |
187 // Contains the id of the last input buffer received from the client. | 186 // Contains the id of the last input buffer received from the client. |
188 int32 last_input_buffer_id_; | 187 int32 last_input_buffer_id_; |
189 | 188 |
190 // Handle to the renderer process. | |
191 base::ProcessHandle renderer_process_; | |
192 | |
193 // Ideally the reset token would be a stack variable which is used while | 189 // Ideally the reset token would be a stack variable which is used while |
194 // creating the device manager. However it seems that the device manager | 190 // creating the device manager. However it seems that the device manager |
195 // holds onto the token and attempts to access it if the underlying device | 191 // holds onto the token and attempts to access it if the underlying device |
196 // changes. | 192 // changes. |
197 // TODO(ananta): This needs to be verified. | 193 // TODO(ananta): This needs to be verified. |
198 static uint32 dev_manager_reset_token_; | 194 static uint32 dev_manager_reset_token_; |
199 | 195 |
200 // Counter which holds the number of input packets before a successful | 196 // Counter which holds the number of input packets before a successful |
201 // decode. | 197 // decode. |
202 int inputs_before_decode_; | 198 int inputs_before_decode_; |
203 | 199 |
204 // Set to true if all necessary initialization needed before the GPU process | 200 // Set to true if all necessary initialization needed before the GPU process |
205 // is sandboxed is done. | 201 // is sandboxed is done. |
206 // This includes the following: | 202 // This includes the following: |
207 // 1. All required decoder dlls were successfully loaded. | 203 // 1. All required decoder dlls were successfully loaded. |
208 // 2. The device manager initialization completed. | 204 // 2. The device manager initialization completed. |
209 static bool pre_sandbox_init_done_; | 205 static bool pre_sandbox_init_done_; |
210 }; | 206 }; |
211 | 207 |
212 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ | 208 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |