}
gboolean
-gst_va_vpp_register (GstPlugin * plugin, GstVaDevice * device, guint rank)
+gst_va_vpp_register (GstPlugin * plugin, GstVaDevice * device,
+ gboolean has_colorbalance, guint rank)
{
static GOnce debug_once = G_ONCE_INIT;
GType type;
type = g_type_register_static (GST_TYPE_VA_BASE_TRANSFORM, type_name,
&type_info, 0);
- {
- GstVaFilter *filter = gst_va_filter_new (device->display);
- if (gst_va_filter_open (filter)
- && gst_va_filter_has_filter (filter, VAProcFilterColorBalance)) {
- const GInterfaceInfo info = { gst_va_vpp_colorbalance_init, NULL, NULL };
- g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &info);
- }
- gst_object_unref (filter);
+ if (has_colorbalance) {
+ const GInterfaceInfo info = { gst_va_vpp_colorbalance_init, NULL, NULL };
+ g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &info);
}
ret = gst_element_register (plugin, feature_name, rank, type);
gboolean gst_va_vpp_register (GstPlugin * plugin,
GstVaDevice * device,
+ gboolean has_colorbalance,
guint rank);
G_END_DECLS
#include "config.h"
#endif
+#include "gstvaav1dec.h"
#include "gstvacaps.h"
#include "gstvadevice.h"
+#include "gstvafilter.h"
#include "gstvah264dec.h"
#include "gstvah265dec.h"
#include "gstvampeg2dec.h"
#include "gstvaprofile.h"
#include "gstvavp8dec.h"
#include "gstvavp9dec.h"
-#include "gstvaav1dec.h"
#include "gstvavpp.h"
#define GST_CAT_DEFAULT gstva_debug
static void
plugin_register_vpp (GstPlugin * plugin, GstVaDevice * device)
{
- if (!gst_va_vpp_register (plugin, device, GST_RANK_NONE))
+ GstVaFilter *filter;
+ gboolean has_colorbalance;
+
+ has_colorbalance = FALSE;
+ filter = gst_va_filter_new (device->display);
+ if (gst_va_filter_open (filter)) {
+ has_colorbalance =
+ gst_va_filter_has_filter (filter, VAProcFilterColorBalance);
+ } else {
+ GST_WARNING ("Failed open VA filter");
+ gst_object_unref (filter);
+ return;
+ }
+ gst_object_unref (filter);
+
+ if (!gst_va_vpp_register (plugin, device, has_colorbalance, GST_RANK_NONE))
GST_WARNING ("Failed to register postproc: %s", device->render_device_path);
}