summaryrefslogtreecommitdiffstats
path: root/video/decode/lavc.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-01 17:14:05 +0100
committerwm4 <wm4@nowhere>2013-11-01 17:33:33 +0100
commit24897eb94ccdc4c7a4b9b201ec733b4d8f445f53 (patch)
tree2ca329aee0fefdc563c0154d3b17c22d23f1ec86 /video/decode/lavc.h
parent4aae1ff6de3a29c57492bc12113251f99308dc51 (diff)
downloadmpv-24897eb94ccdc4c7a4b9b201ec733b4d8f445f53.tar.bz2
mpv-24897eb94ccdc4c7a4b9b201ec733b4d8f445f53.tar.xz
video: check profiles with hardware decoding
We had some code for checking profiles earlier, which was removed in commits 2508f38 and adfb71b. These commits mentioned that (working) hw decoding was sometimes prevented due to profile checking, but I can't find the samples anymore that showed this behavior. Also, I changed my opinion, and I think checking the profiles is something that should be done for better fallback to software decoding behavior. The checks roughly follow VLC's vdpau profile checks, although we do not check codec levels. (VLC's profile checks aren't necessarily completely correct, but they're a welcome help anyway.) Add a --vd-lavc-check-hw-profile option, which skips the profile check.
Diffstat (limited to 'video/decode/lavc.h')
-rw-r--r--video/decode/lavc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h
index 32b827b964..9e2533cbd5 100644
--- a/video/decode/lavc.h
+++ b/video/decode/lavc.h
@@ -22,6 +22,7 @@ enum hwdec_type {
};
typedef struct lavc_ctx {
+ struct MPOpts *opts;
AVCodecContext *avctx;
AVFrame *pic;
struct vd_lavc_hwdec *hwdec;
@@ -73,6 +74,18 @@ enum {
HWDEC_ERR_NO_CODEC = -3,
};
+struct hwdec_profile_entry {
+ enum AVCodecID av_codec;
+ int ff_profile;
+ uint64_t hw_profile;
+};
+
+const struct hwdec_profile_entry *hwdec_find_profile(
+ struct lavc_ctx *ctx, const struct hwdec_profile_entry *table);
+bool hwdec_check_codec_support(const char *decoder,
+ const struct hwdec_profile_entry *table);
+int hwdec_get_max_refs(struct lavc_ctx *ctx);
+
// lavc_dr1.c
int mp_codec_get_buffer(AVCodecContext *s, AVFrame *frame);
void mp_codec_release_buffer(AVCodecContext *s, AVFrame *frame);