+/*****************************************************************************
+ * Module capabilities.
+ *****************************************************************************/
+static __inline__ char *GetCapabilityName( unsigned int i_capa )
+{
+ /* The sole purpose of this inline function and the ugly #defines
+ * around it is to avoid having two places to modify when adding a
+ * new capability. */
+ static char *pp_capa[] =
+ {
+ "interface",
+#define MODULE_CAPABILITY_INTF 0 /* Interface */
+ "access",
+#define MODULE_CAPABILITY_ACCESS 1 /* Input */
+ "input",
+#define MODULE_CAPABILITY_INPUT 2 /* Input */
+ "decaps",
+#define MODULE_CAPABILITY_DECAPS 3 /* Decaps */
+ "decoder",
+#define MODULE_CAPABILITY_DECODER 4 /* Audio or video decoder */
+ "motion",
+#define MODULE_CAPABILITY_MOTION 5 /* Motion compensation */
+ "iDCT",
+#define MODULE_CAPABILITY_IDCT 6 /* IDCT transformation */
+ "audio output",
+#define MODULE_CAPABILITY_AOUT 7 /* Audio output */
+ "video output",
+#define MODULE_CAPABILITY_VOUT 8 /* Video output */
+ "chroma transformation",
+#define MODULE_CAPABILITY_CHROMA 9 /* colorspace conversion */
+ "iMDCT",
+#define MODULE_CAPABILITY_IMDCT 10 /* IMDCT transformation */
+ "downmix",
+#define MODULE_CAPABILITY_DOWNMIX 11 /* AC3 downmix */
+ "memcpy",
+#define MODULE_CAPABILITY_MEMCPY 12 /* memcpy */
+ "unknown"
+#define MODULE_CAPABILITY_MAX 13 /* Total number of capabilities */
+ };
+
+ return pp_capa[ (i_capa) > MODULE_CAPABILITY_MAX ? MODULE_CAPABILITY_MAX :
+ (i_capa) ];
+}
+