summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/csputils.c19
-rw-r--r--video/csputils.h1
-rw-r--r--video/d3d.h13
-rw-r--r--video/d3d11va.c86
-rw-r--r--video/d3d11va.h30
-rw-r--r--video/decode/d3d.c57
-rw-r--r--video/decode/d3d.h21
-rw-r--r--video/decode/d3d11va.c184
-rw-r--r--video/decode/dec_video.h2
-rw-r--r--video/decode/dxva2.c134
-rw-r--r--video/decode/lavc.h12
-rw-r--r--video/decode/mediacodec.c68
-rw-r--r--video/decode/rpi.c71
-rw-r--r--video/decode/vaapi.c57
-rw-r--r--video/decode/vd_lavc.c186
-rw-r--r--video/decode/vdpau.c21
-rw-r--r--video/decode/videotoolbox.c9
-rw-r--r--video/dxva2.c87
-rw-r--r--video/dxva2.h32
-rw-r--r--video/filter/refqueue.c230
-rw-r--r--video/filter/refqueue.h36
-rw-r--r--video/filter/vf.c37
-rw-r--r--video/filter/vf.h5
-rw-r--r--video/filter/vf_crop.c31
-rw-r--r--video/filter/vf_d3d11vpp.c537
-rw-r--r--video/filter/vf_format.c4
-rw-r--r--video/filter/vf_vavpp.c256
-rw-r--r--video/filter/vf_vdpaupp.c176
-rw-r--r--video/filter/vf_vdpaurb.c30
-rw-r--r--video/fmt-conversion.c6
-rw-r--r--video/hwdec.c90
-rw-r--r--video/hwdec.h102
-rw-r--r--video/image_writer.c12
-rw-r--r--video/img_format.c10
-rw-r--r--video/img_format.h15
-rw-r--r--video/mp_image.c86
-rw-r--r--video/mp_image.h10
-rw-r--r--video/out/bitmap_packer.c37
-rw-r--r--video/out/bitmap_packer.h1
-rw-r--r--video/out/cocoa/events_view.m9
-rw-r--r--video/out/cocoa/window.m5
-rw-r--r--video/out/cocoa_common.m30
-rw-r--r--video/out/drm_common.c4
-rw-r--r--video/out/opengl/angle_common.c13
-rw-r--r--video/out/opengl/angle_common.h13
-rw-r--r--video/out/opengl/angle_dynamic.c33
-rw-r--r--video/out/opengl/angle_dynamic.h82
-rw-r--r--video/out/opengl/common.c129
-rw-r--r--video/out/opengl/common.h32
-rw-r--r--video/out/opengl/context.c2
-rw-r--r--video/out/opengl/context_angle.c148
-rw-r--r--video/out/opengl/context_cocoa.c9
-rw-r--r--video/out/opengl/context_dxinterop.c85
-rw-r--r--video/out/opengl/context_rpi.c1
-rw-r--r--video/out/opengl/context_w32.c8
-rw-r--r--video/out/opengl/context_wayland.c11
-rw-r--r--video/out/opengl/context_x11.c4
-rw-r--r--video/out/opengl/context_x11egl.c12
-rw-r--r--video/out/opengl/egl_helpers.c10
-rw-r--r--video/out/opengl/egl_helpers.h3
-rw-r--r--video/out/opengl/formats.c272
-rw-r--r--video/out/opengl/formats.h59
-rw-r--r--video/out/opengl/header_fixes.h26
-rw-r--r--video/out/opengl/hwdec.c34
-rw-r--r--video/out/opengl/hwdec.h47
-rw-r--r--video/out/opengl/hwdec_d3d11egl.c335
-rw-r--r--video/out/opengl/hwdec_d3d11eglrgb.c268
-rw-r--r--video/out/opengl/hwdec_dxva2.c35
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c49
-rw-r--r--video/out/opengl/hwdec_dxva2gldx.c46
-rw-r--r--video/out/opengl/hwdec_osx.c63
-rw-r--r--video/out/opengl/hwdec_vaegl.c103
-rw-r--r--video/out/opengl/hwdec_vaglx.c29
-rw-r--r--video/out/opengl/hwdec_vdpau.c155
-rw-r--r--video/out/opengl/lcms.c153
-rw-r--r--video/out/opengl/lcms.h10
-rw-r--r--video/out/opengl/nnedi3.c253
-rw-r--r--video/out/opengl/nnedi3.h45
-rw-r--r--video/out/opengl/nnedi3_weights.binbin161280 -> 0 bytes
-rw-r--r--video/out/opengl/osd.c211
-rw-r--r--video/out/opengl/superxbr.c244
-rw-r--r--video/out/opengl/superxbr.h31
-rw-r--r--video/out/opengl/user_shaders.c195
-rw-r--r--video/out/opengl/user_shaders.h74
-rw-r--r--video/out/opengl/utils.c442
-rw-r--r--video/out/opengl/utils.h39
-rw-r--r--video/out/opengl/video.c2113
-rw-r--r--video/out/opengl/video.h49
-rw-r--r--video/out/opengl/video_shaders.c167
-rw-r--r--video/out/opengl/video_shaders.h7
-rw-r--r--video/out/vo.c13
-rw-r--r--video/out/vo.h20
-rw-r--r--video/out/vo_direct3d.c18
-rw-r--r--video/out/vo_lavc.c100
-rw-r--r--video/out/vo_opengl.c126
-rw-r--r--video/out/vo_opengl_cb.c25
-rw-r--r--video/out/vo_rpi.c170
-rw-r--r--video/out/vo_sdl.c21
-rw-r--r--video/out/vo_vaapi.c17
-rw-r--r--video/out/vo_vdpau.c13
-rw-r--r--video/out/vo_wayland.c17
-rw-r--r--video/out/vo_xv.c9
-rw-r--r--video/out/w32_common.c72
-rw-r--r--video/out/wayland_common.c52
-rw-r--r--video/out/wayland_common.h1
-rw-r--r--video/out/x11_common.c35
-rw-r--r--video/vaapi.c35
-rw-r--r--video/vaapi.h2
-rw-r--r--video/vdpau.c62
-rw-r--r--video/vdpau.h3
-rw-r--r--video/vdpau_mixer.c8
-rw-r--r--video/vdpau_mixer.h1
112 files changed, 6336 insertions, 3482 deletions
diff --git a/video/csputils.c b/video/csputils.c
index 69d3b80944..ffa1f82a6d 100644
--- a/video/csputils.c
+++ b/video/csputils.c
@@ -77,6 +77,7 @@ const struct m_opt_choice_alternatives mp_csp_trc_names[] = {
{"gamma2.2", MP_CSP_TRC_GAMMA22},
{"gamma2.8", MP_CSP_TRC_GAMMA28},
{"prophoto", MP_CSP_TRC_PRO_PHOTO},
+ {"st2084", MP_CSP_TRC_SMPTE_ST2084},
{0}
};
@@ -170,6 +171,9 @@ enum mp_csp_trc avcol_trc_to_mp_csp_trc(int avtrc)
case AVCOL_TRC_LINEAR: return MP_CSP_TRC_LINEAR;
case AVCOL_TRC_GAMMA22: return MP_CSP_TRC_GAMMA22;
case AVCOL_TRC_GAMMA28: return MP_CSP_TRC_GAMMA28;
+#if HAVE_AVUTIL_ST2084
+ case AVCOL_TRC_SMPTEST2084: return MP_CSP_TRC_SMPTE_ST2084;
+#endif
default: return MP_CSP_TRC_AUTO;
}
}
@@ -213,12 +217,15 @@ int mp_csp_trc_to_avcol_trc(enum mp_csp_trc trc)
{
switch (trc) {
// We just call it BT.1886 since we're decoding, but it's still BT.709
- case MP_CSP_TRC_BT_1886: return AVCOL_TRC_BT709;
- case MP_CSP_TRC_SRGB: return AVCOL_TRC_IEC61966_2_1;
- case MP_CSP_TRC_LINEAR: return AVCOL_TRC_LINEAR;
- case MP_CSP_TRC_GAMMA22: return AVCOL_TRC_GAMMA22;
- case MP_CSP_TRC_GAMMA28: return AVCOL_TRC_GAMMA28;
- default: return AVCOL_TRC_UNSPECIFIED;
+ case MP_CSP_TRC_BT_1886: return AVCOL_TRC_BT709;
+ case MP_CSP_TRC_SRGB: return AVCOL_TRC_IEC61966_2_1;
+ case MP_CSP_TRC_LINEAR: return AVCOL_TRC_LINEAR;
+ case MP_CSP_TRC_GAMMA22: return AVCOL_TRC_GAMMA22;
+ case MP_CSP_TRC_GAMMA28: return AVCOL_TRC_GAMMA28;
+#if HAVE_AVUTIL_ST2084
+ case MP_CSP_TRC_SMPTE_ST2084: return AVCOL_TRC_SMPTEST2084;
+#endif
+ default: return AVCOL_TRC_UNSPECIFIED;
}
}
diff --git a/video/csputils.h b/video/csputils.h
index 1d8d3b1d14..19dd88f145 100644
--- a/video/csputils.h
+++ b/video/csputils.h
@@ -78,6 +78,7 @@ enum mp_csp_trc {
MP_CSP_TRC_GAMMA22,
MP_CSP_TRC_GAMMA28,
MP_CSP_TRC_PRO_PHOTO,
+ MP_CSP_TRC_SMPTE_ST2084,
MP_CSP_TRC_COUNT
};
diff --git a/video/d3d.h b/video/d3d.h
deleted file mode 100644
index 30bee49adc..0000000000
--- a/video/d3d.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef MP_D3D_H_
-#define MP_D3D_H_
-
-#include <d3d9.h>
-
-#include "hwdec.h"
-
-struct mp_d3d_ctx {
- struct mp_hwdec_ctx hwctx;
- IDirect3DDevice9 *d3d9_device;
-};
-
-#endif
diff --git a/video/d3d11va.c b/video/d3d11va.c
deleted file mode 100644
index a9be571e9c..0000000000
--- a/video/d3d11va.c
+++ /dev/null
@@ -1,86 +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 "mp_image.h"
-#include "d3d11va.h"
-
-struct d3d11va_surface {
- HMODULE d3d11_dll;
- ID3D11Texture2D *texture;
- ID3D11VideoDecoderOutputView *surface;
-};
-
-ID3D11VideoDecoderOutputView *d3d11_surface_in_mp_image(struct mp_image *mpi)
-{
- return mpi && mpi->imgfmt == IMGFMT_D3D11VA ?
- (ID3D11VideoDecoderOutputView *)mpi->planes[3] : NULL;
-}
-
-ID3D11Texture2D *d3d11_texture_in_mp_image(struct mp_image *mpi)
-{
- if (!mpi || mpi->imgfmt != IMGFMT_D3D11VA)
- return NULL;
- struct d3d11va_surface *surface = (void *)mpi->planes[0];
- return surface->texture;
-}
-
-static void d3d11va_release_img(void *arg)
-{
- struct d3d11va_surface *surface = arg;
- if (surface->surface)
- ID3D11VideoDecoderOutputView_Release(surface->surface);
-
- if (surface->texture)
- ID3D11Texture2D_Release(surface->texture);
-
- if (surface->d3d11_dll)
- FreeLibrary(surface->d3d11_dll);
-
- talloc_free(surface);
-}
-
-struct mp_image *d3d11va_new_ref(ID3D11VideoDecoderOutputView *view,
- int w, int h)
-{
- if (!view)
- return NULL;
- struct d3d11va_surface *surface = talloc_zero(NULL, struct d3d11va_surface);
-
- surface->d3d11_dll = LoadLibrary(L"d3d11.dll");
- if (!surface->d3d11_dll)
- goto fail;
-
- surface->surface = view;
- ID3D11VideoDecoderOutputView_AddRef(surface->surface);
- ID3D11VideoDecoderOutputView_GetResource(
- surface->surface, (ID3D11Resource **)&surface->texture);
-
- struct mp_image *mpi = mp_image_new_custom_ref(
- &(struct mp_image){0}, surface, d3d11va_release_img);
- if (!mpi)
- abort();
-
- mp_image_setfmt(mpi, IMGFMT_D3D11VA);
- mp_image_set_size(mpi, w, h);
- mpi->planes[0] = (void *)surface;
- mpi->planes[3] = (void *)surface->surface;
-
- return mpi;
-fail:
- d3d11va_release_img(surface);
- return NULL;
-}
diff --git a/video/d3d11va.h b/video/d3d11va.h
deleted file mode 100644
index db2f295241..0000000000
--- a/video/d3d11va.h
+++ /dev/null
@@ -1,30 +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/>.
- */
-
-#ifndef MPV_D3D11_H
-#define MPV_D3D11_H
-
-#include <d3d11.h>
-
-struct mp_image;
-
-ID3D11VideoDecoderOutputView *d3d11_surface_in_mp_image(struct mp_image *mpi);
-ID3D11Texture2D *d3d11_texture_in_mp_image(struct mp_image *mpi);
-struct mp_image *d3d11va_new_ref(ID3D11VideoDecoderOutputView *view,
- int w, int h);
-
-#endif
diff --git a/video/decode/d3d.c b/video/decode/d3d.c
index 35d1af9243..b978472723 100644
--- a/video/decode/d3d.c
+++ b/video/decode/d3d.c
@@ -15,6 +15,8 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <pthread.h>
+
#include <libavcodec/avcodec.h>
#include "lavc.h"
@@ -48,7 +50,6 @@ DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0, 0x4585, 0x87
DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81beD0, 0xa0c7, 0x11d3,