diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-10-26 00:18:39 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-11-26 21:35:49 +0000 |
commit | 24cc0a53e99e281b0ff502e82e7cf857111eca3f (patch) | |
tree | 2b85011f3b02cef82eb4dc1d5c90b683b043385b /libavcodec/utils.c | |
parent | 2779d33ed99898675e0b3884fabe1ce6839f36d1 (diff) |
lavc: Add codec metadata to indicate hardware support
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index c733709171..2a09ed4930 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -45,6 +45,7 @@ #include "libavutil/thread.h" #include "avcodec.h" #include "decode.h" +#include "hwaccel.h" #include "libavutil/opt.h" #include "me_cmp.h" #include "mpegvideo.h" @@ -1886,6 +1887,17 @@ int ff_match_2uint16(const uint16_t(*tab)[2], int size, int a, int b) return i; } +const AVCodecHWConfig *avcodec_get_hw_config(const AVCodec *codec, int index) +{ + int i; + if (!codec->hw_configs || index < 0) + return NULL; + for (i = 0; i <= index; i++) + if (!codec->hw_configs[i]) + return NULL; + return &codec->hw_configs[index]->public; +} + static AVHWAccel *first_hwaccel = NULL; static AVHWAccel **last_hwaccel = &first_hwaccel; |