1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 14:50:07 +00:00

vd_lavc: delete hw_d3d11va.c/hw_dxva2.c and merge leftovers

Like with all hwaccels, there's little that is actually specific to
decoding (which has been moved away anyway), and what is left are
declarations (which will also go away soon).
This commit is contained in:
wm4 2017-12-01 08:13:24 +01:00
parent b89f5084cc
commit 1e44540906
6 changed files with 39 additions and 119 deletions

View File

@ -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"

View File

@ -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;

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,

View File

@ -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" ),