diff options
author | wm4 <wm4@nowhere> | 2016-04-25 11:28:25 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-04-25 12:13:12 +0200 |
commit | 4f5509e1dd421ad144090499ee083f63f54313dd (patch) | |
tree | 80968f3e59b0de2e7ba6254189c05ee41fb4d3fa /video/decode/lavc.h | |
parent | 85416bc36ac53424e6884c305e5ab1a6f875562d (diff) | |
download | mpv-4f5509e1dd421ad144090499ee083f63f54313dd.tar.bz2 mpv-4f5509e1dd421ad144090499ee083f63f54313dd.tar.xz |
vd_lavc: better hwdec wrapper decoder selection
This is intended for cases when --hwdec needs to override the decoder
implementation in use, like for example on the RPI.
It does two things:
1. Allow the hwdec to indicate a decoder suffix. libavcodec by
convention adds a suffix to all wrapper decoders, and here we start
relying on it. While not necessarily the best idea, it's the only
thing we got. libavcodec's hwaccel list is useless, because it only
has the codec ID, not the associated decoder's name.
2. Make --hwdec=auto work properly. It shouldn't fail anymore, and hwdec
probing should reliably work, even if a different decoder is selected
with --vd. The semantics of --hwdec should dictate that it overrides
the default decoder.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r-- | video/decode/lavc.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index 826edbff83..73243e16c4 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -69,6 +69,10 @@ struct vd_lavc_hwdec { void (*unlock)(struct lavc_ctx *ctx); // Optional; if a special hardware decoder is needed (instead of "hwaccel"). const char *(*get_codec)(struct lavc_ctx *ctx, const char *codec); + // Suffix for libavcodec decoder. If non-NULL, get_codec() is overridden + // with hwdec_find_decoder. + // Intuitively, this will force the corresponding wrapper decoder. + const char *lavc_suffix; }; enum { @@ -89,4 +93,6 @@ bool hwdec_check_codec_support(const char *codec, const struct hwdec_profile_entry *table); int hwdec_get_max_refs(struct lavc_ctx *ctx); +const char *hwdec_find_decoder(const char *codec, const char *suffix); + #endif |