gst_pad_push_event (ogm->srcpad, event);
}
g_list_free (cached_events);
+
+ {
+ GstTagList *tags;
+
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_SUBTITLE_CODEC,
+ "Ogm", NULL);
+ gst_element_found_tags_for_pad (GST_ELEMENT (ogm), ogm->srcpad, tags);
+ }
}
gst_caps_unref (caps);
parse->ini = NULL;
parse->framed = FALSE;
+ parse->send_tags = FALSE;
}
static void
}
parse->framed = TRUE;
+ parse->send_tags = TRUE;
priv = (GstBuffer *) gst_value_get_mini_object (val);
g_return_val_if_fail (priv != NULL, FALSE);
if (G_UNLIKELY (!parse->framed))
goto not_framed;
+ if (G_UNLIKELY (parse->send_tags)) {
+ GstTagList *tags;
+
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_SUBTITLE_CODEC,
+ "SubStation Alpha", NULL);
+ gst_element_found_tags_for_pad (GST_ELEMENT (parse), parse->srcpad, tags);
+ parse->send_tags = FALSE;
+ }
+
/* make double-sure it's 0-terminated and all */
txt = g_strndup ((gchar *) GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
GST_OBJECT_UNLOCK (subparse);
}
+static gchar *
+gst_sub_parse_get_format_description (GstSubParseFormat format)
+{
+ switch (format) {
+ case GST_SUB_PARSE_FORMAT_MDVDSUB:
+ return "MicroDVD";
+ case GST_SUB_PARSE_FORMAT_SUBRIP:
+ return "SubRip";
+ case GST_SUB_PARSE_FORMAT_MPSUB:
+ return "MPSub";
+ case GST_SUB_PARSE_FORMAT_SAMI:
+ return "SAMI";
+ case GST_SUB_PARSE_FORMAT_TMPLAYER:
+ return "TMPlayer";
+ case GST_SUB_PARSE_FORMAT_MPL2:
+ return "MPL2";
+ case GST_SUB_PARSE_FORMAT_SUBVIEWER:
+ return "SubViewer";
+ default:
+ case GST_SUB_PARSE_FORMAT_UNKNOWN:
+ break;
+ }
+ return NULL;
+}
+
static gchar *
gst_convert_to_utf8 (const gchar * str, gsize len, const gchar * encoding,
gsize * consumed, GError ** err)
g_free (data);
self->parser_type = format;
+ self->subtitle_codec = gst_sub_parse_get_format_description (format);
parser_state_init (&self->state);
switch (format) {
return GST_FLOW_UNEXPECTED;
}
gst_caps_unref (caps);
+
+ /* push tags */
+ if (self->subtitle_codec != NULL) {
+ GstTagList *tags;
+
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_SUBTITLE_CODEC,
+ self->subtitle_codec, NULL);
+ gst_element_found_tags_for_pad (GST_ELEMENT (self), self->srcpad, tags);
+ }
}
while (!self->flushing && (line = get_next_line (self))) {