diff options
author | Philip Langdale <philipl@overt.org> | 2017-05-29 09:48:10 -0700 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-06-03 16:41:03 +0200 |
commit | 7424651b9637082f71deab9fcc87111e2d9df13f (patch) | |
tree | e5d4813a3195e56d39bd313900a765bc69d9e40d /options | |
parent | 7e889e5e637536cba3dfced3962ab87d7c8ea01f (diff) | |
download | mpv-7424651b9637082f71deab9fcc87111e2d9df13f.tar.bz2 mpv-7424651b9637082f71deab9fcc87111e2d9df13f.tar.xz |
vo_opengl: hwdec_cuda: Support separate decode and display devices
In a multi GPU scenario, it may be desirable to use different GPUs
for decode and display responsibilities. For example, if a secondary
GPU has better video decoding capabilities.
In such a scenario, we need to initialise a separate context for each
GPU, and use the display context in hwdec_cuda, while passing the
decode context to avcodec.
Once that's done, the actually hand-off between the two GPUs is
transparent to us (It happens during the cuMemcpy2D operation which
copies the decoded frame from a cuda buffer to the OpenGL texture).
In the end, the bulk of the work is around introducing a new
configuration option to specify the decode device.
Diffstat (limited to 'options')
-rw-r--r-- | options/options.c | 7 | ||||
-rw-r--r-- | options/options.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c index 1540dcbbf4..6664820ae3 100644 --- a/options/options.c +++ b/options/options.c @@ -728,6 +728,11 @@ const m_option_t mp_opts[] = { ({"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})), #endif +#if HAVE_CUDA_HWACCEL + OPT_CHOICE_OR_INT("cuda-decode-device", cuda_device, 0, + 0, INT_MAX, ({"auto", -1})), +#endif + #if HAVE_ENCODING OPT_SUBSTRUCT("", encode_opts, encode_config, 0), #endif @@ -973,6 +978,8 @@ const struct MPOpts mp_default_opts = { "Performer", "Title", "Track", "icy-title", "service_name", NULL }, + + .cuda_device = -1, }; #endif /* MPLAYER_CFG_MPLAYER_H */ diff --git a/options/options.h b/options/options.h index bfe7d42bcf..851b9c507f 100644 --- a/options/options.h +++ b/options/options.h @@ -336,6 +336,8 @@ typedef struct MPOpts { struct angle_opts *angle_opts; struct cocoa_opts *cocoa_opts; struct dvd_opts *dvd_opts; + + int cuda_device; } MPOpts; struct dvd_opts { |