[vlc-commits] dxgi_fmt: add DxgiFourccFormat()

Steve Lhomme git at videolan.org
Mon May 28 13:25:30 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Oct 30 18:09:19 2017 +0100| [f745b07ac97ab54444be99745365029c211862c9] | committer: Steve Lhomme

dxgi_fmt: add DxgiFourccFormat()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f745b07ac97ab54444be99745365029c211862c9
---

 modules/video_chroma/dxgi_fmt.c | 10 ++++++++++
 modules/video_chroma/dxgi_fmt.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/modules/video_chroma/dxgi_fmt.c b/modules/video_chroma/dxgi_fmt.c
index 844e691631..a6a6e2d485 100644
--- a/modules/video_chroma/dxgi_fmt.c
+++ b/modules/video_chroma/dxgi_fmt.c
@@ -114,6 +114,16 @@ vlc_fourcc_t DxgiFormatFourcc(DXGI_FORMAT format)
     return 0;
 }
 
+DXGI_FORMAT DxgiFourccFormat(vlc_fourcc_t fcc)
+{
+    for (const dxgi_format_t *f = dxgi_formats; f->name != NULL; ++f)
+    {
+        if (f->vlc_format == fcc)
+            return f->format;
+    }
+    return DXGI_FORMAT_UNKNOWN;
+}
+
 const d3d_format_t *GetRenderFormatList(void)
 {
     return d3d_formats;
diff --git a/modules/video_chroma/dxgi_fmt.h b/modules/video_chroma/dxgi_fmt.h
index 6b5c32e96a..af671b594a 100644
--- a/modules/video_chroma/dxgi_fmt.h
+++ b/modules/video_chroma/dxgi_fmt.h
@@ -53,6 +53,7 @@ const char *DxgiFormatToStr(DXGI_FORMAT format);
 vlc_fourcc_t DxgiFormatFourcc(DXGI_FORMAT format);
 const d3d_format_t *GetRenderFormatList(void);
 void DxgiFormatMask(DXGI_FORMAT format, video_format_t *);
+DXGI_FORMAT DxgiFourccFormat(vlc_fourcc_t fcc);
 const char *DxgiVendorStr(int gpu_vendor);
 UINT DxgiResourceCount(const d3d_format_t *);
 



More information about the vlc-commits mailing list