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

Unified Diff: media/gpu/d3d11_video_decode_accelerator_win.h

Issue 2534313004: Add prototype D3D11VideoDecodeAccelerator. (Closed)
Patch Set: rename d3d11_video_decoder.cc and other changes Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/d3d11_h264_accelerator.cc ('k') | media/gpu/d3d11_video_decode_accelerator_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/d3d11_video_decode_accelerator_win.h
diff --git a/media/gpu/d3d11_video_decode_accelerator_win.h b/media/gpu/d3d11_video_decode_accelerator_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..32aa6c56bd6a634ad2ea2e7e28dad3d2a6643ec7
--- /dev/null
+++ b/media/gpu/d3d11_video_decode_accelerator_win.h
@@ -0,0 +1,78 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_GPU_D3D11_VIDEO_DECODE_ACCELERATOR_WIN_H_
+#define MEDIA_GPU_D3D11_VIDEO_DECODE_ACCELERATOR_WIN_H_
+
+#include <d3d11.h>
+
+#include <list>
+#include <memory>
+
+#include "base/win/scoped_comptr.h"
+#include "media/gpu/accelerated_video_decoder.h"
+#include "media/gpu/d3d11_h264_accelerator.h"
+#include "media/gpu/gpu_video_decode_accelerator_helpers.h"
+#include "media/gpu/media_gpu_export.h"
+#include "media/video/video_decode_accelerator.h"
+
+namespace media {
+
+class MEDIA_GPU_EXPORT D3D11VideoDecodeAccelerator
+ : public VideoDecodeAccelerator,
+ public D3D11VideoDecoderClient {
+ public:
+ D3D11VideoDecodeAccelerator(
+ const GetGLContextCallback& get_gl_context_cb,
+ const MakeGLContextCurrentCallback& make_context_current_cb);
+
+ ~D3D11VideoDecodeAccelerator() override;
+
+ // VideoDecodeAccelerator implementation.
+ bool Initialize(const Config& config, Client* client) override;
+ void Decode(const BitstreamBuffer& bitstream_buffer) override;
+ void DoDecode();
+ void AssignPictureBuffers(const std::vector<PictureBuffer>& buffers) override;
+ void ReusePictureBuffer(int32_t picture_buffer_id) override;
+ void Flush() override;
+ void Reset() override;
+ void Destroy() override;
+ bool TryToSetupDecodeOnSeparateThread(
+ const base::WeakPtr<Client>& decode_client,
+ const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner)
+ override;
+ GLenum GetSurfaceInternalFormat() const override;
+
+ // D3D11VideoDecoderClient implementation.
+ D3D11PictureBuffer* GetPicture() override;
+ void OutputResult(D3D11PictureBuffer* buffer,
+ size_t input_buffer_id) override;
+ size_t input_buffer_id() const override;
+
+ private:
+ Client* client_;
+ GetGLContextCallback get_gl_context_cb_;
+ MakeGLContextCurrentCallback make_context_current_cb_;
+ base::win::ScopedComPtr<ID3D11Device> device_;
+ base::win::ScopedComPtr<ID3D11DeviceContext> device_context_;
+ base::win::ScopedComPtr<ID3D11VideoDevice> video_device_;
+ base::win::ScopedComPtr<ID3D11VideoContext> video_context_;
+ std::unique_ptr<AcceleratedVideoDecoder> decoder_;
+ std::unique_ptr<D3D11H264Accelerator> h264_accelerator_;
+
+ GUID decoder_guid_;
+
+ std::list<BitstreamBuffer> input_buffer_queue_;
+ uint32_t input_buffer_id_;
+ std::unique_ptr<base::SharedMemory> bitstream_buffer_;
+ size_t bitstream_buffer_size_;
+
+ std::vector<std::unique_ptr<D3D11PictureBuffer>> picture_buffers_;
+
+ DISALLOW_COPY_AND_ASSIGN(D3D11VideoDecodeAccelerator);
+};
+
+} // namespace media
+
+#endif // MEDIA_GPU_D3D11_VIDEO_DECODE_ACCELERATOR_WIN_H_
« no previous file with comments | « media/gpu/d3d11_h264_accelerator.cc ('k') | media/gpu/d3d11_video_decode_accelerator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698