kodi
RendererSoftware.h
1 /*
2  * Copyright (C) 2017-2019 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 #pragma once
9 
10 #include "RendererBase.h"
11 
12 #include <map>
13 extern "C" {
14 #include <libavutil/pixfmt.h>
15 #include <libswscale/swscale.h>
16 }
17 
19 {
20  class CRenderBufferImpl;
21 public:
23 
24  bool Configure(const VideoPicture& picture, float fps, unsigned orientation) override;
25  bool Supports(ESCALINGMETHOD method) const override;
26 
27  static CRendererBase* Create(CVideoSettings& videoSettings);
28  static void GetWeight(std::map<RenderMethod, int>& weights, const VideoPicture& picture);
29 
30 protected:
31  explicit CRendererSoftware(CVideoSettings& videoSettings);
32  CRenderBuffer* CreateBuffer() override;
33  void RenderImpl(CD3DTexture& target, CRect& sourceRect, CPoint(&destPoints)[4], uint32_t flags) override;
34  void FinalOutput(CD3DTexture& source, CD3DTexture& target, const CRect& src, const CPoint(&destPoints)[4]) override;
35 
36 private:
37  SwsContext* m_sw_scale_ctx = nullptr;
38  SwsFilter* m_srcFilter = nullptr;
39  bool m_restoreMultithreadProtectedOff = false;
40 };
41 
43 {
44 public:
45  explicit CRenderBufferImpl(AVPixelFormat av_pix_format, unsigned width, unsigned height);
47 
48  void AppendPicture(const VideoPicture& picture) override;
49  bool GetDataPlanes(uint8_t*(&planes)[3], int(&strides)[3]) override;
50 
51  void ReleasePicture() override;
52  bool UploadBuffer() override;
53 
54 private:
55  D3D11_MAPPED_SUBRESOURCE m_msr{};
56 };
Definition: D3DResource.h:90
Definition: RendererSoftware.h:42
Definition: RendererBase.h:57
Definition: DVDVideoCodec.h:36
Definition: VideoSettings.h:194
Definition: RendererSoftware.h:18
Definition: RendererBase.h:111