GST_DEBUG_OBJECT (chain->ogg,
"creating new stream %08x in chain %p", serialno, chain);
- ret = g_object_new (GST_TYPE_OGG_PAD, NULL);
+ name = g_strdup_printf ("serial_%08x", serialno);
+ ret = g_object_new (GST_TYPE_OGG_PAD, "name", name, NULL);
+ g_free (name);
/* we own this one */
- gst_object_ref (ret);
- gst_object_sink (ret);
+ gst_object_ref_sink (ret);
GST_PAD_DIRECTION (ret) = GST_PAD_SRC;
gst_ogg_pad_mark_discont (ret);
"align with prev sample, ABS (%" G_GINT64_FORMAT ") < %"
G_GINT64_FORMAT, align, maxdrift);
} else {
+ gint64 diff_s G_GNUC_UNUSED;
+
/* calculate sample diff in seconds for error message */
- gint64 diff_s = gst_util_uint64_scale_int (diff, GST_SECOND, rate);
- diff_s = gst_util_uint64_scale_int (diff, GST_SECOND, ringbuf->spec.rate);
++ diff_s = gst_util_uint64_scale_int (diff, GST_SECOND, rate);
+
/* timestamps drifted apart from previous samples too much, we need to
* resync. We log this as an element warning. */
GST_WARNING_OBJECT (sink,
}
}
- _pad_blocked_cb, gst_object_ref (self),
- (GDestroyNotify) gst_object_unref);
+static GstProbeReturn
+_pad_blocked_cb (GstPad * pad, GstProbeType type, gpointer type_data,
+ gpointer user_data);
+
+static void
+block_video (GstSubtitleOverlay * self)
+{
+ if (self->video_block_id != 0)
+ return;
+
+ if (self->video_block_pad) {
+ self->video_block_id =
+ gst_pad_add_probe (self->video_block_pad, GST_PROBE_TYPE_BLOCK,
- _pad_blocked_cb, gst_object_ref (self),
- (GDestroyNotify) gst_object_unref);
++ _pad_blocked_cb, self, NULL);
+ }
+}
+
+static void
+unblock_video (GstSubtitleOverlay * self)
+{
+ if (self->video_block_id) {
+ gst_pad_remove_probe (self->video_block_pad, self->video_block_id);
+ self->video_sink_blocked = FALSE;
+ self->video_block_id = 0;
+ }
+}
+
+static void
+block_subtitle (GstSubtitleOverlay * self)
+{
+ if (self->subtitle_block_id != 0)
+ return;
+
+ if (self->subtitle_block_pad) {
+ self->subtitle_block_id =
+ gst_pad_add_probe (self->subtitle_block_pad, GST_PROBE_TYPE_BLOCK,
++ _pad_blocked_cb, self, NULL);
+ }
+}
+
+static void
+unblock_subtitle (GstSubtitleOverlay * self)
+{
+ if (self->subtitle_block_id) {
+ gst_pad_remove_probe (self->subtitle_block_pad, self->subtitle_block_id);
+ self->subtitle_sink_blocked = FALSE;
+ self->subtitle_block_id = 0;
+ }
+}
+
static void
gst_subtitle_overlay_finalize (GObject * object)
{
gst_object_unref (target);
/* Unblock pads */
- gst_pad_set_blocked_async_full (self->video_block_pad, FALSE,
- _pad_blocked_cb, self, NULL);
-
- if (self->subtitle_sink_blocked)
- gst_pad_set_blocked_async_full (self->subtitle_block_pad, FALSE,
- _pad_blocked_cb, self, NULL);
+ unblock_video (self);
+ unblock_subtitle (self);
-
goto out;
} else if (target) {
gst_object_unref (target);
templ = gst_static_pad_template_get (&video_sinktemplate);
self->video_sinkpad =
gst_ghost_pad_new_no_target_from_template ("video_sink", templ);
+ gst_object_unref (templ);
gst_pad_set_event_function (self->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_video_sink_event));
- gst_pad_set_setcaps_function (self->video_sinkpad,
- GST_DEBUG_FUNCPTR (gst_subtitle_overlay_video_sink_setcaps));
gst_pad_set_chain_function (self->video_sinkpad,
GST_DEBUG_FUNCPTR (gst_subtitle_overlay_video_sink_chain));