d3d11_video_decoder_client.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2018 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. #ifndef MEDIA_GPU_WINDOWS_D3D11_VIDEO_DECODER_CLIENT_H_
  5. #define MEDIA_GPU_WINDOWS_D3D11_VIDEO_DECODER_CLIENT_H_
  6. #include "base/callback.h"
  7. #include "media/base/video_color_space.h"
  8. #include "media/gpu/windows/d3d11_com_defs.h"
  9. namespace media {
  10. class CodecPicture;
  11. class D3D11PictureBuffer;
  12. // Acts as a parent class for the D3D11VideoDecoder to expose
  13. // required methods to D3D11VideoAccelerators.
  14. class D3D11VideoDecoderClient {
  15. public:
  16. using SetAcceleratorDecoderCB =
  17. base::RepeatingCallback<void(ComD3D11VideoDecoder)>;
  18. virtual D3D11PictureBuffer* GetPicture() = 0;
  19. virtual void UpdateTimestamp(D3D11PictureBuffer* picture_buffer) = 0;
  20. virtual bool OutputResult(const CodecPicture* picture,
  21. D3D11PictureBuffer* picture_buffer) = 0;
  22. // Called by the accelerator to provide a callback that can be used to give
  23. // the accelerator a D3D11VideoDecoder object. Must be called during
  24. // construction of the accelerator.
  25. virtual void SetDecoderCB(const SetAcceleratorDecoderCB&) = 0;
  26. protected:
  27. virtual ~D3D11VideoDecoderClient() = default;
  28. };
  29. } // namespace media
  30. #endif // MEDIA_GPU_WINDOWS_D3D11_VIDEO_DECODER_CLIENT_H_