summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/decode/d3d.c2
-rw-r--r--video/decode/d3d.h2
-rw-r--r--video/decode/hw_d3d11va.c53
-rw-r--r--video/decode/hw_dxva2.c57
-rw-r--r--video/decode/vd_lavc.c42
-rw-r--r--wscript_build.py2
6 files changed, 39 insertions, 119 deletions
diff --git a/video/decode/d3d.c b/video/decode/d3d.c
index 6cc5018333..8f04dcd0d6 100644
--- a/video/decode/d3d.c
+++ b/video/decode/d3d.c
@@ -28,10 +28,10 @@
#include <libavutil/hwcontext_dxva2.h>
#endif
-#include "lavc.h"
#include "common/common.h"
#include "common/av_common.h"
#include "video/fmt-conversion.h"
+#include "video/hwdec.h"
#include "video/mp_image.h"
#include "video/mp_image_pool.h"
#include "osdep/windows_utils.h"
diff --git a/video/decode/d3d.h b/video/decode/d3d.h
index 2da349a27a..0058905a27 100644
--- a/video/decode/d3d.h
+++ b/video/decode/d3d.h
@@ -24,8 +24,6 @@
#include <stdbool.h>
#include <inttypes.h>
-struct lavc_ctx;
-
// Must call d3d_load_dlls() before accessing. Once this is done, the DLLs
// remain loaded forever.
extern HMODULE d3d11_dll, d3d9_dll, dxva2_dll;
diff --git a/video/decode/hw_d3d11va.c b/video/decode/hw_d3d11va.c
deleted file mode 100644
index 76af9a52a9..0000000000
--- a/video/decode/hw_d3d11va.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * This file is part of mpv.
- *
- * mpv 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.
- *
- * mpv 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 mpv. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <libavcodec/d3d11va.h>
-#include <libavutil/mem.h>
-
-#include "config.h"
-
-#include "lavc.h"
-#include "common/common.h"
-#include "common/av_common.h"
-#include "osdep/windows_utils.h"
-#include "video/fmt-conversion.h"
-#include "video/mp_image_pool.h"
-#include "video/hwdec.h"
-
-#include "d3d.h"
-
-#include <libavutil/hwcontext.h>
-#include <libavutil/hwcontext_d3d11va.h>
-
-
-const struct vd_lavc_hwdec mp_vd_lavc_d3d11va = {
- .type = HWDEC_D3D11VA,
- .image_format = IMGFMT_D3D11VA,
- .generic_hwaccel = true,
- .set_hwframes = true,
-};
-
-const struct vd_lavc_hwdec mp_vd_lavc_d3d11va_copy = {
- .type = HWDEC_D3D11VA_COPY,
- .copying = true,
- .image_format = IMGFMT_D3D11VA,
- .generic_hwaccel = true,
- .create_standalone_dev = true,
- .create_standalone_dev_type = AV_HWDEVICE_TYPE_D3D11VA,
- .set_hwframes = true,
- .delay_queue = HWDEC_DELAY_QUEUE_COUNT,
-};
diff --git a/video/decode/hw_dxva2.c b/video/decode/hw_dxva2.c
deleted file mode 100644
index 4d372dd2fb..0000000000
--- a/video/decode/hw_dxva2.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Ported from FFmpeg ffmpeg_dxva2.c (2dbee1a3935a91842c22eb65fd13f77e8d590e07).
- * Original copyright header follows:
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg 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.
- *
- * FFmpeg 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 FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#define DXVA2API_USE_BITFIELDS
-#include <libavcodec/dxva2.h>
-#include <libavutil/common.h>
-
-#include "config.h"
-
-#include "lavc.h"
-#include "common/common.h"
-#include "common/av_common.h"
-#include "osdep/windows_utils.h"
-#include "video/fmt-conversion.h"
-#include "video/mp_image_pool.h"
-#include "video/hwdec.h"
-
-#include "d3d.h"
-
-#include <libavutil/hwcontext.h>
-#include <libavutil/hwcontext_dxva2.h>
-
-const struct vd_lavc_hwdec mp_vd_lavc_dxva2 = {
- .type = HWDEC_DXVA2,
- .image_format = IMGFMT_DXVA2,
- .generic_hwaccel = true,
- .set_hwframes = true,
-};
-
-const struct vd_lavc_hwdec mp_vd_lavc_dxva2_copy = {
- .type = HWDEC_DXVA2_COPY,
- .copying = true,
- .image_format = IMGFMT_DXVA2,
- .generic_hwaccel = true,
- .create_standalone_dev = true,
- .create_standalone_dev_type = AV_HWDEVICE_TYPE_DXVA2,
- .set_hwframes = true,
- .delay_queue = HWDEC_DELAY_QUEUE_COUNT,
-};
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 1097577c05..1005c131c6 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -125,10 +125,6 @@ const struct m_sub_options vd_lavc_conf = {
extern const struct vd_lavc_hwdec mp_vd_lavc_mediacodec;
extern const struct vd_lavc_hwdec mp_vd_lavc_mediacodec_copy;
-extern const struct vd_lavc_hwdec mp_vd_lavc_dxva2;
-extern const struct vd_lavc_hwdec mp_vd_lavc_dxva2_copy;
-extern const struct vd_lavc_hwdec mp_vd_lavc_d3d11va;
-extern const struct vd_lavc_hwdec mp_vd_lavc_d3d11va_copy;
#if HAVE_RPI
static const struct vd_lavc_hwdec mp_vd_lavc_rpi = {
@@ -245,6 +241,44 @@ static const struct vd_lavc_hwdec mp_vd_lavc_videotoolbox_copy = {
};
#endif
+#if HAVE_D3D_HWACCEL
+static const struct vd_lavc_hwdec mp_vd_lavc_d3d11va = {
+ .type = HWDEC_D3D11VA,
+ .image_format = IMGFMT_D3D11VA,
+ .generic_hwaccel = true,
+ .set_hwframes = true,
+};
+static const struct vd_lavc_hwdec mp_vd_lavc_d3d11va_copy = {
+ .type = HWDEC_D3D11VA_COPY,
+ .copying = true,
+ .image_format = IMGFMT_D3D11VA,
+ .generic_hwaccel = true,
+ .create_standalone_dev = true,
+ .create_standalone_dev_type = AV_HWDEVICE_TYPE_D3D11VA,
+ .set_hwframes = true,
+ .delay_queue = HWDEC_DELAY_QUEUE_COUNT,
+};
+#endif
+
+#if HAVE_D3D9_HWACCEL
+static const struct vd_lavc_hwdec mp_vd_lavc_dxva2 = {
+ .type = HWDEC_DXVA2,
+ .image_format = IMGFMT_DXVA2,
+ .generic_hwaccel = true,
+ .set_hwframes = true,
+};
+static const struct vd_lavc_hwdec mp_vd_lavc_dxva2_copy = {
+ .type = HWDEC_DXVA2_COPY,
+ .copying = true,
+ .image_format = IMGFMT_DXVA2,
+ .generic_hwaccel = true,
+ .create_standalone_dev = true,
+ .create_standalone_dev_type = AV_HWDEVICE_TYPE_DXVA2,
+ .set_hwframes = true,
+ .delay_queue = HWDEC_DELAY_QUEUE_COUNT,
+};
+#endif
+
static const struct vd_lavc_hwdec *const hwdec_list[] = {
#if HAVE_D3D_HWACCEL
&mp_vd_lavc_d3d11va,
diff --git a/wscript_build.py b/wscript_build.py
index 4477301f22..4a568c491f 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -363,8 +363,6 @@ def build(ctx):
( "video/vdpau_mixer.c", "vdpau" ),
( "video/decode/d3d.c", "d3d-hwaccel" ),
( "video/decode/dec_video.c"),
- ( "video/decode/hw_dxva2.c", "d3d9-hwaccel" ),
- ( "video/decode/hw_d3d11va.c", "d3d-hwaccel" ),
( "video/decode/hw_mediacodec.c", "android" ),
( "video/decode/vd_lavc.c" ),
( "video/filter/refqueue.c" ),