videoaggregator: Move property storage to private pad struct

This commit is contained in:
Sebastian Dröge 2018-05-04 17:18:12 +02:00
parent 10b7b13732
commit e9e98715b0
2 changed files with 16 additions and 15 deletions

View file

@ -65,6 +65,10 @@ enum
struct _GstVideoAggregatorPadPrivate struct _GstVideoAggregatorPadPrivate
{ {
/* properties */
guint zorder;
gboolean repeat_after_eos;
/* Converter, if NULL no conversion is done */ /* Converter, if NULL no conversion is done */
GstVideoConverter *convert; GstVideoConverter *convert;
@ -90,10 +94,10 @@ gst_video_aggregator_pad_get_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_PAD_ZORDER: case PROP_PAD_ZORDER:
g_value_set_uint (value, pad->zorder); g_value_set_uint (value, pad->priv->zorder);
break; break;
case PROP_PAD_REPEAT_AFTER_EOS: case PROP_PAD_REPEAT_AFTER_EOS:
g_value_set_boolean (value, pad->repeat_after_eos); g_value_set_boolean (value, pad->priv->repeat_after_eos);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -105,7 +109,7 @@ static int
pad_zorder_compare (const GstVideoAggregatorPad * pad1, pad_zorder_compare (const GstVideoAggregatorPad * pad1,
const GstVideoAggregatorPad * pad2) const GstVideoAggregatorPad * pad2)
{ {
return pad1->zorder - pad2->zorder; return pad1->priv->zorder - pad2->priv->zorder;
} }
static void static void
@ -119,13 +123,13 @@ gst_video_aggregator_pad_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_PAD_ZORDER: case PROP_PAD_ZORDER:
GST_OBJECT_LOCK (vagg); GST_OBJECT_LOCK (vagg);
pad->zorder = g_value_get_uint (value); pad->priv->zorder = g_value_get_uint (value);
GST_ELEMENT (vagg)->sinkpads = g_list_sort (GST_ELEMENT (vagg)->sinkpads, GST_ELEMENT (vagg)->sinkpads = g_list_sort (GST_ELEMENT (vagg)->sinkpads,
(GCompareFunc) pad_zorder_compare); (GCompareFunc) pad_zorder_compare);
GST_OBJECT_UNLOCK (vagg); GST_OBJECT_UNLOCK (vagg);
break; break;
case PROP_PAD_REPEAT_AFTER_EOS: case PROP_PAD_REPEAT_AFTER_EOS:
pad->repeat_after_eos = g_value_get_boolean (value); pad->priv->repeat_after_eos = g_value_get_boolean (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -361,10 +365,10 @@ gst_video_aggregator_pad_init (GstVideoAggregatorPad * vaggpad)
G_TYPE_INSTANCE_GET_PRIVATE (vaggpad, GST_TYPE_VIDEO_AGGREGATOR_PAD, G_TYPE_INSTANCE_GET_PRIVATE (vaggpad, GST_TYPE_VIDEO_AGGREGATOR_PAD,
GstVideoAggregatorPadPrivate); GstVideoAggregatorPadPrivate);
vaggpad->zorder = DEFAULT_PAD_ZORDER; vaggpad->priv->zorder = DEFAULT_PAD_ZORDER;
vaggpad->repeat_after_eos = DEFAULT_PAD_REPEAT_AFTER_EOS; vaggpad->priv->repeat_after_eos = DEFAULT_PAD_REPEAT_AFTER_EOS;
vaggpad->aggregated_frame = NULL;
vaggpad->priv->converted_buffer = NULL; vaggpad->priv->converted_buffer = NULL;
vaggpad->aggregated_frame = NULL;
vaggpad->priv->convert = NULL; vaggpad->priv->convert = NULL;
} }
@ -1201,7 +1205,7 @@ gst_video_aggregator_fill_queues (GstVideoAggregator * vagg,
continue; continue;
} }
} else { } else {
if (is_eos && pad->repeat_after_eos) { if (is_eos && pad->priv->repeat_after_eos) {
eos = FALSE; eos = FALSE;
GST_DEBUG_OBJECT (pad, "ignoring EOS and re-using previous buffer"); GST_DEBUG_OBJECT (pad, "ignoring EOS and re-using previous buffer");
continue; continue;
@ -1846,7 +1850,7 @@ gst_video_aggregator_request_new_pad (GstElement * element,
return NULL; return NULL;
GST_OBJECT_LOCK (vagg); GST_OBJECT_LOCK (vagg);
vaggpad->zorder = GST_ELEMENT (vagg)->numsinkpads; vaggpad->priv->zorder = GST_ELEMENT (vagg)->numsinkpads;
vaggpad->priv->start_time = -1; vaggpad->priv->start_time = -1;
vaggpad->priv->end_time = -1; vaggpad->priv->end_time = -1;
element->sinkpads = g_list_sort (element->sinkpads, element->sinkpads = g_list_sort (element->sinkpads,

View file

@ -67,16 +67,13 @@ struct _GstVideoAggregatorPad
{ {
GstAggregatorPad parent; GstAggregatorPad parent;
/*< public >*/
/* read-only, with OBJECT_LOCK */
GstVideoInfo info; GstVideoInfo info;
GstBuffer *buffer; GstBuffer *buffer;
GstVideoFrame *aggregated_frame; GstVideoFrame *aggregated_frame;
/* properties */
guint zorder;
gboolean repeat_after_eos;
/* Subclasses can force an alpha channel in the (input thus output) /* Subclasses can force an alpha channel in the (input thus output)
* colorspace format */ * colorspace format */
gboolean needs_alpha; gboolean needs_alpha;