MMFMWK-7954 waylandsink: propose vsi modifier to vpu
propose vsi modifiers to vpu to support DTRC in dcss,
default will disable this feature. Can enable by set
property enable-tile to true.
diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
index 73f8315..bbab8de 100644
--- a/ext/wayland/gstwaylandsink.c
+++ b/ext/wayland/gstwaylandsink.c
@@ -75,7 +75,8 @@
PROP_WINDOW_WIDTH,
PROP_WINDOW_HEIGHT,
PROP_DISPLAY,
- PROP_ALPHA
+ PROP_ALPHA,
+ PROP_ENABLE_TILE
};
GST_DEBUG_CATEGORY (gstwayland_debug);
@@ -232,6 +233,11 @@
g_param_spec_float ("alpha", "Wayland surface alpha", "Wayland "
"surface alpha value, apply custom alpha value to wayland surface",
0.0f, 1.0f, 0.0f, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, PROP_ENABLE_TILE,
+ g_param_spec_boolean ("enable-tile", "enable hantro tile",
+ "When enabled, the sink propose VSI tile modifier to VPU", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT));
}
static void
@@ -245,6 +251,7 @@
g_cond_init (&sink->redraw_wait);
sink->frame_showed = 0;
sink->run_time = 0;
+ sink->enable_tile = FALSE;
}
static void
@@ -268,6 +275,9 @@
case PROP_ALPHA:
g_value_set_float (value, sink->alpha);
break;
+ case PROP_ENABLE_TILE:
+ g_value_set_boolean (value, sink->enable_tile);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -295,6 +305,9 @@
case PROP_ALPHA:
sink->alpha = g_value_get_float (value);
break;
+ case PROP_ENABLE_TILE:
+ sink->enable_tile = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -687,6 +700,15 @@
drm_modifier = DRM_FORMAT_MOD_AMPHION_TILED;
gst_query_add_allocation_dmabuf_meta (query, drm_modifier);
+ if (sink->enable_tile && HAS_DCSS()) {
+ drm_modifier = DRM_FORMAT_MOD_VSI_G1_TILED;
+ gst_query_add_allocation_dmabuf_meta (query, drm_modifier);
+ drm_modifier = DRM_FORMAT_MOD_VSI_G2_TILED;
+ gst_query_add_allocation_dmabuf_meta (query, drm_modifier);
+ drm_modifier = DRM_FORMAT_MOD_VSI_G2_TILED_COMPRESSED;
+ gst_query_add_allocation_dmabuf_meta (query, drm_modifier);
+ }
+
if (need_pool)
pool = gst_wayland_create_pool (sink, caps);
diff --git a/ext/wayland/gstwaylandsink.h b/ext/wayland/gstwaylandsink.h
index d675348..3b82977 100644
--- a/ext/wayland/gstwaylandsink.h
+++ b/ext/wayland/gstwaylandsink.h
@@ -77,6 +77,8 @@
/* fps print support */
guint64 frame_showed;
GstClockTime run_time;
+
+ gboolean enable_tile;
};
struct _GstWaylandSinkClass