Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_GPU_D3D11_VIDEO_DECODE_ACCELERATOR_H_ | |
|
sandersd (OOO until July 31)
2016/12/02 00:52:57
_WIN_H_?
| |
| 6 #define MEDIA_GPU_D3D11_VIDEO_DECODE_ACCELERATOR_H_ | |
| 7 | |
| 8 #include <d3d11.h> | |
| 9 | |
| 10 #include <list> | |
| 11 #include <memory> | |
| 12 | |
| 13 #include "base/win/scoped_comptr.h" | |
| 14 #include "media/gpu/accelerated_video_decoder.h" | |
| 15 #include "media/gpu/d3d11_video_decoder.h" | |
| 16 #include "media/gpu/gpu_video_decode_accelerator_helpers.h" | |
| 17 #include "media/gpu/media_gpu_export.h" | |
| 18 #include "media/video/video_decode_accelerator.h" | |
| 19 | |
| 20 namespace media { | |
| 21 | |
| 22 class D3D11PictureBuffer; | |
| 23 class D3D11H264Accelerator; | |
| 24 | |
| 25 class MEDIA_GPU_EXPORT D3D11VideoDecodeAccelerator | |
| 26 : public VideoDecodeAccelerator, | |
| 27 public D3D11VideoDecoderClient { | |
| 28 public: | |
| 29 D3D11VideoDecodeAccelerator( | |
| 30 const GetGLContextCallback& get_gl_context_cb, | |
| 31 const MakeGLContextCurrentCallback& make_context_current_cb); | |
| 32 | |
| 33 ~D3D11VideoDecodeAccelerator() override; | |
| 34 | |
| 35 // VideoDecodeAccelerator implementation. | |
| 36 bool Initialize(const Config& config, Client* client) override; | |
| 37 void Decode(const BitstreamBuffer& bitstream_buffer) override; | |
| 38 void DoDecode(); | |
| 39 void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override; | |
| 40 void ReusePictureBuffer(int32_t picture_buffer_id) override; | |
| 41 void Flush() override; | |
| 42 void Reset() override; | |
| 43 void Destroy() override; | |
| 44 bool TryToSetupDecodeOnSeparateThread( | |
| 45 const base::WeakPtr<Client>& decode_client, | |
| 46 const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) | |
| 47 override; | |
| 48 GLenum GetSurfaceInternalFormat() const override; | |
| 49 | |
| 50 // D3D11VideoDecoderClient implementation. | |
| 51 D3D11PictureBuffer* GetPicture() override; | |
| 52 void OutputResult(D3D11PictureBuffer* buffer, | |
| 53 size_t input_buffer_id) override; | |
| 54 size_t input_buffer_id() const override; | |
| 55 | |
| 56 private: | |
| 57 Client* client_; | |
| 58 GetGLContextCallback get_gl_context_cb_; | |
| 59 MakeGLContextCurrentCallback make_context_current_cb_; | |
| 60 base::win::ScopedComPtr<ID3D11Device> device_; | |
| 61 base::win::ScopedComPtr<ID3D11DeviceContext> device_context_; | |
| 62 base::win::ScopedComPtr<ID3D11VideoDevice> video_device_; | |
| 63 base::win::ScopedComPtr<ID3D11VideoContext> video_context_; | |
| 64 std::unique_ptr<AcceleratedVideoDecoder> decoder_; | |
| 65 std::unique_ptr<D3D11H264Accelerator> h264_accelerator_; | |
| 66 | |
| 67 GUID decoder_guid_; | |
| 68 | |
| 69 std::list<BitstreamBuffer> input_buffer_queue_; | |
| 70 uint32_t input_buffer_id_; | |
| 71 std::unique_ptr<base::SharedMemory> bitstream_buffer_; | |
| 72 size_t bitstream_buffer_size_; | |
| 73 | |
| 74 std::vector<std::unique_ptr<D3D11PictureBuffer>> picture_buffers_; | |
| 75 | |
| 76 DISALLOW_COPY_AND_ASSIGN(D3D11VideoDecodeAccelerator); | |
| 77 }; | |
| 78 | |
| 79 } // namespace media | |
| 80 | |
| 81 #endif | |
| OLD | NEW |