Commit c38cae66 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

d3d9: include dxgi_fmt.h

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9aadaa05
......@@ -421,7 +421,8 @@ endif
codec_LTLIBRARIES += libvaapi_plugin.la
endif
libd3d9_common_la_SOURCES = video_chroma/d3d9_fmt.c video_chroma/d3d9_fmt.h
libd3d9_common_la_SOURCES = video_chroma/d3d9_fmt.c video_chroma/d3d9_fmt.h \
video_chroma/dxgi_fmt.h
libd3d9_common_la_LDFLAGS = -static
if HAVE_WIN32_DESKTOP
noinst_LTLIBRARIES += libd3d9_common.la
......
......@@ -87,9 +87,9 @@ typedef struct {
const char *name;
D3DFORMAT format;
vlc_fourcc_t codec;
} d3d_format_t;
} d3d9_format_t;
/* XXX Prefered format must come first */
static const d3d_format_t d3d_formats[] = {
static const d3d9_format_t d3d_formats[] = {
{ "YV12", MAKEFOURCC('Y','V','1','2'), VLC_CODEC_YV12 },
{ "NV12", MAKEFOURCC('N','V','1','2'), VLC_CODEC_NV12 },
{ "IMC3", MAKEFOURCC('I','M','C','3'), VLC_CODEC_YV12 },
......@@ -98,7 +98,7 @@ static const d3d_format_t d3d_formats[] = {
{ NULL, 0, 0 }
};
static const d3d_format_t *D3dFindFormat(D3DFORMAT format)
static const d3d9_format_t *D3dFindFormat(D3DFORMAT format)
{
for (unsigned i = 0; d3d_formats[i].name; i++) {
if (d3d_formats[i].format == format)
......@@ -530,7 +530,7 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
for (unsigned j = 0; j < output_count; j++) {
const D3DFORMAT f = output_list[j];
const d3d_format_t *format = D3dFindFormat(f);
const d3d9_format_t *format = D3dFindFormat(f);
if (format) {
msg_Dbg(va, "%s is supported for output", format->name);
} else {
......@@ -542,7 +542,7 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
for (unsigned pass = 0; pass < 2 && err != VLC_SUCCESS; ++pass)
{
for (unsigned j = 0; d3d_formats[j].name; j++) {
const d3d_format_t *format = &d3d_formats[j];
const d3d9_format_t *format = &d3d_formats[j];
/* */
bool is_supported = false;
......
......@@ -27,6 +27,8 @@
#include <d3d9.h>
#include "dxgi_fmt.h"
/* owned by the vout for VLC_CODEC_D3D9_OPAQUE */
struct picture_sys_t
{
......
......@@ -125,7 +125,7 @@ typedef struct
uint32_t rmask;
uint32_t gmask;
uint32_t bmask;
} d3d_format_t;
} d3d9_format_t;
struct vout_display_sys_t
{
......@@ -151,7 +151,7 @@ struct vout_display_sys_t
D3DFORMAT d3dregion_format; /* Backbuffer output format */
int d3dregion_count;
struct d3d_region_t *d3dregion;
const d3d_format_t *d3dtexture_format; /* Rendering texture(s) format */
const d3d9_format_t *d3dtexture_format; /* Rendering texture(s) format */
/* */
bool reset_device;
......@@ -165,12 +165,12 @@ struct vout_display_sys_t
bool desktop_requested;
};
static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target);
static const d3d9_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target);
static int Open(vlc_object_t *);
static picture_pool_t *Direct3D9CreatePicturePool (vlc_object_t *, d3d9_device_t *,
const d3d_format_t *, const video_format_t *, unsigned);
const d3d9_format_t *, const video_format_t *, unsigned);
static void Prepare(vout_display_t *, picture_t *, subpicture_t *subpicture);
static void Display(vout_display_t *, picture_t *, subpicture_t *subpicture);
......@@ -398,7 +398,7 @@ static void Direct3D9UnlockSurface(picture_t *picture)
/* */
static picture_pool_t *Direct3D9CreatePicturePool(vlc_object_t *o,
d3d9_device_t *p_d3d9_dev, const d3d_format_t *default_d3dfmt, const video_format_t *fmt, unsigned count)
d3d9_device_t *p_d3d9_dev, const d3d9_format_t *default_d3dfmt, const video_format_t *fmt, unsigned count)
{
picture_pool_t* pool = NULL;
picture_t** pictures = NULL;
......@@ -769,7 +769,7 @@ static int Direct3D9Open(vout_display_t *vd, video_format_t *fmt)
/* Find the appropriate D3DFORMAT for the render chroma, the format will be the closest to
* the requested chroma which is usable by the hardware in an offscreen surface, as they
* typically support more formats than textures */
const d3d_format_t *d3dfmt = Direct3DFindFormat(vd, fmt->i_chroma, p_d3d9_dev->pp.BackBufferFormat);
const d3d9_format_t *d3dfmt = Direct3DFindFormat(vd, fmt->i_chroma, p_d3d9_dev->pp.BackBufferFormat);
if (!d3dfmt) {
msg_Err(vd, "surface pixel format is not supported.");
goto error;
......@@ -932,7 +932,7 @@ static int Direct3D9CheckConversion(vout_display_t *vd,
return VLC_SUCCESS;
}
static const d3d_format_t d3d_formats[] = {
static const d3d9_format_t d3d_formats[] = {
/* YV12 is always used for planar 420, the planes are then swapped in Lock() */
{ "YV12", MAKEFOURCC('Y','V','1','2'), VLC_CODEC_YV12, 0,0,0 },
{ "YV12", MAKEFOURCC('Y','V','1','2'), VLC_CODEC_I420, 0,0,0 },
......@@ -953,7 +953,7 @@ static const d3d_format_t d3d_formats[] = {
/**
* It returns the format (closest to chroma) that can be converted to target */
static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target)
static const d3d9_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target)
{
vout_display_sys_t *sys = vd->sys;
bool hardware_scale_ok = !(vd->fmt.i_visible_width & 1) && !(vd->fmt.i_visible_height & 1);
......@@ -975,7 +975,7 @@ static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t c
for (unsigned i = 0; list[i] != 0; i++) {
for (unsigned j = 0; d3d_formats[j].name; j++) {
const d3d_format_t *format = &d3d_formats[j];
const d3d9_format_t *format = &d3d_formats[j];
if (format->fourcc != list[i])
continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment