#include "gstvaapiprofile.h"
typedef struct _GstVaapiProfileMap GstVaapiProfileMap;
+typedef struct _GstVaapiEntrypointMap GstVaapiEntrypointMap;
struct _GstVaapiProfileMap {
GstVaapiProfile profile;
const char *caps_str;
};
+struct _GstVaapiEntrypointMap {
+ GstVaapiEntrypoint entrypoint;
+ VAEntrypoint va_entrypoint;
+};
+
/* Profiles */
static const GstVaapiProfileMap gst_vaapi_profiles[] = {
{ GST_VAAPI_PROFILE_MPEG2_SIMPLE, VAProfileMPEG2Simple,
{ 0, }
};
+/* Entry-points */
+static const GstVaapiEntrypointMap gst_vaapi_entrypoints[] = {
+ { GST_VAAPI_ENTRYPOINT_VLD, VAEntrypointVLD },
+ { GST_VAAPI_ENTRYPOINT_IDCT, VAEntrypointIDCT },
+ { GST_VAAPI_ENTRYPOINT_MOCO, VAEntrypointMoComp },
+ { 0, }
+};
+
static const GstVaapiProfileMap *
-get_map(GstVaapiProfile profile)
+get_profiles_map(GstVaapiProfile profile)
{
const GstVaapiProfileMap *m;
return NULL;
}
+static const GstVaapiEntrypointMap *
+get_entrypoints_map(GstVaapiEntrypoint entrypoint)
+{
+ const GstVaapiEntrypointMap *m;
+
+ for (m = gst_vaapi_entrypoints; m->entrypoint; m++)
+ if (m->entrypoint == entrypoint)
+ return m;
+ return NULL;
+}
+
/**
* gst_vaapi_profile:
- * @va_profile: a #VAProfile
+ * @profile: a #VAProfile
*
- * Converts a VA profile into the corresponding #GstVaapiProfile. If the profile cannot be represented by #GstVaapiProfile, then zero is returned.
+ * Converts a VA profile into the corresponding #GstVaapiProfile. If
+ * the profile cannot be represented by #GstVaapiProfile, then zero is
+ * returned.
*
- * Return value: the #GstVaapiProfile describing the @va_profile
+ * Return value: the #GstVaapiProfile describing the @profile
*/
GstVaapiProfile
gst_vaapi_profile(VAProfile profile)
VAProfile
gst_vaapi_profile_get_va_profile(GstVaapiProfile profile)
{
- const GstVaapiProfileMap * const m = get_map(profile);
+ const GstVaapiProfileMap * const m = get_profiles_map(profile);
return m ? m->va_profile : (VAProfile)-1;
}
GstCaps *
gst_vaapi_profile_get_caps(GstVaapiProfile profile)
{
- const GstVaapiProfileMap * const m = get_map(profile);
+ const GstVaapiProfileMap * const m = get_profiles_map(profile);
return m ? gst_caps_from_string(m->caps_str) : NULL;
}
{
return (GstVaapiCodec)(((guint32)profile) & 0xffffff00);
}
+
+/**
+ * gst_vaapi_entrypoint:
+ * @entryprofile: a #VAEntrypoint
+ *
+ * Converts a VA entry-point into the corresponding #GstVaapiEntrypoint.
+ * If the entry-point cannot be represented by #GstVaapiEntrypoint,
+ * then zero is returned.
+ *
+ * Return value: the #GstVaapiEntrypoint describing the @entrypoint
+ */
+GstVaapiEntrypoint
+gst_vaapi_entrypoint(VAEntrypoint entrypoint)
+{
+ const GstVaapiEntrypointMap *m;
+
+ for (m = gst_vaapi_entrypoints; m->entrypoint; m++)
+ if (m->va_entrypoint == entrypoint)
+ return m->entrypoint;
+ return 0;
+}
+
+/**
+ * gst_vaapi_entrypoint_get_va_entrypoint:
+ * @entrypoint: a #GstVaapiEntrypoint
+ *
+ * Converts a #GstVaapiEntrypoint into the corresponding VA
+ * entry-point. If no matching VA entry-point was found, -1 is
+ * returned and this error must be reported to be fixed.
+ *
+ * Return value: the VA entry-point, or -1 if none was found
+ */
+VAEntrypoint
+gst_vaapi_entrypoint_get_va_entrypoint(GstVaapiEntrypoint entrypoint)
+{
+ const GstVaapiEntrypointMap * const m = get_entrypoints_map(entrypoint);
+
+ return m ? m->va_entrypoint : (VAEntrypoint)-1;
+}
typedef enum _GstVaapiCodec GstVaapiCodec;
typedef enum _GstVaapiProfile GstVaapiProfile;
+typedef enum _GstVaapiEntrypoint GstVaapiEntrypoint;
/**
* GstVaapiCodec:
* @GST_VAAPI_PROFILE_VC1_ADVANCED:
* VC-1 advanced profile
*
- * The set of all profile for #GstVaapiProfile.
+ * The set of all profiles for #GstVaapiProfile.
*/
enum _GstVaapiProfile {
GST_VAAPI_PROFILE_MPEG1 = GST_VAAPI_CODEC_MPEG1|1,
GST_VAAPI_PROFILE_VC1_ADVANCED = GST_VAAPI_CODEC_VC1|3,
};
+/**
+ * GstVaapiEntrypoint:
+ * @GST_VAAPI_ENTRYPOINT_VLD: Variable Length Decoding
+ * @GST_VAAPI_ENTRYPOINT_IDCT: Inverse Decrete Cosine Transform
+ * @GST_VAAPI_ENTRYPOINT_MOCO: Motion Compensation
+ *
+ * The set of all entrypoints for #GstVaapiEntrypoint
+ */
+enum _GstVaapiEntrypoint {
+ GST_VAAPI_ENTRYPOINT_VLD = 1,
+ GST_VAAPI_ENTRYPOINT_IDCT,
+ GST_VAAPI_ENTRYPOINT_MOCO
+};
+
GstVaapiProfile
gst_vaapi_profile(VAProfile profile);
GstVaapiCodec
gst_vaapi_profile_get_codec(GstVaapiProfile profile);
+GstVaapiEntrypoint
+gst_vaapi_entrypoint(VAEntrypoint entrypoint);
+
+VAEntrypoint
+gst_vaapi_entrypoint_get_va_entrypoint(GstVaapiEntrypoint entrypoint);
+
G_END_DECLS
#endif /* GST_GST_VAAPI_IMAGE_H */