summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-01-12 18:52:14 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2014-01-13 17:31:55 +0100
commit850a637d0f21b750a37fe836f0dc123c4a826dd9 (patch)
treee36d1656a911a20990b5a741cea8c3943b6ca7b1 /gst-libs/gst/vaapi/gstvaapiencoder_priv.h
parent59229b20a5965081a210296122efe34e71d9d79f (diff)
encoder: filter out the supported set of rate-control properties.
Only expose the exact static set of supported rate-control properties to the upper layer. For instance, if the GstVaapiEncoderXXX class does only support CQP rate control, then only add it the the exposed enum type. Add helper macros and functions to build a GType for an enum subset.
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapiencoder_priv.h')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_priv.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
index d473a050..81549d58 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_priv.h
@@ -27,6 +27,7 @@
#include <gst/vaapi/gstvaapicontext.h>
#include <gst/vaapi/gstvaapivideopool.h>
#include <gst/video/gstvideoutils.h>
+#include <gst/vaapi/gstvaapivalue.h>
G_BEGIN_DECLS
@@ -197,13 +198,21 @@ struct _GstVaapiEncoderClassData
/*< private >*/
GstVaapiCodec codec;
+ GType (*rate_control_get_type)(void);
GstVaapiRateControl default_rate_control;
guint32 rate_control_mask;
};
#define GST_VAAPI_ENCODER_DEFINE_CLASS_DATA(CODEC) \
+ GST_VAAPI_TYPE_DEFINE_ENUM_SUBSET_FROM_MASK( \
+ G_PASTE (GstVaapiRateControl, CODEC), \
+ G_PASTE (gst_vaapi_rate_control_, CODEC), \
+ GST_VAAPI_TYPE_RATE_CONTROL, SUPPORTED_RATECONTROLS); \
+ \
static const GstVaapiEncoderClassData g_class_data = { \
.codec = G_PASTE (GST_VAAPI_CODEC_, CODEC), \
+ .rate_control_get_type = \
+ G_PASTE (G_PASTE (gst_vaapi_rate_control_, CODEC), _get_type), \
.default_rate_control = DEFAULT_RATECONTROL, \
.rate_control_mask = SUPPORTED_RATECONTROLS, \
}