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

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

Issue 1784193003: content gpu refactor: get rid of gpu related content switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the compile problem on windows Created 4 years, 9 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
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 <d3d11.h> 8 #include <d3d11.h>
9 #include <d3d9.h> 9 #include <d3d9.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 public: 53 public:
54 enum State { 54 enum State {
55 kUninitialized, // un-initialized. 55 kUninitialized, // un-initialized.
56 kNormal, // normal playing state. 56 kNormal, // normal playing state.
57 kResetting, // upon received Reset(), before ResetDone() 57 kResetting, // upon received Reset(), before ResetDone()
58 kStopped, // upon output EOS received. 58 kStopped, // upon output EOS received.
59 kFlushing, // upon flush request received. 59 kFlushing, // upon flush request received.
60 }; 60 };
61 61
62 // Does not take ownership of |client| which must outlive |*this|. 62 // Does not take ownership of |client| which must outlive |*this|.
63 explicit DXVAVideoDecodeAccelerator( 63 DXVAVideoDecodeAccelerator(
64 const base::Callback<bool(void)>& make_context_current, 64 const base::Callback<bool(void)>& make_context_current,
65 gfx::GLContext* gl_context); 65 gfx::GLContext* gl_context,
66 bool enable_accelerated_vpx_decode);
66 ~DXVAVideoDecodeAccelerator() override; 67 ~DXVAVideoDecodeAccelerator() override;
67 68
68 // media::VideoDecodeAccelerator implementation. 69 // media::VideoDecodeAccelerator implementation.
69 bool Initialize(const Config& config, Client* client) override; 70 bool Initialize(const Config& config, Client* client) override;
70 void Decode(const media::BitstreamBuffer& bitstream_buffer) override; 71 void Decode(const media::BitstreamBuffer& bitstream_buffer) override;
71 void AssignPictureBuffers( 72 void AssignPictureBuffers(
72 const std::vector<media::PictureBuffer>& buffers) override; 73 const std::vector<media::PictureBuffer>& buffers) override;
73 void ReusePictureBuffer(int32_t picture_buffer_id) override; 74 void ReusePictureBuffer(int32_t picture_buffer_id) override;
74 void Flush() override; 75 void Flush() override;
75 void Reset() override; 76 void Reset() override;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // Set to true if the DX11 video format converter input media types need to 387 // Set to true if the DX11 video format converter input media types need to
387 // be initialized. Defaults to true. 388 // be initialized. Defaults to true.
388 bool dx11_video_format_converter_media_type_needs_init_; 389 bool dx11_video_format_converter_media_type_needs_init_;
389 390
390 // The GLContext to be used by the decoder. 391 // The GLContext to be used by the decoder.
391 scoped_refptr<gfx::GLContext> gl_context_; 392 scoped_refptr<gfx::GLContext> gl_context_;
392 393
393 // Set to true if we are sharing ANGLE's device. 394 // Set to true if we are sharing ANGLE's device.
394 bool using_angle_device_; 395 bool using_angle_device_;
395 396
397 // Enables experimental hardware acceleration for VP8/VP9 video decoding.
398 const bool enable_accelerated_vpx_decode_;
399
396 // WeakPtrFactory for posting tasks back to |this|. 400 // WeakPtrFactory for posting tasks back to |this|.
397 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; 401 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_;
398 402
399 // Function pointer for the MFCreateDXGIDeviceManager API. 403 // Function pointer for the MFCreateDXGIDeviceManager API.
400 static CreateDXGIDeviceManager create_dxgi_device_manager_; 404 static CreateDXGIDeviceManager create_dxgi_device_manager_;
401 405
402 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); 406 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
403 }; 407 };
404 408
405 } // namespace content 409 } // namespace content
406 410
407 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 411 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698