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

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: change ifdef 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
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 bool sent_drain_message_; 447 bool sent_drain_message_;
447 448
448 // List of input samples waiting to be processed. 449 // List of input samples waiting to be processed.
449 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs; 450 typedef std::list<base::win::ScopedComPtr<IMFSample>> PendingInputs;
450 PendingInputs pending_input_buffers_; 451 PendingInputs pending_input_buffers_;
451 452
452 // Callback to get current GLContext. 453 // Callback to get current GLContext.
453 GetGLContextCallback get_gl_context_cb_; 454 GetGLContextCallback get_gl_context_cb_;
454 // Callback to set the correct gl context. 455 // Callback to set the correct gl context.
455 MakeGLContextCurrentCallback make_context_current_cb_; 456 MakeGLContextCurrentCallback make_context_current_cb_;
457 BindGLImageCallback bind_image_cb_;
456 458
457 // Which codec we are decoding with hardware acceleration. 459 // Which codec we are decoding with hardware acceleration.
458 VideoCodec codec_; 460 VideoCodec codec_;
459 // Thread on which the decoder operations like passing input frames, 461 // Thread on which the decoder operations like passing input frames,
460 // getting output frames are performed. One instance of this thread 462 // getting output frames are performed. One instance of this thread
461 // is created per decoder instance. 463 // is created per decoder instance.
462 base::Thread decoder_thread_; 464 base::Thread decoder_thread_;
463 465
464 // Task runner to be used for posting tasks to the decoder thread. 466 // Task runner to be used for posting tasks to the decoder thread.
465 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_; 467 scoped_refptr<base::SingleThreadTaskRunner> decoder_thread_task_runner_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 529
528 // Function pointer for the MFCreateDXGIDeviceManager API. 530 // Function pointer for the MFCreateDXGIDeviceManager API.
529 static CreateDXGIDeviceManager create_dxgi_device_manager_; 531 static CreateDXGIDeviceManager create_dxgi_device_manager_;
530 532
531 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); 533 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
532 }; 534 };
533 535
534 } // namespace media 536 } // namespace media
535 537
536 #endif // MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_ 538 #endif // MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698