Browse Source

libvlc: use a different name for each variant of the host surface format

Now that we use a union we can differentiate each properly.

In particular the D3D9 is an unsigned FourCC.

It's still not as strongly typed as it could be (no DXGI_FORMAT for example).
pull/102/head
Steve Lhomme 7 years ago
parent
commit
c819fb26f8
  1. 2
      doc/libvlc/QtGL/qtvlcwidget.cpp
  2. 2
      doc/libvlc/d3d11_player.cpp
  3. 2
      doc/libvlc/d3d9_player.c
  4. 2
      doc/libvlc/sdl_opengl_player.cpp
  5. 6
      include/vlc/libvlc_media_player.h
  6. 2
      modules/video_output/vgl.c
  7. 2
      modules/video_output/win32/d3d11_swapchain.c
  8. 2
      modules/video_output/win32/direct3d11.c
  9. 2
      modules/video_output/win32/direct3d9.c

2
doc/libvlc/QtGL/qtvlcwidget.cpp

@ -54,7 +54,7 @@ public:
that->mBuffers[that->m_idx_render]->bind();
render_cfg->surface_format = GL_RGBA;
render_cfg->opengl_format = GL_RGBA;
render_cfg->full_range = true;
render_cfg->colorspace = libvlc_video_colorspace_BT709;
render_cfg->primaries = libvlc_video_primaries_BT709;

2
doc/libvlc/d3d11_player.cpp

@ -402,7 +402,7 @@ static bool UpdateOutput_cb( void *opaque, const libvlc_video_render_cfg_t *cfg,
ctx->d3dctxVLC->OMSetRenderTargets( 1, &ctx->resized.textureRenderTarget, NULL );
out->surface_format = renderFormat;
out->dxgi_format = renderFormat;
out->full_range = true;
out->colorspace = libvlc_video_colorspace_BT709;
out->primaries = libvlc_video_primaries_BT709;

2
doc/libvlc/d3d9_player.c

@ -134,7 +134,7 @@ static bool Resize(struct render_context *ctx, unsigned width, unsigned height,
hr = IDirect3DDevice9_SetRenderTarget(ctx->libvlc_d3d, 0, ctx->sharedRenderSurface);
if (FAILED(hr)) return false;
out->surface_format = d3ddm.Format;
out->d3d9_format = d3ddm.Format;
out->full_range = true;
out->colorspace = libvlc_video_colorspace_BT709;
out->primaries = libvlc_video_primaries_BT709;

2
doc/libvlc/sdl_opengl_player.cpp

@ -150,7 +150,7 @@ public:
glBindFramebuffer(GL_FRAMEBUFFER, that->m_fbo[that->m_idx_render]);
render_cfg->surface_format = GL_RGBA;
render_cfg->opengl_format = GL_RGBA;
render_cfg->full_range = true;
render_cfg->colorspace = libvlc_video_colorspace_BT709;
render_cfg->primaries = libvlc_video_primaries_BT709;

6
include/vlc/libvlc_media_player.h

@ -565,9 +565,9 @@ typedef struct
typedef struct
{
union {
int surface_format; /** the rendering DXGI_FORMAT for \ref libvlc_video_direct3d_engine_d3d11,
D3DFORMAT for \ref libvlc_video_direct3d_engine_d3d9,
GL_RGBA or GL_RGB for \ref libvlc_video_engine_opengl and
int dxgi_format; /** the rendering DXGI_FORMAT for \ref libvlc_video_direct3d_engine_d3d11*/
uint32_t d3d9_format; /** the rendering D3DFORMAT for \ref libvlc_video_direct3d_engine_d3d9 */
int opengl_format; /** the rendering GLint GL_RGBA or GL_RGB for \ref libvlc_video_engine_opengl and
for \ref libvlc_video_engine_gles2 */
void *p_surface; /** currently unused */
};

2
modules/video_output/vgl.c

@ -90,7 +90,7 @@ static void Resize(vlc_gl_t * gl, unsigned w, unsigned h)
libvlc_video_output_cfg_t render_cfg;
sys->resizeCb(sys->opaque, &output_cfg, &render_cfg);
ReleaseCurrent(gl);
assert(render_cfg.surface_format == GL_RGBA);
assert(render_cfg.opengl_format == GL_RGBA);
assert(render_cfg.full_range == true);
assert(render_cfg.colorspace == libvlc_video_colorspace_BT709);
assert(render_cfg.primaries == libvlc_video_primaries_BT709);

2
modules/video_output/win32/d3d11_swapchain.c

@ -475,7 +475,7 @@ bool LocalSwapchainUpdateOutput( void *opaque, const libvlc_video_render_cfg_t *
struct d3d11_local_swapchain *display = opaque;
if ( !UpdateSwapchain( display, cfg ) )
return false;
out->surface_format = display->pixelFormat->formatTexture;
out->dxgi_format = display->pixelFormat->formatTexture;
out->full_range = display->colorspace->b_full_range;
out->colorspace = (libvlc_video_color_space_t) display->colorspace->color;
out->primaries = (libvlc_video_color_primaries_t) display->colorspace->primaries;

2
modules/video_output/win32/direct3d11.c

@ -158,7 +158,7 @@ static int UpdateDisplayFormat(vout_display_t *vd, libvlc_video_output_cfg_t *ou
for (const d3d_format_t *output_format = GetRenderFormatList();
output_format->name != NULL; ++output_format)
{
if (output_format->formatTexture == (DXGI_FORMAT)out->surface_format &&
if (output_format->formatTexture == (DXGI_FORMAT)out->dxgi_format &&
!is_d3d11_opaque(output_format->fourcc))
{
new_display.pixelFormat = output_format;

2
modules/video_output/win32/direct3d9.c

@ -1508,7 +1508,7 @@ VLC_CONFIG_STRING_ENUM(FindShadersCallback)
static bool LocalSwapchainUpdateOutput( void *opaque, const libvlc_video_render_cfg_t *cfg, libvlc_video_output_cfg_t *out )
{
vout_display_t *vd = opaque;
out->surface_format = vd->sys->d3d9_device->d3ddev.BufferFormat;
out->d3d9_format = vd->sys->d3d9_device->d3ddev.BufferFormat;
return true;
}

Loading…
Cancel
Save