[Mesa-dev] [PATCH 03/15] st/va: implement vlVaQueryConfigEntrypoints
Christian König
deathsimple at vodafone.de
Tue Jun 18 02:27:33 PDT 2013
From: Christian König <christian.koenig at amd.com>
Signed-off-by: Christian König <christian.koenig at amd.com>
---
src/gallium/state_trackers/va/config.c | 13 +++++++++++++
src/gallium/state_trackers/va/va_private.h | 29 ++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 0060973..38639d0 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -55,11 +55,24 @@ VAStatus
vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
VAEntrypoint *entrypoint_list, int *num_entrypoints)
{
+ struct pipe_screen *pscreen;
+ enum pipe_video_profile p;
+
if (!ctx)
return VA_STATUS_ERROR_INVALID_CONTEXT;
*num_entrypoints = 0;
+ p = ProfileToPipe(profile);
+ if (p == PIPE_VIDEO_PROFILE_UNKNOWN)
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+
+ pscreen = VL_VA_PSCREEN(ctx);
+ if (!pscreen->get_video_param(pscreen, p, PIPE_VIDEO_CAP_SUPPORTED))
+ return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+
+ entrypoint_list[(*num_entrypoints)++] = VAEntrypointVLD;
+
return VA_STATUS_SUCCESS;
}
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index 5b432a8..cd6c7d7 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -69,6 +69,35 @@ PipeToProfile(enum pipe_video_profile profile)
}
}
+static inline enum pipe_video_profile
+ProfileToPipe(VAProfile profile)
+{
+ switch (profile) {
+ case VAProfileMPEG2Simple:
+ return PIPE_VIDEO_PROFILE_MPEG2_SIMPLE;
+ case VAProfileMPEG2Main:
+ return PIPE_VIDEO_PROFILE_MPEG2_MAIN;
+ case VAProfileMPEG4Simple:
+ return PIPE_VIDEO_PROFILE_MPEG4_SIMPLE;
+ case VAProfileMPEG4AdvancedSimple:
+ return PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE;
+ case VAProfileVC1Simple:
+ return PIPE_VIDEO_PROFILE_VC1_SIMPLE;
+ case VAProfileVC1Main:
+ return PIPE_VIDEO_PROFILE_VC1_MAIN;
+ case VAProfileVC1Advanced:
+ return PIPE_VIDEO_PROFILE_VC1_ADVANCED;
+ case VAProfileH264Baseline:
+ return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE;
+ case VAProfileH264Main:
+ return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN;
+ case VAProfileH264High:
+ return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
+ default:
+ return PIPE_VIDEO_PROFILE_UNKNOWN;
+ }
+}
+
typedef struct {
struct vl_screen *vscreen;
} vlVaDriver;
--
1.7.9.5
More information about the mesa-dev
mailing list