From: Steve Lhomme <rob...@gmail.com>

---
 Makefile               |  2 +-
 avconv_dxva2.c         |  1 +
 avconv_dxva_template.c |  7 ++++++-
 avconv_guid.c          | 20 ++++++++++++++++++++
 4 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 avconv_guid.c

diff --git a/Makefile b/Makefile
index a9f5f9a..26c296f 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ OBJS-avconv                   += avconv_opt.o avconv_filter.o
 OBJS-avconv-$(CONFIG_LIBMFX)  += avconv_qsv.o
 OBJS-avconv-$(CONFIG_VAAPI)   += avconv_vaapi.o
 OBJS-avconv-$(CONFIG_VDA)     += avconv_vda.o
-OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o
+OBJS-avconv-$(HAVE_DXVA2_LIB) += avconv_dxva2.o avconv_guid.o
 OBJS-avconv-$(HAVE_VDPAU_X11) += avconv_vdpau.o
 
 TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
diff --git a/avconv_dxva2.c b/avconv_dxva2.c
index 442a0bd..4c6ef8d 100644
--- a/avconv_dxva2.c
+++ b/avconv_dxva2.c
@@ -63,6 +63,7 @@ typedef struct dxva_context         DXVA_AV_CONTEXT;
 typedef IDirectXVideoDecoderService *DXVA_DECODER_SERVICE;
 #include "avconv_dxva_template.c"
 
+#include <initguid.h>
 DEFINE_GUID(IID_IDirectXVideoDecoderService, 
0xfc51a551,0xd5e7,0x11d9,0xaf,0x55,0x00,0x05,0x4e,0x43,0xff,0x02);
 
 static void dxva2_uninit(AVCodecContext *s)
diff --git a/avconv_dxva_template.c b/avconv_dxva_template.c
index c6bd0c5..572a140 100644
--- a/avconv_dxva_template.c
+++ b/avconv_dxva_template.c
@@ -16,9 +16,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#ifndef INITGUID
+#include <guiddef.h>
+#endif
+
 /* define all the GUIDs used directly here,
  to avoid problems with inconsistent dxva2api.h versions in mingw-w64 and 
different MSVC version */
-#include <initguid.h>
 DEFINE_GUID(DXVA2_ModeMPEG2_VLD,      0xee27417f, 
0x5e28,0x4e65,0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);
 DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD,  0x86695f12, 
0x340e,0x4f04,0x9f,0xd3,0x92,0x53,0xdd,0x32,0x74,0x60);
 DEFINE_GUID(DXVA2_ModeH264_E,         0x1b81be68, 
0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
@@ -31,6 +34,7 @@ DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main10,0x107af0e0, 
0xef1a,0x4d19,0xab,0xa8,0x67,0
 DEFINE_GUID(DXVA2_NoEncrypt,          0x1b81beD0, 
0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);
 DEFINE_GUID(GUID_NULL,                0x00000000, 
0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
 
+#ifndef INITGUID
 typedef struct dxva_mode {
     const GUID     *guid;
     enum AVCodecID codec;
@@ -287,3 +291,4 @@ fail:
     dxva_uninit(s);
     return AVERROR(EINVAL);
 }
+#endif /* INITGUID */
diff --git a/avconv_guid.c b/avconv_guid.c
new file mode 100644
index 0000000..0093e33
--- /dev/null
+++ b/avconv_guid.c
@@ -0,0 +1,20 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <initguid.h>
+#include "avconv_dxva_template.c"
-- 
2.10.2

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to