mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
videotoolbox: make decoder format customizable
Because apparently there's no ideal universally working format. The weird OpenGL texture format for kCVPixelFormatType_32BGRA is from: http://stackoverflow.com/questions/22077544/draw-an-iosurface-to-an-opengl-context (Which apparently got it from the linked Apple example code.)
This commit is contained in:
@@ -308,6 +308,9 @@ const m_option_t mp_opts[] = {
|
||||
OPT_CHOICE_C("hwdec", hwdec_api, 0, mp_hwdec_names),
|
||||
OPT_CHOICE_C("hwdec-preload", vo.hwdec_preload_api, 0, mp_hwdec_names),
|
||||
OPT_STRING("hwdec-codecs", hwdec_codecs, 0),
|
||||
#if HAVE_VIDEOTOOLBOX_HWACCEL
|
||||
OPT_IMAGEFORMAT("videotoolbox-format", videotoolbox_format, 0),
|
||||
#endif
|
||||
|
||||
OPT_SUBSTRUCT("sws", vo.sws_opts, sws_conf, 0),
|
||||
|
||||
@@ -804,6 +807,7 @@ const struct MPOpts mp_default_opts = {
|
||||
.screenshot_template = "mpv-shot%n",
|
||||
|
||||
.hwdec_codecs = "h264,vc1,wmv3,hevc,mpeg2video",
|
||||
.videotoolbox_format = IMGFMT_NV12,
|
||||
|
||||
.index_mode = 1,
|
||||
|
||||
|
||||
@@ -268,6 +268,7 @@ typedef struct MPOpts {
|
||||
|
||||
int hwdec_api;
|
||||
char *hwdec_codecs;
|
||||
int videotoolbox_format;
|
||||
|
||||
int w32_priority;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user