guint zorder;
gboolean repeat_after_eos;
+ /* Subclasses can force an alpha channel in the (input thus output)
+ * colorspace format */
+ gboolean needs_alpha;
+
/* Converter, if NULL no conversion is done */
GstVideoConverter *convert;
return pad->priv->prepared_frame.buffer ? &pad->priv->prepared_frame : NULL;
}
+/**
+ * gst_video_aggregator_pad_set_needs_alpha:
+ * @pad: a #GstVideoAggregatorPad
+ * @needs_alpha: %TRUE if this pad requires alpha output
+ *
+ * Allows selecting that this pad requires an output format with alpha
+ *
+ * Returns: (transfer none): The currently prepared video frame
+ */
+void
+gst_video_aggregator_pad_set_needs_alpha (GstVideoAggregatorPad * pad,
+ gboolean needs_alpha)
+{
+ g_return_if_fail (GST_IS_VIDEO_AGGREGATOR_PAD (pad));
+
+ if (needs_alpha != pad->priv->needs_alpha) {
+ GstAggregator *agg =
+ GST_AGGREGATOR (gst_object_get_parent (GST_OBJECT (pad)));
+ pad->priv->needs_alpha = needs_alpha;
+ if (agg) {
+ gst_pad_mark_reconfigure (GST_AGGREGATOR_SRC_PAD (agg));
+ gst_object_unref (agg);
+ }
+ }
+}
+
/**************************************
* GstVideoAggregator implementation *
**************************************/
GINT_TO_POINTER (format_number));
/* If that pad is the first with alpha, set it as the new best format */
- if (!need_alpha && (pad->needs_alpha
+ if (!need_alpha && (pad->priv->needs_alpha
&& (!GST_VIDEO_FORMAT_INFO_HAS_ALPHA (pad->info.finfo)))) {
need_alpha = TRUE;
/* Just fallback to ARGB in case we require alpha but the input pad
/* read-only, with OBJECT_LOCK */
GstVideoInfo info;
- /* Subclasses can force an alpha channel in the (input thus output)
- * colorspace format */
- gboolean needs_alpha;
-
/* < private > */
GstVideoAggregatorPadPrivate *priv;
GST_VIDEO_BAD_API
GstVideoFrame * gst_video_aggregator_pad_get_prepared_frame (GstVideoAggregatorPad *pad);
+GST_VIDEO_BAD_API
+void gst_video_aggregator_pad_set_needs_alpha (GstVideoAggregatorPad *pad, gboolean needs_alpha);
+
#define GST_TYPE_VIDEO_AGGREGATOR (gst_video_aggregator_get_type())
#define GST_VIDEO_AGGREGATOR(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_AGGREGATOR, GstVideoAggregator))
break;
case PROP_PAD_CROSSFADE_RATIO:
pad->crossfade = g_value_get_double (value);
- GST_VIDEO_AGGREGATOR_PAD (pad)->needs_alpha = pad->crossfade >= 0.0f;
+ gst_video_aggregator_pad_set_needs_alpha (GST_VIDEO_AGGREGATOR_PAD (pad),
+ pad->crossfade >= 0.0f);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);