*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("text/plain; text/x-pango-markup")
+ GST_STATIC_CAPS ("text/x-raw, format= { pango-markup, utf8 }")
);
break;
}
default:
- ret = gst_pad_peer_query (self->sinkpad, query);
+ ret = gst_pad_query_default (pad, parent, query);
break;
}
GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
&self->segment);
- self->next_offset = 0;
-
self->need_segment = TRUE;
} else {
GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
switch (format) {
case GST_SUB_PARSE_FORMAT_MDVDSUB:
self->parse_line = parse_mdvdsub;
- return gst_caps_new_empty_simple ("text/x-pango-markup");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "pango-markup", NULL);
case GST_SUB_PARSE_FORMAT_SUBRIP:
self->parse_line = parse_subrip;
- return gst_caps_new_empty_simple ("text/x-pango-markup");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "pango-markup", NULL);
case GST_SUB_PARSE_FORMAT_MPSUB:
self->parse_line = parse_mpsub;
- return gst_caps_new_empty_simple ("text/plain");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "utf8", NULL);
#ifndef GST_DISABLE_XML
case GST_SUB_PARSE_FORMAT_SAMI:
self->parse_line = parse_sami;
sami_context_init (&self->state);
- return gst_caps_new_empty_simple ("text/x-pango-markup");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "pango-markup", NULL);
#endif
case GST_SUB_PARSE_FORMAT_TMPLAYER:
self->parse_line = parse_tmplayer;
self->state.max_duration = 5 * GST_SECOND;
- return gst_caps_new_empty_simple ("text/plain");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "utf8", NULL);
case GST_SUB_PARSE_FORMAT_MPL2:
self->parse_line = parse_mpl2;
- return gst_caps_new_empty_simple ("text/x-pango-markup");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "pango-markup", NULL);
case GST_SUB_PARSE_FORMAT_DKS:
self->parse_line = parse_dks;
- return gst_caps_new_empty_simple ("text/plain");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "utf8", NULL);
case GST_SUB_PARSE_FORMAT_SUBVIEWER:
self->parse_line = parse_subviewer;
- return gst_caps_new_empty_simple ("text/plain");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "utf8", NULL);
case GST_SUB_PARSE_FORMAT_QTTEXT:
self->parse_line = parse_qttext;
qttext_context_init (&self->state);
- return gst_caps_new_empty_simple ("text/x-pango-markup");
+ return gst_caps_new_simple ("text/x-raw",
+ "format", G_TYPE_STRING, "pango-markup", NULL);
case GST_SUB_PARSE_FORMAT_UNKNOWN:
default:
GST_DEBUG ("no subtitle format detected");
* subtitles which are discontinuous by nature. */
}
- self->offset = GST_BUFFER_OFFSET (buf) + gst_buffer_get_size (buf);
- self->next_offset = self->offset;
+ self->offset += gst_buffer_get_size (buf);
gst_adapter_push (self->adapter, buf);
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* format detection will init the parser state */
self->offset = 0;
- self->next_offset = 0;
self->parser_type = GST_SUB_PARSE_FORMAT_UNKNOWN;
self->valid_utf8 = TRUE;
self->first_buffer = TRUE;
* otherwise convert as always */
if (!g_utf8_validate (str, 128, &end) && (end - str) < 120) {
gchar *converted_str;
- GError *err = NULL;
gsize tmp;
const gchar *enc;
enc = "ISO-8859-15";
}
}
- converted_str = gst_convert_to_utf8 (str, 128, enc, &tmp, &err);
+ converted_str = gst_convert_to_utf8 (str, 128, enc, &tmp, NULL);
if (converted_str != NULL) {
g_free (str);
str = converted_str;