gboolean mute;
gchar *font_desc; /* font description */
guint connection_speed; /* connection speed in bits/sec (0 = unknown) */
+ gint count;
};
struct _GstPlaySinkClass
GstPad *res = NULL;
gboolean created = FALSE;
gboolean raw = FALSE;
+ gboolean activate = TRUE;
GST_DEBUG_OBJECT (playsink, "request pad type %d", type);
}
res = playsink->text_pad;
break;
+ case GST_PLAY_SINK_TYPE_FLUSHING:
+ {
+ gchar *padname;
+
+ /* we need a unique padname for the flushing pad. */
+ padname = g_strdup_printf ("flushing_%d", playsink->count);
+ res = gst_ghost_pad_new_no_target (padname, GST_PAD_SINK);
+ g_free (padname);
+ playsink->count++;
+ activate = FALSE;
+ created = TRUE;
+ break;
+ }
default:
res = NULL;
break;
GST_PLAY_SINK_UNLOCK (playsink);
if (created && res) {
+ /* we have to add the pad when it's active or we get an error when the
+ * element is 'running' */
gst_pad_set_active (res, TRUE);
gst_element_add_pad (GST_ELEMENT_CAST (playsink), res);
+ if (!activate)
+ gst_pad_set_active (res, activate);
}
return res;
res = &playsink->audio_pad;
} else if (pad == playsink->text_pad) {
res = &playsink->text_pad;
+ } else {
+ /* try to release the given pad anyway, these could be the FLUSHING pads. */
+ res = &pad;
}
GST_PLAY_SINK_UNLOCK (playsink);
* @GST_PLAY_SINK_TYPE_VIDEO_RAW: a raw video pad
* @GST_PLAY_SINK_TYPE_TEXT: a raw text pad
* @GST_PLAY_SINK_TYPE_LAST: the last type
+ * @GST_PLAY_SINK_TYPE_FLUSHING: a flushing pad, used when shutting down
*
* Types of pads that can be requested from the sinks.
*/
GST_PLAY_SINK_TYPE_VIDEO = 2,
GST_PLAY_SINK_TYPE_VIDEO_RAW = 3,
GST_PLAY_SINK_TYPE_TEXT = 4,
- GST_PLAY_SINK_TYPE_LAST = 5
+ GST_PLAY_SINK_TYPE_LAST = 5,
+ GST_PLAY_SINK_TYPE_FLUSHING = 6
} GstPlaySinkType;
typedef struct _GstPlaySink GstPlaySink;