summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2022-01-31 13:03:10 -0800
committerJan Ekström <jeebjp@gmail.com>2022-02-06 14:40:18 +0200
commit240340d60a625db12fb957deadac89a197c50844 (patch)
treeb80579efedddd1144ad3b6d215a2e1d590876880 /video/out
parent83f1c87676f43bcf65be46fc24c1198cfe413382 (diff)
downloadmpv-240340d60a625db12fb957deadac89a197c50844.tar.bz2
mpv-240340d60a625db12fb957deadac89a197c50844.tar.xz
vo_gpu: hwdec_vaapi: Don't probe formats for irrelevant endpoints
While testing support for the exotic formats used by Intel vaapi for 4:2:2 and 4:4:4 surfaces, I realised that we were enumerating all endpoints and checking formats for them. The problem with this is that decoding (VLD) endpoints are only a subset of what vaapi exposes. All the encoding endpoints are there too, and there is also the None profile that we don't care about, but which generates ffmpeg warnings if you try and examine it. So, let's only look at VLD endpoints. This will speed things up a little bit and make the logging less noisy.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/hwdec/hwdec_vaapi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/video/out/hwdec/hwdec_vaapi.c b/video/out/hwdec/hwdec_vaapi.c
index 2a8e1811eb..7f3fb5ed25 100644
--- a/video/out/hwdec/hwdec_vaapi.c
+++ b/video/out/hwdec/hwdec_vaapi.c
@@ -362,6 +362,10 @@ static void determine_working_formats(struct ra_hwdec *hw)
for (int n = 0; n < num_profiles; n++) {
VAProfile profile = profiles[n];
+ if (profile == VAProfileNone) {
+ // We don't use the None profile.
+ continue;
+ }
int num_ep = 0;
status = vaQueryConfigEntrypoints(p->display, profile, entrypoints,
&num_ep);
@@ -371,6 +375,10 @@ static void determine_working_formats(struct ra_hwdec *hw)
continue;
}
for (int ep = 0; ep < num_ep; ep++) {
+ if (entrypoints[ep] != VAEntrypointVLD) {
+ // We are only interested in decoding entrypoints.
+ continue;
+ }
VAConfigID config = VA_INVALID_ID;
status = vaCreateConfig(p->display, profile, entrypoints[ep],
NULL, 0, &config);