ReactOS 0.4.17-dev-934-g091855f
main.c File Reference
#include <stdarg.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "d3d9.h"
#include "physicalmonitorenumerationapi.h"
#include "lowlevelmonitorconfigurationapi.h"
#include "highlevelmonitorconfigurationapi.h"
#include "initguid.h"
#include "dxva2api.h"
#include "dxvahd.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  device_handle
 
struct  device_manager
 
struct  video_processor
 
struct  dxva_processor_device_desc
 

Macros

#define COBJMACROS
 
#define D3DFMT_NV12   MAKEFOURCC('N','V','1','2')
 

Enumerations

enum  device_handle_flags { HANDLE_FLAG_OPEN = 0x1 , HANDLE_FLAG_INVALID = 0x2 }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dxva2)
 
static BOOL dxva_array_reserve (void **elements, size_t *capacity, size_t count, size_t size)
 
static struct device_manager * impl_from_IDirect3DDeviceManager9 (IDirect3DDeviceManager9 *iface)
 
static struct device_manager * impl_from_IDirectXVideoProcessorService (IDirectXVideoProcessorService *iface)
 
static struct device_manager * impl_from_IDirectXVideoDecoderService (IDirectXVideoDecoderService *iface)
 
static struct video_processor * impl_from_IDirectXVideoProcessor (IDirectXVideoProcessor *iface)
 
static HRESULT WINAPI video_processor_QueryInterface (IDirectXVideoProcessor *iface, REFIID riid, void **obj)
 
static ULONG WINAPI video_processor_AddRef (IDirectXVideoProcessor *iface)
 
static ULONG WINAPI video_processor_Release (IDirectXVideoProcessor *iface)
 
static HRESULT WINAPI video_processor_GetVideoProcessorService (IDirectXVideoProcessor *iface, IDirectXVideoProcessorService **service)
 
static HRESULT WINAPI video_processor_GetCreationParameters (IDirectXVideoProcessor *iface, GUID *device, DXVA2_VideoDesc *video_desc, D3DFORMAT *rt_format, UINT *max_substreams)
 
static HRESULT WINAPI video_processor_GetVideoProcessorCaps (IDirectXVideoProcessor *iface, DXVA2_VideoProcessorCaps *caps)
 
static HRESULT WINAPI video_processor_GetProcAmpRange (IDirectXVideoProcessor *iface, UINT cap, DXVA2_ValueRange *range)
 
static HRESULT WINAPI video_processor_GetFilterPropertyRange (IDirectXVideoProcessor *iface, UINT setting, DXVA2_ValueRange *range)
 
static BOOL intersect_rect (RECT *dest, const RECT *src1, const RECT *src2)
 
static D3DCOLOR video_processor_get_background_color (const DXVA2_AYUVSample16 *ayuv)
 
static HRESULT WINAPI video_processor_VideoProcessBlt (IDirectXVideoProcessor *iface, IDirect3DSurface9 *rt, const DXVA2_VideoProcessBltParams *params, const DXVA2_VideoSample *samples, UINT sample_count, HANDLE *complete_handle)
 
static HRESULT WINAPI device_manager_processor_service_QueryInterface (IDirectXVideoProcessorService *iface, REFIID riid, void **obj)
 
static ULONG WINAPI device_manager_processor_service_AddRef (IDirectXVideoProcessorService *iface)
 
static ULONG WINAPI device_manager_processor_service_Release (IDirectXVideoProcessorService *iface)
 
static HRESULT WINAPI device_manager_processor_service_CreateSurface (IDirectXVideoProcessorService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
 
static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSoftwareDevice (IDirectXVideoProcessorService *iface, void *callbacks)
 
static BOOL dxva_is_supported_stream_format (const DXVA2_VideoDesc *video_desc, const D3DFORMAT *formats)
 
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids (IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids)
 
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTargets (IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count, D3DFORMAT **formats)
 
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorSubStreamFormats (IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT *count, D3DFORMAT **formats)
 
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorCaps (IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, DXVA2_VideoProcessorCaps *caps)
 
static HRESULT WINAPI device_manager_processor_service_GetProcAmpRange (IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT ProcAmpCap, DXVA2_ValueRange *range)
 
static HRESULT WINAPI device_manager_processor_service_GetFilterPropertyRange (IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT filter_setting, DXVA2_ValueRange *range)
 
static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor (IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT max_substreams, IDirectXVideoProcessor **processor)
 
static HRESULT WINAPI device_manager_decoder_service_QueryInterface (IDirectXVideoDecoderService *iface, REFIID riid, void **obj)
 
static ULONG WINAPI device_manager_decoder_service_AddRef (IDirectXVideoDecoderService *iface)
 
static ULONG WINAPI device_manager_decoder_service_Release (IDirectXVideoDecoderService *iface)
 
static HRESULT WINAPI device_manager_decoder_service_CreateSurface (IDirectXVideoDecoderService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
 
static HRESULT WINAPI device_manager_decoder_service_GetDecoderDeviceGuids (IDirectXVideoDecoderService *iface, UINT *count, GUID **guids)
 
static HRESULT WINAPI device_manager_decoder_service_GetDecoderRenderTargets (IDirectXVideoDecoderService *iface, REFGUID guid, UINT *count, D3DFORMAT **formats)
 
static HRESULT WINAPI device_manager_decoder_service_GetDecoderConfigurations (IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, void *reserved, UINT *count, DXVA2_ConfigPictureDecode **configs)
 
static HRESULT WINAPI device_manager_decoder_service_CreateVideoDecoder (IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, const DXVA2_ConfigPictureDecode *config, IDirect3DSurface9 **rts, UINT num_surfaces, IDirectXVideoDecoder **decoder)
 
static HRESULT WINAPI device_manager_QueryInterface (IDirect3DDeviceManager9 *iface, REFIID riid, void **obj)
 
static ULONG WINAPI device_manager_AddRef (IDirect3DDeviceManager9 *iface)
 
static ULONG WINAPI device_manager_Release (IDirect3DDeviceManager9 *iface)
 
static HRESULT WINAPI device_manager_ResetDevice (IDirect3DDeviceManager9 *iface, IDirect3DDevice9 *device, UINT token)
 
static HRESULT WINAPI device_manager_OpenDeviceHandle (IDirect3DDeviceManager9 *iface, HANDLE *hdevice)
 
static HRESULT device_manager_get_handle_index (struct device_manager *manager, HANDLE hdevice, size_t *idx)
 
static HRESULT WINAPI device_manager_CloseDeviceHandle (IDirect3DDeviceManager9 *iface, HANDLE hdevice)
 
static HRESULT WINAPI device_manager_TestDevice (IDirect3DDeviceManager9 *iface, HANDLE hdevice)
 
static HRESULT WINAPI device_manager_LockDevice (IDirect3DDeviceManager9 *iface, HANDLE hdevice, IDirect3DDevice9 **device, BOOL block)
 
static HRESULT WINAPI device_manager_UnlockDevice (IDirect3DDeviceManager9 *iface, HANDLE hdevice, BOOL savestate)
 
static HRESULT WINAPI device_manager_GetVideoService (IDirect3DDeviceManager9 *iface, HANDLE hdevice, REFIID riid, void **obj)
 
BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply (HMONITOR monitor, LPSTR buffer, DWORD length)
 
HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9 (UINT *token, IDirect3DDeviceManager9 **manager)
 
HRESULT WINAPI DXVA2CreateVideoService (IDirect3DDevice9 *device, REFIID riid, void **obj)
 
BOOL WINAPI DegaussMonitor (HMONITOR monitor)
 
BOOL WINAPI DestroyPhysicalMonitor (HMONITOR monitor)
 
BOOL WINAPI DestroyPhysicalMonitors (DWORD arraySize, LPPHYSICAL_MONITOR array)
 
BOOL WINAPI GetCapabilitiesStringLength (HMONITOR monitor, LPDWORD length)
 
BOOL WINAPI GetMonitorBrightness (HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorCapabilities (HMONITOR monitor, LPDWORD capabilities, LPDWORD temperatures)
 
BOOL WINAPI GetMonitorColorTemperature (HMONITOR monitor, LPMC_COLOR_TEMPERATURE temperature)
 
BOOL WINAPI GetMonitorContrast (HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorDisplayAreaPosition (HMONITOR monitor, MC_POSITION_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorDisplayAreaSize (HMONITOR monitor, MC_SIZE_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorRedGreenOrBlueDrive (HMONITOR monitor, MC_DRIVE_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorRedGreenOrBlueGain (HMONITOR monitor, MC_GAIN_TYPE type, LPDWORD minimum, LPDWORD current, LPDWORD maximum)
 
BOOL WINAPI GetMonitorTechnologyType (HMONITOR monitor, LPMC_DISPLAY_TECHNOLOGY_TYPE type)
 
BOOL WINAPI GetNumberOfPhysicalMonitorsFromHMONITOR (HMONITOR monitor, LPDWORD number)
 
HRESULT WINAPI GetNumberOfPhysicalMonitorsFromIDirect3DDevice9 (IDirect3DDevice9 *device, LPDWORD number)
 
BOOL WINAPI GetPhysicalMonitorsFromHMONITOR (HMONITOR monitor, DWORD arraySize, LPPHYSICAL_MONITOR array)
 
HRESULT WINAPI GetPhysicalMonitorsFromIDirect3DDevice9 (IDirect3DDevice9 *device, DWORD arraySize, LPPHYSICAL_MONITOR array)
 
BOOL WINAPI GetTimingReport (HMONITOR monitor, LPMC_TIMING_REPORT timingReport)
 
BOOL WINAPI GetVCPFeatureAndVCPFeatureReply (HMONITOR monitor, BYTE vcpCode, LPMC_VCP_CODE_TYPE pvct, LPDWORD current, LPDWORD maximum)
 
HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR (HMONITOR monitor, int vos, ULONG *numVideoOutputs, void ***videoOutputs)
 
HRESULT WINAPI OPMGetVideoOutputsFromIDirect3DDevice9Object (IDirect3DDevice9 *device, int vos, ULONG *numVideoOutputs, void ***videoOutputs)
 
BOOL WINAPI RestoreMonitorFactoryColorDefaults (HMONITOR monitor)
 
BOOL WINAPI RestoreMonitorFactoryDefaults (HMONITOR monitor)
 
BOOL WINAPI SaveCurrentMonitorSettings (HMONITOR monitor)
 
BOOL WINAPI SaveCurrentSettings (HMONITOR monitor)
 
BOOL WINAPI SetMonitorBrightness (HMONITOR monitor, DWORD brightness)
 
BOOL WINAPI SetMonitorColorTemperature (HMONITOR monitor, MC_COLOR_TEMPERATURE temperature)
 
BOOL WINAPI SetMonitorContrast (HMONITOR monitor, DWORD contrast)
 
BOOL WINAPI SetMonitorDisplayAreaPosition (HMONITOR monitor, MC_POSITION_TYPE type, DWORD position)
 
BOOL WINAPI SetMonitorDisplayAreaSize (HMONITOR monitor, MC_SIZE_TYPE type, DWORD size)
 
BOOL WINAPI SetMonitorRedGreenOrBlueDrive (HMONITOR monitor, MC_DRIVE_TYPE type, DWORD drive)
 
BOOL WINAPI SetMonitorRedGreenOrBlueGain (HMONITOR monitor, MC_GAIN_TYPE type, DWORD gain)
 
BOOL WINAPI SetVCPFeature (HMONITOR monitor, BYTE vcpCode, DWORD value)
 
HRESULT WINAPI DXVAHD_CreateDevice (IDirect3DDevice9Ex *d3d9_device, const DXVAHD_CONTENT_DESC *desc, DXVAHD_DEVICE_USAGE usage, PDXVAHDSW_Plugin plugin, IDXVAHD_Device **device)
 

Variables

static const DXVA2_VideoProcessorCaps software_processor_caps
 
static const DXVA2_VideoProcessorCaps progressive_processor_caps
 
static const IDirectXVideoProcessorVtbl video_processor_vtbl
 
static const D3DFORMAT software_processor_input_formats []
 
static const D3DFORMAT progressive_processor_input_formats []
 
static const struct dxva_processor_device_desc processor_devices []
 
static const IDirectXVideoProcessorServiceVtbl device_manager_processor_service_vtbl
 
static const IDirectXVideoDecoderServiceVtbl device_manager_decoder_service_vtbl
 
static const IDirect3DDeviceManager9Vtbl device_manager_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file main.c.

◆ D3DFMT_NV12

#define D3DFMT_NV12   MAKEFOURCC('N','V','1','2')

Definition at line 37 of file main.c.

Enumeration Type Documentation

◆ device_handle_flags

Enumerator
HANDLE_FLAG_OPEN 
HANDLE_FLAG_INVALID 

Definition at line 39 of file main.c.

40{
41 HANDLE_FLAG_OPEN = 0x1,
43};
@ HANDLE_FLAG_OPEN
Definition: main.c:41
@ HANDLE_FLAG_INVALID
Definition: main.c:42

Function Documentation

◆ CapabilitiesRequestAndCapabilitiesReply()

BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply ( HMONITOR  monitor,
LPSTR  buffer,
DWORD  length 
)

Definition at line 1038 of file main.c.

1039{
1040 FIXME("%p, %p, %ld: stub.\n", monitor, buffer, length);
1041
1043 return FALSE;
1044}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define FALSE
Definition: types.h:117
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define SetLastError(x)
Definition: compat.h:752
GLuint buffer
Definition: glext.h:5915
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ DegaussMonitor()

BOOL WINAPI DegaussMonitor ( HMONITOR  monitor)

Definition at line 1098 of file main.c.

1099{
1100 FIXME("(%p): stub\n", monitor);
1101
1103 return FALSE;
1104}

◆ DestroyPhysicalMonitor()

BOOL WINAPI DestroyPhysicalMonitor ( HMONITOR  monitor)

Definition at line 1106 of file main.c.

1107{
1108 FIXME("(%p): stub\n", monitor);
1109
1111 return FALSE;
1112}

◆ DestroyPhysicalMonitors()

BOOL WINAPI DestroyPhysicalMonitors ( DWORD  arraySize,
LPPHYSICAL_MONITOR  array 
)

Definition at line 1114 of file main.c.

1115{
1116 FIXME("%lu, %p: stub.\n", arraySize, array);
1117
1119 return FALSE;
1120}
Definition: undname.c:54

◆ device_manager_AddRef()

static ULONG WINAPI device_manager_AddRef ( IDirect3DDeviceManager9 *  iface)
static

Definition at line 751 of file main.c.

752{
753 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
755
756 TRACE("%p, refcount %lu.\n", iface, refcount);
757
758 return refcount;
759}
#define InterlockedIncrement
Definition: armddk.h:53
static struct device_manager * impl_from_IDirect3DDeviceManager9(IDirect3DDeviceManager9 *iface)
Definition: main.c:110
#define TRACE(s)
Definition: solgame.cpp:4
LONG refcount
Definition: main.c:56
uint32_t ULONG
Definition: typedefs.h:59

◆ device_manager_CloseDeviceHandle()

static HRESULT WINAPI device_manager_CloseDeviceHandle ( IDirect3DDeviceManager9 *  iface,
HANDLE  hdevice 
)
static

Definition at line 868 of file main.c.

869{
870 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
871 HRESULT hr;
872 size_t idx;
873
874 TRACE("%p, %p.\n", iface, hdevice);
875
876 EnterCriticalSection(&manager->cs);
877 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
878 {
879 if (manager->handles[idx].flags & HANDLE_FLAG_OPEN)
880 {
881 if (manager->locking_handle == hdevice)
882 manager->locking_handle = NULL;
883 manager->handles[idx].flags = 0;
884 if (idx == manager->count - 1)
885 manager->count--;
886 if (manager->handles[idx].state_block)
887 IDirect3DStateBlock9_Release(manager->handles[idx].state_block);
888 manager->handles[idx].state_block = NULL;
889 }
890 else
891 hr = E_HANDLE;
892 }
893 LeaveCriticalSection(&manager->cs);
894
896
897 return hr;
898}
#define IDirect3DStateBlock9_Release(p)
Definition: d3d9.h:1128
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
static HRESULT device_manager_get_handle_index(struct device_manager *manager, HANDLE hdevice, size_t *idx)
Definition: main.c:860
unsigned int idx
Definition: utils.c:40
VOID WINAPI WakeAllConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:91
#define SUCCEEDED(hr)
Definition: intsafe.h:50
size_t count
Definition: main.c:62
HANDLE locking_handle
Definition: main.c:65
CONDITION_VARIABLE lock
Definition: main.c:68
CRITICAL_SECTION cs
Definition: main.c:67
struct device_handle * handles
Definition: main.c:61
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define E_HANDLE
Definition: winerror.h:4117

◆ device_manager_decoder_service_AddRef()

static ULONG WINAPI device_manager_decoder_service_AddRef ( IDirectXVideoDecoderService *  iface)
static

Definition at line 666 of file main.c.

667{
669 return IDirect3DDeviceManager9_AddRef(&manager->IDirect3DDeviceManager9_iface);
670}
static struct device_manager * impl_from_IDirectXVideoDecoderService(IDirectXVideoDecoderService *iface)
Definition: main.c:120
IDirect3DDeviceManager9 IDirect3DDeviceManager9_iface
Definition: main.c:53

◆ device_manager_decoder_service_CreateSurface()

static HRESULT WINAPI device_manager_decoder_service_CreateSurface ( IDirectXVideoDecoderService *  iface,
UINT  width,
UINT  height,
UINT  backbuffers,
D3DFORMAT  format,
D3DPOOL  pool,
DWORD  usage,
DWORD  dxvaType,
IDirect3DSurface9 **  surfaces,
HANDLE *  shared_handle 
)
static

Definition at line 678 of file main.c.

681{
682 FIXME("%p, %u, %u, %u, %#x, %d, %ld, %ld, %p, %p.\n", iface, width, height, backbuffers, format, pool, usage,
683 dxvaType, surfaces, shared_handle);
684
685 return E_NOTIMPL;
686}
#define E_NOTIMPL
Definition: ddrawi.h:99
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
const GLvdpauSurfaceNV * surfaces
Definition: glext.h:11586
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919

◆ device_manager_decoder_service_CreateVideoDecoder()

static HRESULT WINAPI device_manager_decoder_service_CreateVideoDecoder ( IDirectXVideoDecoderService *  iface,
REFGUID  guid,
const DXVA2_VideoDesc *  video_desc,
const DXVA2_ConfigPictureDecode *  config,
IDirect3DSurface9 **  rts,
UINT  num_surfaces,
IDirectXVideoDecoder **  decoder 
)
static

Definition at line 712 of file main.c.

715{
716 FIXME("%p, %s, %p, %p, %p, %u, %p.\n", iface, debugstr_guid(guid), video_desc, config, rts, num_surfaces,
717 decoder);
718
719 return E_NOTIMPL;
720}
GUID guid
Definition: version.c:147
#define debugstr_guid
Definition: kernel32.h:35

◆ device_manager_decoder_service_GetDecoderConfigurations()

static HRESULT WINAPI device_manager_decoder_service_GetDecoderConfigurations ( IDirectXVideoDecoderService *  iface,
REFGUID  guid,
const DXVA2_VideoDesc *  video_desc,
void *  reserved,
UINT *  count,
DXVA2_ConfigPictureDecode **  configs 
)
static

Definition at line 704 of file main.c.

706{
707 FIXME("%p, %s, %p, %p, %p, %p.\n", iface, debugstr_guid(guid), video_desc, reserved, count, configs);
708
709 return E_NOTIMPL;
710}
r reserved
Definition: btrfs.c:3006
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ device_manager_decoder_service_GetDecoderDeviceGuids()

static HRESULT WINAPI device_manager_decoder_service_GetDecoderDeviceGuids ( IDirectXVideoDecoderService *  iface,
UINT *  count,
GUID **  guids 
)
static

Definition at line 688 of file main.c.

690{
691 FIXME("%p, %p, %p.\n", iface, count, guids);
692
693 return E_NOTIMPL;
694}
const struct sortguid * guids
Definition: locale.c:422

◆ device_manager_decoder_service_GetDecoderRenderTargets()

static HRESULT WINAPI device_manager_decoder_service_GetDecoderRenderTargets ( IDirectXVideoDecoderService *  iface,
REFGUID  guid,
UINT *  count,
D3DFORMAT **  formats 
)
static

Definition at line 696 of file main.c.

698{
699 FIXME("%p, %s, %p, %p.\n", iface, debugstr_guid(guid), count, formats);
700
701 return E_NOTIMPL;
702}
static const struct pixel_format_desc formats[]
Definition: util.c:31

◆ device_manager_decoder_service_QueryInterface()

static HRESULT WINAPI device_manager_decoder_service_QueryInterface ( IDirectXVideoDecoderService *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 649 of file main.c.

651{
652 if (IsEqualIID(riid, &IID_IDirectXVideoDecoderService) ||
653 IsEqualIID(riid, &IID_IDirectXVideoAccelerationService) ||
655 {
656 *obj = iface;
657 IDirectXVideoDecoderService_AddRef(iface);
658 return S_OK;
659 }
660
661 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
662 *obj = NULL;
663 return E_NOINTERFACE;
664}
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ device_manager_decoder_service_Release()

static ULONG WINAPI device_manager_decoder_service_Release ( IDirectXVideoDecoderService *  iface)
static

Definition at line 672 of file main.c.

673{
675 return IDirect3DDeviceManager9_Release(&manager->IDirect3DDeviceManager9_iface);
676}

◆ device_manager_get_handle_index()

static HRESULT device_manager_get_handle_index ( struct device_manager *  manager,
HANDLE  hdevice,
size_t *  idx 
)
static

Definition at line 860 of file main.c.

861{
862 if (!hdevice || hdevice > ULongToHandle(manager->count))
863 return E_HANDLE;
864 *idx = (ULONG_PTR)hdevice - 1;
865 return S_OK;
866}
#define ULongToHandle(h)
Definition: basetsd.h:75
#define ULONG_PTR
Definition: config.h:101

Referenced by device_manager_CloseDeviceHandle(), device_manager_GetVideoService(), device_manager_LockDevice(), device_manager_TestDevice(), and device_manager_UnlockDevice().

◆ device_manager_GetVideoService()

static HRESULT WINAPI device_manager_GetVideoService ( IDirect3DDeviceManager9 *  iface,
HANDLE  hdevice,
REFIID  riid,
void **  obj 
)
static

Definition at line 997 of file main.c.

999{
1000 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
1001 HRESULT hr;
1002 size_t idx;
1003
1004 TRACE("%p, %p, %s, %p.\n", iface, hdevice, debugstr_guid(riid), obj);
1005
1006 EnterCriticalSection(&manager->cs);
1007 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
1008 {
1009 unsigned int flags = manager->handles[idx].flags;
1010
1012 hr = DXVA2_E_NEW_VIDEO_DEVICE;
1013 else if (!(flags & HANDLE_FLAG_OPEN))
1014 hr = E_HANDLE;
1015 else
1016 hr = IDirectXVideoProcessorService_QueryInterface(&manager->IDirectXVideoProcessorService_iface,
1017 riid, obj);
1018 }
1019 LeaveCriticalSection(&manager->cs);
1020
1021 return hr;
1022}
GLbitfield flags
Definition: glext.h:7161
IDirectXVideoProcessorService IDirectXVideoProcessorService_iface
Definition: main.c:54

◆ device_manager_LockDevice()

static HRESULT WINAPI device_manager_LockDevice ( IDirect3DDeviceManager9 *  iface,
HANDLE  hdevice,
IDirect3DDevice9 **  device,
BOOL  block 
)
static

Definition at line 923 of file main.c.

925{
926 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
927 HRESULT hr;
928 size_t idx;
929
930 TRACE("%p, %p, %p, %d.\n", iface, hdevice, device, block);
931
932 EnterCriticalSection(&manager->cs);
933 if (!manager->device)
934 hr = DXVA2_E_NOT_INITIALIZED;
935 else if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
936 {
937 if (manager->locking_handle && !block)
938 hr = DXVA2_E_VIDEO_DEVICE_LOCKED;
939 else
940 {
941 while (manager->locking_handle && block)
942 {
943 SleepConditionVariableCS(&manager->lock, &manager->cs, INFINITE);
944 }
945
946 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
947 {
948 if (manager->handles[idx].flags & HANDLE_FLAG_INVALID)
949 hr = DXVA2_E_NEW_VIDEO_DEVICE;
950 else
951 {
952 if (manager->handles[idx].state_block)
953 {
954 if (FAILED(IDirect3DStateBlock9_Apply(manager->handles[idx].state_block)))
955 WARN("Failed to apply state.\n");
956 IDirect3DStateBlock9_Release(manager->handles[idx].state_block);
957 manager->handles[idx].state_block = NULL;
958 }
959 *device = manager->device;
961 manager->locking_handle = hdevice;
962 }
963 }
964 }
965 }
966 LeaveCriticalSection(&manager->cs);
967
968 return hr;
969}
#define IDirect3DStateBlock9_Apply(p)
Definition: d3d9.h:1132
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1335
BOOL WINAPI SleepConditionVariableCS(PCONDITION_VARIABLE ConditionVariable, PCRITICAL_SECTION CriticalSection, DWORD Timeout)
Definition: sync.c:59
#define INFINITE
Definition: serial.h:102
#define FAILED(hr)
Definition: intsafe.h:51
IDirect3DDevice9 * device
Definition: main.c:58
Definition: devices.h:37
static unsigned int block
Definition: xmlmemory.c:101

◆ device_manager_OpenDeviceHandle()

static HRESULT WINAPI device_manager_OpenDeviceHandle ( IDirect3DDeviceManager9 *  iface,
HANDLE *  hdevice 
)
static

Definition at line 819 of file main.c.

820{
821 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
822 HRESULT hr = S_OK;
823 size_t i;
824
825 TRACE("%p, %p.\n", iface, hdevice);
826
827 *hdevice = NULL;
828
829 EnterCriticalSection(&manager->cs);
830 if (!manager->device)
831 hr = DXVA2_E_NOT_INITIALIZED;
832 else
833 {
834 for (i = 0; i < manager->count; ++i)
835 {
836 if (!(manager->handles[i].flags & HANDLE_FLAG_OPEN))
837 {
838 manager->handles[i].flags |= HANDLE_FLAG_OPEN;
839 *hdevice = ULongToHandle(i + 1);
840 break;
841 }
842 }
843
844 if (dxva_array_reserve((void **)&manager->handles, &manager->capacity, manager->count + 1,
845 sizeof(*manager->handles)))
846 {
847 *hdevice = ULongToHandle(manager->count + 1);
848 manager->handles[manager->count].flags = HANDLE_FLAG_OPEN;
849 manager->handles[manager->count].state_block = NULL;
850 manager->count++;
851 }
852 else
854 }
855 LeaveCriticalSection(&manager->cs);
856
857 return hr;
858}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static BOOL dxva_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
Definition: main.c:83
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
size_t capacity
Definition: main.c:63

◆ device_manager_processor_service_AddRef()

static ULONG WINAPI device_manager_processor_service_AddRef ( IDirectXVideoProcessorService *  iface)
static

Definition at line 381 of file main.c.

382{
384 return IDirect3DDeviceManager9_AddRef(&manager->IDirect3DDeviceManager9_iface);
385}
static struct device_manager * impl_from_IDirectXVideoProcessorService(IDirectXVideoProcessorService *iface)
Definition: main.c:115

◆ device_manager_processor_service_CreateSurface()

static HRESULT WINAPI device_manager_processor_service_CreateSurface ( IDirectXVideoProcessorService *  iface,
UINT  width,
UINT  height,
UINT  backbuffers,
D3DFORMAT  format,
D3DPOOL  pool,
DWORD  usage,
DWORD  dxvaType,
IDirect3DSurface9 **  surfaces,
HANDLE *  shared_handle 
)
static

Definition at line 393 of file main.c.

396{
398 unsigned int i, j;
399 HRESULT hr;
400
401 TRACE("%p, %u, %u, %u, %u, %u, %lu, %lu, %p, %p.\n", iface, width, height, backbuffers, format, pool, usage, dxvaType,
402 surfaces, shared_handle);
403
404 if (backbuffers >= UINT_MAX)
405 return E_INVALIDARG;
406
407 memset(surfaces, 0, (backbuffers + 1) * sizeof(*surfaces));
408
409 for (i = 0; i < backbuffers + 1; ++i)
410 {
412 pool, &surfaces[i], NULL)))
413 break;
414 }
415
416 if (FAILED(hr))
417 {
418 for (j = 0; j < i; ++j)
419 {
420 if (surfaces[j])
421 {
423 surfaces[j] = NULL;
424 }
425 }
426 }
427
428 return hr;
429}
#define IDirect3DSurface9_Release(p)
Definition: d3d9.h:450
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
Definition: d3d9.h:1371
#define E_INVALIDARG
Definition: ddrawi.h:101
#define UINT_MAX
Definition: limits.h:27
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define memset(x, y, z)
Definition: compat.h:39

◆ device_manager_processor_service_CreateVideoProcessor()

static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor ( IDirectXVideoProcessorService *  iface,
REFGUID  device,
const DXVA2_VideoDesc *  video_desc,
D3DFORMAT  rt_format,
UINT  max_substreams,
IDirectXVideoProcessor **  processor 
)
static

Definition at line 599 of file main.c.

602{
603 struct video_processor *object;
604
605 FIXME("%p, %s, %p, %d, %u, %p.\n", iface, debugstr_guid(device), video_desc, rt_format, max_substreams,
606 processor);
607
608 /* FIXME: validate render target format */
609
610 if (max_substreams >= 16)
611 {
612 WARN("Invalid substreams count %u.\n", max_substreams);
613 return E_INVALIDARG;
614 }
615
616 if (!(object = calloc(1, sizeof(*object))))
617 return E_OUTOFMEMORY;
618
619 object->IDirectXVideoProcessor_iface.lpVtbl = &video_processor_vtbl;
620 object->refcount = 1;
621 object->service = iface;
622 IDirectXVideoProcessorService_AddRef(object->service);
623 object->device = *device;
624 object->video_desc = *video_desc;
625 object->rt_format = rt_format;
626 object->max_substreams = max_substreams;
627
628 *processor = &object->IDirectXVideoProcessor_iface;
629
630 return S_OK;
631}
static const IDirectXVideoProcessorVtbl video_processor_vtbl
Definition: main.c:342
#define calloc
Definition: rosglue.h:14
D3DFORMAT rt_format
Definition: main.c:79
unsigned int max_substreams
Definition: main.c:80
GUID device
Definition: main.c:77
DXVA2_VideoDesc video_desc
Definition: main.c:78

◆ device_manager_processor_service_GetFilterPropertyRange()

static HRESULT WINAPI device_manager_processor_service_GetFilterPropertyRange ( IDirectXVideoProcessorService *  iface,
REFGUID  deviceguid,
const DXVA2_VideoDesc *  video_desc,
D3DFORMAT  rt_format,
UINT  filter_setting,
DXVA2_ValueRange *  range 
)
static

Definition at line 590 of file main.c.

593{
594 FIXME("%p, %s, %p, %d, %d, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, filter_setting, range);
595
596 return E_NOTIMPL;
597}
range
Definition: d3dx9_private.h:58

◆ device_manager_processor_service_GetProcAmpRange()

static HRESULT WINAPI device_manager_processor_service_GetProcAmpRange ( IDirectXVideoProcessorService *  iface,
REFGUID  deviceguid,
const DXVA2_VideoDesc *  video_desc,
D3DFORMAT  rt_format,
UINT  ProcAmpCap,
DXVA2_ValueRange *  range 
)
static

Definition at line 581 of file main.c.

584{
585 FIXME("%p, %s, %p, %u, %u, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, ProcAmpCap, range);
586
587 return E_NOTIMPL;
588}

◆ device_manager_processor_service_GetVideoProcessorCaps()

static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorCaps ( IDirectXVideoProcessorService *  iface,
REFGUID  device,
const DXVA2_VideoDesc *  video_desc,
D3DFORMAT  rt_format,
DXVA2_VideoProcessorCaps *  caps 
)
static

Definition at line 558 of file main.c.

561{
562 TRACE("%p, %s, %p, %u, %p.\n", iface, debugstr_guid(device), video_desc, rt_format, caps);
563
564 if (IsEqualGUID(device, &DXVA2_VideoProcSoftwareDevice))
565 {
567 }
568 else if (IsEqualGUID(device, &DXVA2_VideoProcProgressiveDevice))
569 {
571 }
572 else
573 {
574 FIXME("Unrecognized device %s.\n", debugstr_guid(device));
575 return E_NOTIMPL;
576 }
577
578 return S_OK;
579}
static const DXVA2_VideoProcessorCaps software_processor_caps
Definition: main.c:130
static const DXVA2_VideoProcessorCaps progressive_processor_caps
Definition: main.c:139
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ device_manager_processor_service_GetVideoProcessorDeviceGuids()

static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids ( IDirectXVideoProcessorService *  iface,
const DXVA2_VideoDesc *  video_desc,
UINT *  count,
GUID **  guids 
)
static

Definition at line 472 of file main.c.

474{
475 unsigned int i;
476
477 FIXME("%p, %p, %p, %p semi-stub.\n", iface, video_desc, count, guids);
478
479 *count = 0;
480
481 if (!(*guids = CoTaskMemAlloc(ARRAY_SIZE(processor_devices) * sizeof(**guids))))
482 return E_OUTOFMEMORY;
483
484 for (i = 0; i < ARRAY_SIZE(processor_devices); ++i)
485 {
486 if (dxva_is_supported_stream_format(video_desc, processor_devices[i].input_formats))
487 {
488 (*guids)[*count] = *processor_devices[i].guid;
489 *count += 1;
490 }
491 }
492
493 if (!*count)
494 {
496 *guids = NULL;
497 return E_FAIL;
498 }
499
500 return S_OK;
501}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define E_FAIL
Definition: ddrawi.h:102
static const struct dxva_processor_device_desc processor_devices[]
Definition: main.c:455
static BOOL dxva_is_supported_stream_format(const DXVA2_VideoDesc *video_desc, const D3DFORMAT *formats)
Definition: main.c:461
void *WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: malloc.c:381
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389

◆ device_manager_processor_service_GetVideoProcessorRenderTargets()

static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTargets ( IDirectXVideoProcessorService *  iface,
REFGUID  deviceguid,
const DXVA2_VideoDesc *  video_desc,
UINT *  count,
D3DFORMAT **  formats 
)
static

Definition at line 503 of file main.c.

506{
507 TRACE("%p, %s, %p, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, count, formats);
508
509 if (IsEqualGUID(deviceguid, &DXVA2_VideoProcSoftwareDevice))
510 {
512 {
513 WARN("Unsupported content format %#x.\n", video_desc->Format);
514 return E_FAIL;
515 }
516
517 if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats))))
518 return E_OUTOFMEMORY;
519
520 *count = 2;
521 (*formats)[0] = D3DFMT_X8R8G8B8;
522 (*formats)[1] = D3DFMT_A8R8G8B8;
523
524 return S_OK;
525 }
526 else if (IsEqualGUID(deviceguid, &DXVA2_VideoProcProgressiveDevice))
527 {
529 {
530 WARN("Unsupported content format %#x.\n", video_desc->Format);
531 return E_FAIL;
532 }
533
534 if (!(*formats = CoTaskMemAlloc(2 * sizeof(**formats))))
535 return E_OUTOFMEMORY;
536
537 *count = 2;
538 (*formats)[0] = D3DFMT_X8R8G8B8;
539 (*formats)[1] = D3DFMT_NV12;
540
541 return S_OK;
542 }
543 else
544 FIXME("Unsupported device %s.\n", debugstr_guid(deviceguid));
545
546 return E_NOTIMPL;
547}
@ D3DFMT_A8R8G8B8
Definition: d3d8types.h:604
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
static const D3DFORMAT progressive_processor_input_formats[]
Definition: main.c:450
#define D3DFMT_NV12
Definition: main.c:37
static const D3DFORMAT software_processor_input_formats[]
Definition: main.c:445
D3DFORMAT Format
Definition: dxva2api.idl:289

◆ device_manager_processor_service_GetVideoProcessorSubStreamFormats()

static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorSubStreamFormats ( IDirectXVideoProcessorService *  iface,
REFGUID  deviceguid,
const DXVA2_VideoDesc *  video_desc,
D3DFORMAT  rt_format,
UINT *  count,
D3DFORMAT **  formats 
)
static

Definition at line 549 of file main.c.

552{
553 FIXME("%p, %s, %p, %u, %p, %p.\n", iface, debugstr_guid(deviceguid), video_desc, rt_format, count, formats);
554
555 return E_NOTIMPL;
556}

◆ device_manager_processor_service_QueryInterface()

static HRESULT WINAPI device_manager_processor_service_QueryInterface ( IDirectXVideoProcessorService *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 355 of file main.c.

357{
359
360 if (IsEqualIID(riid, &IID_IDirectXVideoProcessorService) ||
361 IsEqualIID(riid, &IID_IDirectXVideoAccelerationService) ||
363 {
364 *obj = iface;
365 }
366 else if (IsEqualIID(riid, &IID_IDirectXVideoDecoderService))
367 {
369 }
370 else
371 {
372 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
373 *obj = NULL;
374 return E_NOINTERFACE;
375 }
376
377 IUnknown_AddRef((IUnknown *)*obj);
378 return S_OK;
379}
IDirectXVideoDecoderService IDirectXVideoDecoderService_iface
Definition: main.c:55

◆ device_manager_processor_service_RegisterVideoProcessorSoftwareDevice()

static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSoftwareDevice ( IDirectXVideoProcessorService *  iface,
void *  callbacks 
)
static

Definition at line 431 of file main.c.

433{
434 FIXME("%p, %p.\n", iface, callbacks);
435
436 return E_NOTIMPL;
437}

◆ device_manager_processor_service_Release()

static ULONG WINAPI device_manager_processor_service_Release ( IDirectXVideoProcessorService *  iface)
static

Definition at line 387 of file main.c.

388{
390 return IDirect3DDeviceManager9_Release(&manager->IDirect3DDeviceManager9_iface);
391}

◆ device_manager_QueryInterface()

static HRESULT WINAPI device_manager_QueryInterface ( IDirect3DDeviceManager9 *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 734 of file main.c.

735{
736 TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj);
737
738 if (IsEqualIID(&IID_IDirect3DDeviceManager9, riid) ||
740 {
741 *obj = iface;
742 IDirect3DDeviceManager9_AddRef(iface);
743 return S_OK;
744 }
745
746 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
747 *obj = NULL;
748 return E_NOINTERFACE;
749}

◆ device_manager_Release()

static ULONG WINAPI device_manager_Release ( IDirect3DDeviceManager9 *  iface)
static

Definition at line 761 of file main.c.

762{
763 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
765 size_t i;
766
767 TRACE("%p, refcount %lu.\n", iface, refcount);
768
769 if (!refcount)
770 {
771 if (manager->device)
773 DeleteCriticalSection(&manager->cs);
774 for (i = 0; i < manager->count; ++i)
775 {
776 if (manager->handles[i].state_block)
777 IDirect3DStateBlock9_Release(manager->handles[i].state_block);
778 }
779 free(manager->handles);
780 free(manager);
781 }
782
783 return refcount;
784}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1336
#define free
Definition: debug_ros.c:5
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ device_manager_ResetDevice()

static HRESULT WINAPI device_manager_ResetDevice ( IDirect3DDeviceManager9 *  iface,
IDirect3DDevice9 *  device,
UINT  token 
)
static

Definition at line 786 of file main.c.

788{
789 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
790 size_t i;
791
792 TRACE("%p, %p, %#x.\n", iface, device, token);
793
794 if (token != manager->token)
795 return E_INVALIDARG;
796
797 EnterCriticalSection(&manager->cs);
798 if (manager->device)
799 {
800 for (i = 0; i < manager->count; ++i)
801 {
802 if (manager->handles[i].state_block)
803 IDirect3DStateBlock9_Release(manager->handles[i].state_block);
804 manager->handles[i].state_block = NULL;
805 manager->handles[i].flags |= HANDLE_FLAG_INVALID;
806 }
807 manager->locking_handle = NULL;
809 }
810 manager->device = device;
812 LeaveCriticalSection(&manager->cs);
813
815
816 return S_OK;
817}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
UINT token
Definition: main.c:59

◆ device_manager_TestDevice()

static HRESULT WINAPI device_manager_TestDevice ( IDirect3DDeviceManager9 *  iface,
HANDLE  hdevice 
)
static

Definition at line 900 of file main.c.

901{
902 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
903 HRESULT hr;
904 size_t idx;
905
906 TRACE("%p, %p.\n", iface, hdevice);
907
908 EnterCriticalSection(&manager->cs);
909 if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
910 {
911 unsigned int flags = manager->handles[idx].flags;
912
914 hr = DXVA2_E_NEW_VIDEO_DEVICE;
915 else if (!(flags & HANDLE_FLAG_OPEN))
916 hr = E_HANDLE;
917 }
918 LeaveCriticalSection(&manager->cs);
919
920 return hr;
921}

◆ device_manager_UnlockDevice()

static HRESULT WINAPI device_manager_UnlockDevice ( IDirect3DDeviceManager9 *  iface,
HANDLE  hdevice,
BOOL  savestate 
)
static

Definition at line 971 of file main.c.

972{
973 struct device_manager *manager = impl_from_IDirect3DDeviceManager9(iface);
974 HRESULT hr;
975 size_t idx;
976
977 TRACE("%p, %p, %d.\n", iface, hdevice, savestate);
978
979 EnterCriticalSection(&manager->cs);
980
981 if (hdevice != manager->locking_handle)
983 else if (SUCCEEDED(hr = device_manager_get_handle_index(manager, hdevice, &idx)))
984 {
985 manager->locking_handle = NULL;
986 if (savestate)
987 IDirect3DDevice9_CreateStateBlock(manager->device, D3DSBT_ALL, &manager->handles[idx].state_block);
988 }
989
990 LeaveCriticalSection(&manager->cs);
991
993
994 return hr;
995}
@ D3DSBT_ALL
Definition: d3d8types.h:830
#define IDirect3DDevice9_CreateStateBlock(p, a, b)
Definition: d3d9.h:1394

◆ DXVA2CreateDirect3DDeviceManager9()

HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9 ( UINT *  token,
IDirect3DDeviceManager9 **  manager 
)

Definition at line 1046 of file main.c.

1047{
1048 struct device_manager *object;
1049
1050 TRACE("%p, %p.\n", token, manager);
1051
1052 *manager = NULL;
1053
1054 if (!(object = calloc(1, sizeof(*object))))
1055 return E_OUTOFMEMORY;
1056
1057 object->IDirect3DDeviceManager9_iface.lpVtbl = &device_manager_vtbl;
1058 object->IDirectXVideoProcessorService_iface.lpVtbl = &device_manager_processor_service_vtbl;
1059 object->IDirectXVideoDecoderService_iface.lpVtbl = &device_manager_decoder_service_vtbl;
1060 object->refcount = 1;
1061 object->token = GetTickCount();
1064
1065 *token = object->token;
1066 *manager = &object->IDirect3DDeviceManager9_iface;
1067
1068 return S_OK;
1069}
static const IDirect3DDeviceManager9Vtbl device_manager_vtbl
Definition: main.c:1024
static const IDirectXVideoProcessorServiceVtbl device_manager_processor_service_vtbl
Definition: main.c:633
static const IDirectXVideoDecoderServiceVtbl device_manager_decoder_service_vtbl
Definition: main.c:722
VOID WINAPI InitializeConditionVariable(PCONDITION_VARIABLE ConditionVariable)
Definition: sync.c:22
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687

Referenced by DXVA2CreateVideoService().

◆ DXVA2CreateVideoService()

HRESULT WINAPI DXVA2CreateVideoService ( IDirect3DDevice9 *  device,
REFIID  riid,
void **  obj 
)

Definition at line 1071 of file main.c.

1072{
1073 IDirect3DDeviceManager9 *manager;
1074 HANDLE handle;
1075 HRESULT hr;
1076 UINT token;
1077
1078 TRACE("%p, %s, %p.\n", device, debugstr_guid(riid), obj);
1079
1081 return hr;
1082
1083 if (FAILED(hr = IDirect3DDeviceManager9_ResetDevice(manager, device, token)))
1084 goto done;
1085
1086 if (FAILED(hr = IDirect3DDeviceManager9_OpenDeviceHandle(manager, &handle)))
1087 goto done;
1088
1089 hr = IDirect3DDeviceManager9_GetVideoService(manager, handle, riid, obj);
1090 IDirect3DDeviceManager9_CloseDeviceHandle(manager, handle);
1091
1092done:
1093 IDirect3DDeviceManager9_Release(manager);
1094
1095 return hr;
1096}
HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *token, IDirect3DDeviceManager9 **manager)
Definition: main.c:1046
unsigned int UINT
Definition: sysinfo.c:13

◆ dxva_array_reserve()

static BOOL dxva_array_reserve ( void **  elements,
size_t *  capacity,
size_t  count,
size_t  size 
)
static

Definition at line 83 of file main.c.

84{
85 size_t new_capacity, max_capacity;
86 void *new_elements;
87
88 if (count <= *capacity)
89 return TRUE;
90
91 max_capacity = ~(SIZE_T)0 / size;
92 if (count > max_capacity)
93 return FALSE;
94
95 new_capacity = max(4, *capacity);
96 while (new_capacity < count && new_capacity <= max_capacity / 2)
97 new_capacity *= 2;
98 if (new_capacity < count)
99 new_capacity = max_capacity;
100
101 if (!(new_elements = realloc(*elements, new_capacity * size)))
102 return FALSE;
103
104 *elements = new_elements;
105 *capacity = new_capacity;
106
107 return TRUE;
108}
#define realloc
Definition: debug_ros.c:6
#define TRUE
Definition: types.h:120
GLsizeiptr size
Definition: glext.h:5919
#define max(a, b)
Definition: svc.c:63
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by device_manager_OpenDeviceHandle().

◆ dxva_is_supported_stream_format()

static BOOL dxva_is_supported_stream_format ( const DXVA2_VideoDesc *  video_desc,
const D3DFORMAT *  formats 
)
static

Definition at line 461 of file main.c.

462{
463 while (*formats)
464 {
465 if (*formats == video_desc->Format) return TRUE;
466 formats++;
467 }
468
469 return FALSE;
470}

Referenced by device_manager_processor_service_GetVideoProcessorDeviceGuids(), and device_manager_processor_service_GetVideoProcessorRenderTargets().

◆ DXVAHD_CreateDevice()

HRESULT WINAPI DXVAHD_CreateDevice ( IDirect3DDevice9Ex *  d3d9_device,
const DXVAHD_CONTENT_DESC *  desc,
DXVAHD_DEVICE_USAGE  usage,
PDXVAHDSW_Plugin  plugin,
IDXVAHD_Device **  device 
)

Definition at line 1367 of file main.c.

1369{
1370 FIXME("d3d9_device %p, desc %p, usage %u, plugin %p, device %p, stub!\n", d3d9_device, desc, usage, plugin, device);
1371
1372 return E_NOTIMPL;
1373}
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683

◆ GetCapabilitiesStringLength()

BOOL WINAPI GetCapabilitiesStringLength ( HMONITOR  monitor,
LPDWORD  length 
)

Definition at line 1122 of file main.c.

1123{
1124 FIXME("(%p, %p): stub\n", monitor, length);
1125
1127 return FALSE;
1128}

◆ GetMonitorBrightness()

BOOL WINAPI GetMonitorBrightness ( HMONITOR  monitor,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1130 of file main.c.

1131{
1132 FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum);
1133
1135 return FALSE;
1136}
struct task_struct * current
Definition: linux.c:32

◆ GetMonitorCapabilities()

BOOL WINAPI GetMonitorCapabilities ( HMONITOR  monitor,
LPDWORD  capabilities,
LPDWORD  temperatures 
)

Definition at line 1138 of file main.c.

1139{
1140 FIXME("(%p, %p, %p): stub\n", monitor, capabilities, temperatures);
1141
1143 return FALSE;
1144}

◆ GetMonitorColorTemperature()

BOOL WINAPI GetMonitorColorTemperature ( HMONITOR  monitor,
LPMC_COLOR_TEMPERATURE  temperature 
)

Definition at line 1147 of file main.c.

1148{
1149 FIXME("(%p, %p): stub\n", monitor, temperature);
1150
1152 return FALSE;
1153}

◆ GetMonitorContrast()

BOOL WINAPI GetMonitorContrast ( HMONITOR  monitor,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1155 of file main.c.

1156{
1157 FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum);
1158
1160 return FALSE;
1161}

◆ GetMonitorDisplayAreaPosition()

BOOL WINAPI GetMonitorDisplayAreaPosition ( HMONITOR  monitor,
MC_POSITION_TYPE  type,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1163 of file main.c.

1165{
1166 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1167
1169 return FALSE;
1170}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ GetMonitorDisplayAreaSize()

BOOL WINAPI GetMonitorDisplayAreaSize ( HMONITOR  monitor,
MC_SIZE_TYPE  type,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1172 of file main.c.

1174{
1175 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1176
1178 return FALSE;
1179}

◆ GetMonitorRedGreenOrBlueDrive()

BOOL WINAPI GetMonitorRedGreenOrBlueDrive ( HMONITOR  monitor,
MC_DRIVE_TYPE  type,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1181 of file main.c.

1183{
1184 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1185
1187 return FALSE;
1188}

◆ GetMonitorRedGreenOrBlueGain()

BOOL WINAPI GetMonitorRedGreenOrBlueGain ( HMONITOR  monitor,
MC_GAIN_TYPE  type,
LPDWORD  minimum,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1190 of file main.c.

1192{
1193 FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum);
1194
1196 return FALSE;
1197}

◆ GetMonitorTechnologyType()

BOOL WINAPI GetMonitorTechnologyType ( HMONITOR  monitor,
LPMC_DISPLAY_TECHNOLOGY_TYPE  type 
)

Definition at line 1199 of file main.c.

1200{
1201 FIXME("(%p, %p): stub\n", monitor, type);
1202
1204 return FALSE;
1205}

◆ GetNumberOfPhysicalMonitorsFromHMONITOR()

BOOL WINAPI GetNumberOfPhysicalMonitorsFromHMONITOR ( HMONITOR  monitor,
LPDWORD  number 
)

Definition at line 1207 of file main.c.

1208{
1209 FIXME("(%p, %p): stub\n", monitor, number);
1210
1212 return FALSE;
1213}
static unsigned int number
Definition: dsound.c:1479

◆ GetNumberOfPhysicalMonitorsFromIDirect3DDevice9()

HRESULT WINAPI GetNumberOfPhysicalMonitorsFromIDirect3DDevice9 ( IDirect3DDevice9 *  device,
LPDWORD  number 
)

Definition at line 1215 of file main.c.

1216{
1217 FIXME("(%p, %p): stub\n", device, number);
1218
1219 return E_NOTIMPL;
1220}

◆ GetPhysicalMonitorsFromHMONITOR()

BOOL WINAPI GetPhysicalMonitorsFromHMONITOR ( HMONITOR  monitor,
DWORD  arraySize,
LPPHYSICAL_MONITOR  array 
)

Definition at line 1222 of file main.c.

1223{
1224 FIXME("%p, %lu, %p: stub.\n", monitor, arraySize, array);
1225
1227 return FALSE;
1228}

◆ GetPhysicalMonitorsFromIDirect3DDevice9()

HRESULT WINAPI GetPhysicalMonitorsFromIDirect3DDevice9 ( IDirect3DDevice9 *  device,
DWORD  arraySize,
LPPHYSICAL_MONITOR  array 
)

Definition at line 1230 of file main.c.

1231{
1232 FIXME("%p, %lu, %p: stub.\n", device, arraySize, array);
1233
1234 return E_NOTIMPL;
1235}

◆ GetTimingReport()

BOOL WINAPI GetTimingReport ( HMONITOR  monitor,
LPMC_TIMING_REPORT  timingReport 
)

Definition at line 1237 of file main.c.

1238{
1239 FIXME("(%p, %p): stub\n", monitor, timingReport);
1240
1242 return FALSE;
1243}

◆ GetVCPFeatureAndVCPFeatureReply()

BOOL WINAPI GetVCPFeatureAndVCPFeatureReply ( HMONITOR  monitor,
BYTE  vcpCode,
LPMC_VCP_CODE_TYPE  pvct,
LPDWORD  current,
LPDWORD  maximum 
)

Definition at line 1245 of file main.c.

1247{
1248 FIXME("(%p, 0x%02x, %p, %p, %p): stub\n", monitor, vcpCode, pvct, current, maximum);
1249
1251 return FALSE;
1252}

◆ impl_from_IDirect3DDeviceManager9()

static struct device_manager * impl_from_IDirect3DDeviceManager9 ( IDirect3DDeviceManager9 *  iface)
static

◆ impl_from_IDirectXVideoDecoderService()

static struct device_manager * impl_from_IDirectXVideoDecoderService ( IDirectXVideoDecoderService *  iface)
static

Definition at line 120 of file main.c.

121{
122 return CONTAINING_RECORD(iface, struct device_manager, IDirectXVideoDecoderService_iface);
123}

Referenced by device_manager_decoder_service_AddRef(), and device_manager_decoder_service_Release().

◆ impl_from_IDirectXVideoProcessor()

static struct video_processor * impl_from_IDirectXVideoProcessor ( IDirectXVideoProcessor *  iface)
static

◆ impl_from_IDirectXVideoProcessorService()

static struct device_manager * impl_from_IDirectXVideoProcessorService ( IDirectXVideoProcessorService *  iface)
static

◆ intersect_rect()

static BOOL intersect_rect ( RECT *  dest,
const RECT *  src1,
const RECT *  src2 
)
static

Definition at line 261 of file main.c.

262{
263 if (IsRectEmpty(src1) || IsRectEmpty(src2) ||
264 (src1->left >= src2->right) || (src2->left >= src1->right) ||
265 (src1->top >= src2->bottom) || (src2->top >= src1->bottom))
266 {
268 return FALSE;
269 }
270 dest->left = max(src1->left, src2->left);
271 dest->right = min(src1->right, src2->right);
272 dest->top = max(src1->top, src2->top);
273 dest->bottom = min(src1->bottom, src2->bottom);
274
275 return TRUE;
276}
static char * dest
Definition: rtl.c:149
#define min(a, b)
Definition: monoChain.cc:55
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29

Referenced by msaa_provider_GetPropertyValue(), and video_processor_VideoProcessBlt().

◆ OPMGetVideoOutputsFromHMONITOR()

HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR ( HMONITOR  monitor,
int  vos,
ULONG *  numVideoOutputs,
void ***  videoOutputs 
)

Definition at line 1254 of file main.c.

1256{
1257 FIXME("(%p, 0x%x, %p, %p): stub\n", monitor, vos, numVideoOutputs, videoOutputs);
1258
1259 return E_NOTIMPL;
1260}

◆ OPMGetVideoOutputsFromIDirect3DDevice9Object()

HRESULT WINAPI OPMGetVideoOutputsFromIDirect3DDevice9Object ( IDirect3DDevice9 *  device,
int  vos,
ULONG *  numVideoOutputs,
void ***  videoOutputs 
)

Definition at line 1262 of file main.c.

1264{
1265 FIXME("(%p, 0x%x, %p, %p): stub\n", device, vos, numVideoOutputs, videoOutputs);
1266
1267 return E_NOTIMPL;
1268}

◆ RestoreMonitorFactoryColorDefaults()

BOOL WINAPI RestoreMonitorFactoryColorDefaults ( HMONITOR  monitor)

Definition at line 1270 of file main.c.

1271{
1272 FIXME("(%p): stub\n", monitor);
1273
1275 return FALSE;
1276}

◆ RestoreMonitorFactoryDefaults()

BOOL WINAPI RestoreMonitorFactoryDefaults ( HMONITOR  monitor)

Definition at line 1278 of file main.c.

1279{
1280 FIXME("(%p): stub\n", monitor);
1281
1283 return FALSE;
1284}

◆ SaveCurrentMonitorSettings()

BOOL WINAPI SaveCurrentMonitorSettings ( HMONITOR  monitor)

Definition at line 1286 of file main.c.

1287{
1288 FIXME("(%p): stub\n", monitor);
1289
1291 return FALSE;
1292}

◆ SaveCurrentSettings()

BOOL WINAPI SaveCurrentSettings ( HMONITOR  monitor)

Definition at line 1294 of file main.c.

1295{
1296 FIXME("(%p): stub\n", monitor);
1297
1299 return FALSE;
1300}

◆ SetMonitorBrightness()

BOOL WINAPI SetMonitorBrightness ( HMONITOR  monitor,
DWORD  brightness 
)

Definition at line 1302 of file main.c.

1303{
1304 FIXME("%p, %#lx: stub.\n", monitor, brightness);
1305
1307 return FALSE;
1308}

◆ SetMonitorColorTemperature()

BOOL WINAPI SetMonitorColorTemperature ( HMONITOR  monitor,
MC_COLOR_TEMPERATURE  temperature 
)

Definition at line 1310 of file main.c.

1311{
1312 FIXME("(%p, 0x%x): stub\n", monitor, temperature);
1313
1315 return FALSE;
1316}

◆ SetMonitorContrast()

BOOL WINAPI SetMonitorContrast ( HMONITOR  monitor,
DWORD  contrast 
)

Definition at line 1318 of file main.c.

1319{
1320 FIXME("%p, %#lx: stub.\n", monitor, contrast);
1321
1323 return FALSE;
1324}

◆ SetMonitorDisplayAreaPosition()

BOOL WINAPI SetMonitorDisplayAreaPosition ( HMONITOR  monitor,
MC_POSITION_TYPE  type,
DWORD  position 
)

Definition at line 1326 of file main.c.

1327{
1328 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, position);
1329
1331 return FALSE;
1332}

◆ SetMonitorDisplayAreaSize()

BOOL WINAPI SetMonitorDisplayAreaSize ( HMONITOR  monitor,
MC_SIZE_TYPE  type,
DWORD  size 
)

Definition at line 1334 of file main.c.

1335{
1336 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, size);
1337
1339 return FALSE;
1340}

◆ SetMonitorRedGreenOrBlueDrive()

BOOL WINAPI SetMonitorRedGreenOrBlueDrive ( HMONITOR  monitor,
MC_DRIVE_TYPE  type,
DWORD  drive 
)

Definition at line 1342 of file main.c.

1343{
1344 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, drive);
1345
1347 return FALSE;
1348}

◆ SetMonitorRedGreenOrBlueGain()

BOOL WINAPI SetMonitorRedGreenOrBlueGain ( HMONITOR  monitor,
MC_GAIN_TYPE  type,
DWORD  gain 
)

Definition at line 1350 of file main.c.

1351{
1352 FIXME("%p, 0x%x, %#lx: stub.\n", monitor, type, gain);
1353
1355 return FALSE;
1356}

◆ SetVCPFeature()

BOOL WINAPI SetVCPFeature ( HMONITOR  monitor,
BYTE  vcpCode,
DWORD  value 
)

Definition at line 1358 of file main.c.

1359{
1360 FIXME("%p, 0x%02x, %#lx: stub.\n", monitor, vcpCode, value);
1361
1363 return FALSE;
1364}
Definition: pdh_main.c:64

◆ video_processor_AddRef()

static ULONG WINAPI video_processor_AddRef ( IDirectXVideoProcessor *  iface)
static

Definition at line 161 of file main.c.

162{
163 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
165
166 TRACE("%p, refcount %lu.\n", iface, refcount);
167
168 return refcount;
169}
static struct video_processor * impl_from_IDirectXVideoProcessor(IDirectXVideoProcessor *iface)
Definition: main.c:125
LONG refcount
Definition: main.c:74

◆ video_processor_get_background_color()

static D3DCOLOR video_processor_get_background_color ( const DXVA2_AYUVSample16 *  ayuv)
static

Definition at line 278 of file main.c.

279{
280 float y, cb, cr;
281 BYTE r, g, b;
282
283 y = (ayuv->Y >> 8) - 16;
284 cb = (ayuv->Cb >> 8) - 128;
285 cr = (ayuv->Cr >> 8) - 128;
286
287 y = 255.0f * y / 219.0f;
288 cb = 255.0f * cb / 224.0f;
289 cr = 255.0f * cr / 224.0f;
290
291 r = y + 1.402 * cr;
292 g = y - 0.344 * cb - 0.714 * cr;
293 b = y + 1.772 * cb;
294
295 return D3DCOLOR_XRGB(r, g, b);
296}
#define D3DCOLOR_XRGB(r, g, b)
Definition: d3d8types.h:44
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
unsigned char BYTE
Definition: xxhash.c:193

Referenced by video_processor_VideoProcessBlt().

◆ video_processor_GetCreationParameters()

static HRESULT WINAPI video_processor_GetCreationParameters ( IDirectXVideoProcessor *  iface,
GUID *  device,
DXVA2_VideoDesc *  video_desc,
D3DFORMAT *  rt_format,
UINT *  max_substreams 
)
static

Definition at line 200 of file main.c.

202{
203 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
204
205 TRACE("%p, %p, %p, %p, %p.\n", iface, device, video_desc, rt_format, max_substreams);
206
207 if (!device && !video_desc && !rt_format && !max_substreams)
208 return E_INVALIDARG;
209
210 if (device)
211 *device = processor->device;
212 if (video_desc)
213 *video_desc = processor->video_desc;
214 if (rt_format)
215 *rt_format = processor->rt_format;
216 if (max_substreams)
217 *max_substreams = processor->max_substreams;
218
219 return S_OK;
220}

◆ video_processor_GetFilterPropertyRange()

static HRESULT WINAPI video_processor_GetFilterPropertyRange ( IDirectXVideoProcessor *  iface,
UINT  setting,
DXVA2_ValueRange *  range 
)
static

Definition at line 253 of file main.c.

255{
256 FIXME("%p, %u, %p.\n", iface, setting, range);
257
258 return E_NOTIMPL;
259}

◆ video_processor_GetProcAmpRange()

static HRESULT WINAPI video_processor_GetProcAmpRange ( IDirectXVideoProcessor *  iface,
UINT  cap,
DXVA2_ValueRange *  range 
)
static

Definition at line 246 of file main.c.

247{
248 FIXME("%p, %u, %p.\n", iface, cap, range);
249
250 return E_NOTIMPL;
251}
GLenum cap
Definition: glext.h:9639

◆ video_processor_GetVideoProcessorCaps()

static HRESULT WINAPI video_processor_GetVideoProcessorCaps ( IDirectXVideoProcessor *  iface,
DXVA2_VideoProcessorCaps *  caps 
)
static

Definition at line 222 of file main.c.

224{
225 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
226
227 TRACE("%p, %p.\n", iface, caps);
228
229 if (IsEqualGUID(&processor->device, &DXVA2_VideoProcSoftwareDevice))
230 {
232 }
233 else if (IsEqualGUID(&processor->device, &DXVA2_VideoProcProgressiveDevice))
234 {
236 }
237 else
238 {
239 FIXME("Unsupported device %s.\n", debugstr_guid(&processor->device));
240 return E_FAIL;
241 }
242
243 return S_OK;
244}

◆ video_processor_GetVideoProcessorService()

static HRESULT WINAPI video_processor_GetVideoProcessorService ( IDirectXVideoProcessor *  iface,
IDirectXVideoProcessorService **  service 
)
static

Definition at line 187 of file main.c.

189{
190 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
191
192 TRACE("%p, %p.\n", iface, service);
193
194 *service = processor->service;
195 IDirectXVideoProcessorService_AddRef(*service);
196
197 return S_OK;
198}
IDirectXVideoProcessorService * service
Definition: main.c:76

◆ video_processor_QueryInterface()

static HRESULT WINAPI video_processor_QueryInterface ( IDirectXVideoProcessor *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 146 of file main.c.

147{
148 if (IsEqualIID(riid, &IID_IDirectXVideoProcessor) ||
150 {
151 *obj = iface;
152 IDirectXVideoProcessor_AddRef(iface);
153 return S_OK;
154 }
155
156 WARN("Unsupported interface %s.\n", debugstr_guid(riid));
157 *obj = NULL;
158 return E_NOINTERFACE;
159}

◆ video_processor_Release()

static ULONG WINAPI video_processor_Release ( IDirectXVideoProcessor *  iface)
static

Definition at line 171 of file main.c.

172{
173 struct video_processor *processor = impl_from_IDirectXVideoProcessor(iface);
175
176 TRACE("%p, refcount %lu.\n", iface, refcount);
177
178 if (!refcount)
179 {
180 IDirectXVideoProcessorService_Release(processor->service);
181 free(processor);
182 }
183
184 return refcount;
185}

◆ video_processor_VideoProcessBlt()

static HRESULT WINAPI video_processor_VideoProcessBlt ( IDirectXVideoProcessor *  iface,
IDirect3DSurface9 *  rt,
const DXVA2_VideoProcessBltParams *  params,
const DXVA2_VideoSample *  samples,
UINT  sample_count,
HANDLE *  complete_handle 
)
static

Definition at line 298 of file main.c.

301{
303 unsigned int i;
304 RECT dst_rect;
305 HRESULT hr;
306
307 TRACE("%p, %p, %p, %p, %u, %p.\n", iface, rt, params, samples, sample_count, complete_handle);
308
309 if (params->BackgroundColor.Alpha != 0xffff)
310 {
311 WARN("Unexpected background alpha %#x.\n", params->BackgroundColor.Alpha);
312 return E_INVALIDARG;
313 }
314
316 {
317 WARN("Failed to get surface device, hr %#lx.\n", hr);
318 return hr;
319 }
320
322
323 for (i = 0; i < sample_count; ++i)
324 {
325 dst_rect = params->TargetRect;
326
327 if (!intersect_rect(&dst_rect, &dst_rect, &samples[i].DstRect))
328 continue;
329
330 if (FAILED(hr = IDirect3DDevice9_StretchRect(device, samples[i].SrcSurface, &samples[i].SrcRect,
331 rt, &dst_rect, D3DTEXF_POINT)))
332 {
333 WARN("Failed to copy sample %u, hr %#lx.\n", i, hr);
334 }
335 }
336
338
339 return S_OK;
340}
@ D3DTEXF_POINT
Definition: d3d8types.h:871
#define IDirect3DSurface9_GetDevice(p, a)
Definition: d3d9.h:452
#define IDirect3DDevice9_ColorFill(p, a, b, c)
Definition: d3d9.h:1370
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
Definition: d3d9.h:1369
static BOOL intersect_rect(RECT *dest, const RECT *src1, const RECT *src2)
Definition: main.c:261
static D3DCOLOR video_processor_get_background_color(const DXVA2_AYUVSample16 *ayuv)
Definition: main.c:278
DWORD IDirect3DDevice9
Definition: dxva2api.idl:22
GLsizei samples
Definition: glext.h:7006
GLenum const GLfloat * params
Definition: glext.h:5645
Definition: dcommon.idl:28

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dxva2  )

Variable Documentation

◆ device_manager_decoder_service_vtbl

const IDirectXVideoDecoderServiceVtbl device_manager_decoder_service_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI device_manager_decoder_service_QueryInterface(IDirectXVideoDecoderService *iface, REFIID riid, void **obj)
Definition: main.c:649
static HRESULT WINAPI device_manager_decoder_service_GetDecoderDeviceGuids(IDirectXVideoDecoderService *iface, UINT *count, GUID **guids)
Definition: main.c:688
static HRESULT WINAPI device_manager_decoder_service_CreateSurface(IDirectXVideoDecoderService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
Definition: main.c:678
static HRESULT WINAPI device_manager_decoder_service_GetDecoderRenderTargets(IDirectXVideoDecoderService *iface, REFGUID guid, UINT *count, D3DFORMAT **formats)
Definition: main.c:696
static HRESULT WINAPI device_manager_decoder_service_GetDecoderConfigurations(IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, void *reserved, UINT *count, DXVA2_ConfigPictureDecode **configs)
Definition: main.c:704
static ULONG WINAPI device_manager_decoder_service_AddRef(IDirectXVideoDecoderService *iface)
Definition: main.c:666
static ULONG WINAPI device_manager_decoder_service_Release(IDirectXVideoDecoderService *iface)
Definition: main.c:672
static HRESULT WINAPI device_manager_decoder_service_CreateVideoDecoder(IDirectXVideoDecoderService *iface, REFGUID guid, const DXVA2_VideoDesc *video_desc, const DXVA2_ConfigPictureDecode *config, IDirect3DSurface9 **rts, UINT num_surfaces, IDirectXVideoDecoder **decoder)
Definition: main.c:712

Definition at line 722 of file main.c.

Referenced by DXVA2CreateDirect3DDeviceManager9().

◆ device_manager_processor_service_vtbl

const IDirectXVideoProcessorServiceVtbl device_manager_processor_service_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI device_manager_processor_service_QueryInterface(IDirectXVideoProcessorService *iface, REFIID riid, void **obj)
Definition: main.c:355
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorSubStreamFormats(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT *count, D3DFORMAT **formats)
Definition: main.c:549
static ULONG WINAPI device_manager_processor_service_AddRef(IDirectXVideoProcessorService *iface)
Definition: main.c:381
static HRESULT WINAPI device_manager_processor_service_GetProcAmpRange(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT ProcAmpCap, DXVA2_ValueRange *range)
Definition: main.c:581
static HRESULT WINAPI device_manager_processor_service_RegisterVideoProcessorSoftwareDevice(IDirectXVideoProcessorService *iface, void *callbacks)
Definition: main.c:431
static ULONG WINAPI device_manager_processor_service_Release(IDirectXVideoProcessorService *iface)
Definition: main.c:387
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorDeviceGuids(IDirectXVideoProcessorService *iface, const DXVA2_VideoDesc *video_desc, UINT *count, GUID **guids)
Definition: main.c:472
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorRenderTargets(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, UINT *count, D3DFORMAT **formats)
Definition: main.c:503
static HRESULT WINAPI device_manager_processor_service_CreateSurface(IDirectXVideoProcessorService *iface, UINT width, UINT height, UINT backbuffers, D3DFORMAT format, D3DPOOL pool, DWORD usage, DWORD dxvaType, IDirect3DSurface9 **surfaces, HANDLE *shared_handle)
Definition: main.c:393
static HRESULT WINAPI device_manager_processor_service_GetFilterPropertyRange(IDirectXVideoProcessorService *iface, REFGUID deviceguid, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT filter_setting, DXVA2_ValueRange *range)
Definition: main.c:590
static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor(IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, UINT max_substreams, IDirectXVideoProcessor **processor)
Definition: main.c:599
static HRESULT WINAPI device_manager_processor_service_GetVideoProcessorCaps(IDirectXVideoProcessorService *iface, REFGUID device, const DXVA2_VideoDesc *video_desc, D3DFORMAT rt_format, DXVA2_VideoProcessorCaps *caps)
Definition: main.c:558

Definition at line 633 of file main.c.

Referenced by DXVA2CreateDirect3DDeviceManager9().

◆ device_manager_vtbl

const IDirect3DDeviceManager9Vtbl device_manager_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI device_manager_QueryInterface(IDirect3DDeviceManager9 *iface, REFIID riid, void **obj)
Definition: main.c:734
static HRESULT WINAPI device_manager_OpenDeviceHandle(IDirect3DDeviceManager9 *iface, HANDLE *hdevice)
Definition: main.c:819
static HRESULT WINAPI device_manager_GetVideoService(IDirect3DDeviceManager9 *iface, HANDLE hdevice, REFIID riid, void **obj)
Definition: main.c:997
static HRESULT WINAPI device_manager_LockDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice, IDirect3DDevice9 **device, BOOL block)
Definition: main.c:923
static HRESULT WINAPI device_manager_ResetDevice(IDirect3DDeviceManager9 *iface, IDirect3DDevice9 *device, UINT token)
Definition: main.c:786
static ULONG WINAPI device_manager_AddRef(IDirect3DDeviceManager9 *iface)
Definition: main.c:751
static HRESULT WINAPI device_manager_TestDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice)
Definition: main.c:900
static HRESULT WINAPI device_manager_UnlockDevice(IDirect3DDeviceManager9 *iface, HANDLE hdevice, BOOL savestate)
Definition: main.c:971
static HRESULT WINAPI device_manager_CloseDeviceHandle(IDirect3DDeviceManager9 *iface, HANDLE hdevice)
Definition: main.c:868
static ULONG WINAPI device_manager_Release(IDirect3DDeviceManager9 *iface)
Definition: main.c:761

Definition at line 1024 of file main.c.

Referenced by DXVA2CreateDirect3DDeviceManager9().

◆ processor_devices

const struct dxva_processor_device_desc processor_devices[]
static
Initial value:
=
{
{ &DXVA2_VideoProcProgressiveDevice, progressive_processor_input_formats },
{ &DXVA2_VideoProcSoftwareDevice, software_processor_input_formats },
}

Definition at line 455 of file main.c.

Referenced by device_manager_processor_service_GetVideoProcessorDeviceGuids().

◆ progressive_processor_caps

const DXVA2_VideoProcessorCaps progressive_processor_caps
static
Initial value:
=
{
.InputPool = D3DPOOL_DEFAULT,
}
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
@ DXVA2_VPDev_HardwareDevice
Definition: dxva2api.idl:381
@ DXVA2_VideoProcess_StretchX
Definition: dxva2api.idl:361
@ DXVA2_VideoProcess_StretchY
Definition: dxva2api.idl:362
@ DXVA2_VideoProcess_YUV2RGB
Definition: dxva2api.idl:360

Definition at line 139 of file main.c.

Referenced by device_manager_processor_service_GetVideoProcessorCaps(), and video_processor_GetVideoProcessorCaps().

◆ progressive_processor_input_formats

const D3DFORMAT progressive_processor_input_formats[]
static
Initial value:

Definition at line 450 of file main.c.

Referenced by device_manager_processor_service_GetVideoProcessorRenderTargets().

◆ software_processor_caps

const DXVA2_VideoProcessorCaps software_processor_caps
static

◆ software_processor_input_formats

const D3DFORMAT software_processor_input_formats[]
static

◆ video_processor_vtbl

const IDirectXVideoProcessorVtbl video_processor_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI video_processor_GetProcAmpRange(IDirectXVideoProcessor *iface, UINT cap, DXVA2_ValueRange *range)
Definition: main.c:246
static ULONG WINAPI video_processor_AddRef(IDirectXVideoProcessor *iface)
Definition: main.c:161
static ULONG WINAPI video_processor_Release(IDirectXVideoProcessor *iface)
Definition: main.c:171
static HRESULT WINAPI video_processor_GetVideoProcessorCaps(IDirectXVideoProcessor *iface, DXVA2_VideoProcessorCaps *caps)
Definition: main.c:222
static HRESULT WINAPI video_processor_GetVideoProcessorService(IDirectXVideoProcessor *iface, IDirectXVideoProcessorService **service)
Definition: main.c:187
static HRESULT WINAPI video_processor_GetFilterPropertyRange(IDirectXVideoProcessor *iface, UINT setting, DXVA2_ValueRange *range)
Definition: main.c:253
static HRESULT WINAPI video_processor_VideoProcessBlt(IDirectXVideoProcessor *iface, IDirect3DSurface9 *rt, const DXVA2_VideoProcessBltParams *params, const DXVA2_VideoSample *samples, UINT sample_count, HANDLE *complete_handle)
Definition: main.c:298
static HRESULT WINAPI video_processor_GetCreationParameters(IDirectXVideoProcessor *iface, GUID *device, DXVA2_VideoDesc *video_desc, D3DFORMAT *rt_format, UINT *max_substreams)
Definition: main.c:200
static HRESULT WINAPI video_processor_QueryInterface(IDirectXVideoProcessor *iface, REFIID riid, void **obj)
Definition: main.c:146

Definition at line 342 of file main.c.

Referenced by device_manager_processor_service_CreateVideoProcessor().