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

Side by Side Diff: media/gpu/dxva_video_decode_accelerator_win.h

Issue 2495753002: Reenable idle suspension of media elements on Windows. (Closed)
Patch Set: add comment Created 4 years, 1 month 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
« no previous file with comments | « media/gpu/dxva_picture_buffer_win.cc ('k') | media/gpu/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_ 5 #ifndef MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_
6 #define MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_ 6 #define MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_
7 7
8 #include <d3d11.h> 8 #include <d3d11.h>
9 #include <d3d9.h> 9 #include <d3d9.h>
10 #include <initguid.h> 10 #include <initguid.h>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 kResetting, // upon received Reset(), before ResetDone() 109 kResetting, // upon received Reset(), before ResetDone()
110 kStopped, // upon output EOS received. 110 kStopped, // upon output EOS received.
111 kFlushing, // upon flush request received. 111 kFlushing, // upon flush request received.
112 kConfigChange, // stream configuration change detected. 112 kConfigChange, // stream configuration change detected.
113 }; 113 };
114 114
115 // Does not take ownership of |client| which must outlive |*this|. 115 // Does not take ownership of |client| which must outlive |*this|.
116 DXVAVideoDecodeAccelerator( 116 DXVAVideoDecodeAccelerator(
117 const GetGLContextCallback& get_gl_context_cb, 117 const GetGLContextCallback& get_gl_context_cb,
118 const MakeGLContextCurrentCallback& make_context_current_cb, 118 const MakeGLContextCurrentCallback& make_context_current_cb,
119 const BindGLImageCallback& bind_image_cb,
119 const gpu::GpuDriverBugWorkarounds& workarounds, 120 const gpu::GpuDriverBugWorkarounds& workarounds,
120 const gpu::GpuPreferences& gpu_preferences); 121 const gpu::GpuPreferences& gpu_preferences);
121 ~DXVAVideoDecodeAccelerator() override; 122 ~DXVAVideoDecodeAccelerator() override;
122 123
123 // VideoDecodeAccelerator implementation. 124 // VideoDecodeAccelerator implementation.
124 bool Initialize(const Config& config, Client* client) override; 125 bool Initialize(const Config& config, Client* client) override;
125 void Decode(const BitstreamBuffer& bitstream_buffer) override; 126 void Decode(const BitstreamBuffer& bitstream_buffer) override;
126 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; 127 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override;
127 void ReusePictureBuffer(int32_t picture_buffer_id) override; 128 void ReusePictureBuffer(int32_t picture_buffer_id) override;
128 void Flush() override; 129 void Flush() override;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 // that the configuration changed. 353 // that the configuration changed.
353 // Returns S_OK or S_FALSE on succcess. 354 // Returns S_OK or S_FALSE on succcess.
354 // The |config_changed| parameter is set to true if we detect a change in the 355 // The |config_changed| parameter is set to true if we detect a change in the
355 // stream. 356 // stream.
356 HRESULT CheckConfigChanged(IMFSample* sample, bool* config_changed); 357 HRESULT CheckConfigChanged(IMFSample* sample, bool* config_changed);
357 358
358 // Called when we detect a stream configuration change. We reinitialize the 359 // Called when we detect a stream configuration change. We reinitialize the
359 // decoder here. 360 // decoder here.
360 void ConfigChanged(const Config& config); 361 void ConfigChanged(const Config& config);
361 362
363 uint32_t GetTextureTarget() const;
364
362 // To expose client callbacks from VideoDecodeAccelerator. 365 // To expose client callbacks from VideoDecodeAccelerator.
363 VideoDecodeAccelerator::Client* client_; 366 VideoDecodeAccelerator::Client* client_;
364 367
365 base::win::ScopedComPtr<IMFTransform> decoder_; 368 base::win::ScopedComPtr<IMFTransform> decoder_;
366 base::win::ScopedComPtr<IMFTransform> video_format_converter_mft_; 369 base::win::ScopedComPtr<IMFTransform> video_format_converter_mft_;
367 370
368 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_; 371 base::win::ScopedComPtr<IDirect3D9Ex> d3d9_;
369 base::win::ScopedComPtr<IDirect3DDevice9Ex> d3d9_device_ex_; 372 base::win::ScopedComPtr<IDirect3DDevice9Ex> d3d9_device_ex_;
370 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_; 373 base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_;
371 base::win::ScopedComPtr<IDirect3DQuery9> query_; 374 base::win::ScopedComPtr<IDirect3DQuery9> query_;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 bool sent_drain_message_; 449 bool sent_drain_message_;
447 450
448 // List of input samples waiting to be processed. 451 // List of input samples waiting to be processed.
449 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs; 452 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs;
450 PendingInputs pending_input_buffers_; 453 PendingInputs pending_input_buffers_;
451 454
452 // Callback to get current GLContext. 455 // Callback to get current GLContext.
453 GetGLContextCallback get_gl_context_cb_; 456 GetGLContextCallback get_gl_context_cb_;
454 // Callback to set the correct gl context. 457 // Callback to set the correct gl context.
455 MakeGLContextCurrentCallback make_context_current_cb_; 458 MakeGLContextCurrentCallback make_context_current_cb_;
459 BindGLImageCallback bind_image_cb_;
456 460
457 // Which codec we are decoding with hardware acceleration. 461 // Which codec we are decoding with hardware acceleration.
458 VideoCodec codec_; 462 VideoCodec codec_;
459 // Thread on which the decoder operations like passing input frames, 463 // Thread on which the decoder operations like passing input frames,
460 // getting output frames are performed. One instance of this thread 464 // getting output frames are performed. One instance of this thread
461 // is created per decoder instance. 465 // is created per decoder instance.
462 base::Thread decoder_thread_; 466 base::Thread decoder_thread_;
463 467
464 // Task runner to be used for posting tasks to the decoder thread. 468 // Task runner to be used for posting tasks to the decoder thread.
465 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; 469 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 531
528 // Function pointer for the MFCreateDXGIDeviceManager API. 532 // Function pointer for the MFCreateDXGIDeviceManager API.
529 static CreateDXGIDeviceManager create_dxgi_device_manager_; 533 static CreateDXGIDeviceManager create_dxgi_device_manager_;
530 534
531 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); 535 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
532 }; 536 };
533 537
534 } // namespace media 538 } // namespace media
535 539
536 #endif // MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_ 540 #endif // MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_
OLDNEW
« no previous file with comments | « media/gpu/dxva_picture_buffer_win.cc ('k') | media/gpu/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698