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

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

Issue 10081018: Revert 132218 - Convert plugin and GPU process to brokered handle duplication. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 months 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 21 matching lines...) Expand all
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 explicit DXVAVideoDecodeAccelerator( 42 DXVAVideoDecodeAccelerator(
43 media::VideoDecodeAccelerator::Client* client); 43 media::VideoDecodeAccelerator::Client* client,
44 base::ProcessHandle renderer_process);
44 virtual ~DXVAVideoDecodeAccelerator(); 45 virtual ~DXVAVideoDecodeAccelerator();
45 46
46 // media::VideoDecodeAccelerator implementation. 47 // media::VideoDecodeAccelerator implementation.
47 virtual bool Initialize(media::VideoCodecProfile) OVERRIDE; 48 virtual bool Initialize(media::VideoCodecProfile) OVERRIDE;
48 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE; 49 virtual void Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE;
49 virtual void AssignPictureBuffers( 50 virtual void AssignPictureBuffers(
50 const std::vector<media::PictureBuffer>& buffers) OVERRIDE; 51 const std::vector<media::PictureBuffer>& buffers) OVERRIDE;
51 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; 52 virtual void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE;
52 virtual void Flush() OVERRIDE; 53 virtual void Flush() OVERRIDE;
53 virtual void Reset() OVERRIDE; 54 virtual void Reset() OVERRIDE;
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // The key is the picture buffer id. 180 // The key is the picture buffer id.
180 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers; 181 typedef std::map<int32, linked_ptr<DXVAPictureBuffer> > OutputBuffers;
181 OutputBuffers output_picture_buffers_; 182 OutputBuffers output_picture_buffers_;
182 183
183 // Set to true if we requested picture slots from the client. 184 // Set to true if we requested picture slots from the client.
184 bool pictures_requested_; 185 bool pictures_requested_;
185 186
186 // Contains the id of the last input buffer received from the client. 187 // Contains the id of the last input buffer received from the client.
187 int32 last_input_buffer_id_; 188 int32 last_input_buffer_id_;
188 189
190 // Handle to the renderer process.
191 base::ProcessHandle renderer_process_;
192
189 // Ideally the reset token would be a stack variable which is used while 193 // Ideally the reset token would be a stack variable which is used while
190 // creating the device manager. However it seems that the device manager 194 // creating the device manager. However it seems that the device manager
191 // holds onto the token and attempts to access it if the underlying device 195 // holds onto the token and attempts to access it if the underlying device
192 // changes. 196 // changes.
193 // TODO(ananta): This needs to be verified. 197 // TODO(ananta): This needs to be verified.
194 static uint32 dev_manager_reset_token_; 198 static uint32 dev_manager_reset_token_;
195 199
196 // Counter which holds the number of input packets before a successful 200 // Counter which holds the number of input packets before a successful
197 // decode. 201 // decode.
198 int inputs_before_decode_; 202 int inputs_before_decode_;
199 203
200 // Set to true if all necessary initialization needed before the GPU process 204 // Set to true if all necessary initialization needed before the GPU process
201 // is sandboxed is done. 205 // is sandboxed is done.
202 // This includes the following: 206 // This includes the following:
203 // 1. All required decoder dlls were successfully loaded. 207 // 1. All required decoder dlls were successfully loaded.
204 // 2. The device manager initialization completed. 208 // 2. The device manager initialization completed.
205 static bool pre_sandbox_init_done_; 209 static bool pre_sandbox_init_done_;
206 }; 210 };
207 211
208 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 212 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_messages.h ('k') | content/common/gpu/media/dxva_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698