2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
22 #include "DllAvCodec.h"
23 #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
24 #include "guilib/D3DResource.h"
25 #include "threads/Event.h"
26 #include "DVDResource.h"
31 #include "settings/VideoSettings.h"
32 #include "guilib/Geometry.h"
38 const DXVAHD_FILTER PROCAMP_FILTERS[] =
40 DXVAHD_FILTER_BRIGHTNESS,
41 DXVAHD_FILTER_CONTRAST,
43 DXVAHD_FILTER_SATURATION
46 const DWORD NUM_FILTERS = ARRAYSIZE(PROCAMP_FILTERS);
55 virtual bool PreInit();
56 virtual void UnInit();
57 virtual bool Open(UINT width, UINT height, unsigned int flags, unsigned int format, unsigned int extended_format);
59 virtual REFERENCE_TIME Add(DVDVideoPicture* picture);
60 virtual bool Render(CRect src, CRect dst, IDirect3DSurface9* target, const REFERENCE_TIME time, DWORD flags);
61 virtual unsigned Size() { if (m_pDXVAHD) return m_size; return 0; }
63 virtual void OnCreateDevice() {}
64 virtual void OnDestroyDevice() { CSingleLock lock(m_section); UnInit(); }
65 virtual void OnLostDevice() { CSingleLock lock(m_section); UnInit(); }
66 virtual void OnResetDevice() { CSingleLock lock(m_section); Close(); }
69 virtual bool UpdateSize(const DXVA2_VideoDesc& dsc);
70 virtual bool ReInit();
71 virtual bool CreateSurfaces();
72 virtual bool OpenProcessor();
73 virtual bool ApplyFilter(DXVAHD_FILTER filter, int value, int min, int max, int def);
75 IDXVAHD_Device *m_pDXVAHD; // DXVA-HD device.
76 IDXVAHD_VideoProcessor *m_pDXVAVP; // DXVA-HD video processor.
77 DXVAHD_VPDEVCAPS m_caps;
78 DXVAHD_VPCAPS m_VPCaps;
81 unsigned int m_height;
83 REFERENCE_TIME m_frame;
85 unsigned int m_renderFormat;
90 DXVAHD_FILTER_RANGE_DATA Range;
92 ProcAmpInfo m_Filters[NUM_FILTERS];
96 IDirect3DSurface9* pSurface;
97 CSurfaceContext* context;
101 typedef std::deque<SFrame> SFrames;
104 CSurfaceContext* m_context;
106 unsigned m_max_back_refs;
107 unsigned m_max_fwd_refs;
110 LPDIRECT3DSURFACE9* m_surfaces;
111 CCriticalSection m_section;