From: <tp...@fr...> - 2006-02-18 17:24:29
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: tpm Date: Sat Feb 18 2006 09:21:00 PST Log message: * gst/matroska/matroska-demux.c: (gst_matroska_demux_subtitle_caps), (gst_matroska_demux_plugin_init): * gst/matroska/matroska-ids.h: Recognise SSA/ASS and USF subtitle formats and set proper caps when they are found. Modified files: . : ChangeLog gst/matroska : matroska-demux.c matroska-ids.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.2162&r2=1.2163 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/matroska/matroska-demux.c.diff?r1=1.66&r2=1.67 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/matroska/matroska-ids.h.diff?r1=1.15&r2=1.16 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.2162 retrieving revision 1.2163 diff -u -d -r1.2162 -r1.2163 --- ChangeLog 17 Feb 2006 17:54:05 -0000 1.2162 +++ ChangeLog 18 Feb 2006 17:20:47 -0000 1.2163 @@ -1,3 +1,12 @@ +2006-02-18 Tim-Philipp Müller <tim at centricular dot net> + + * gst/matroska/matroska-demux.c: + (gst_matroska_demux_subtitle_caps), + (gst_matroska_demux_plugin_init): + * gst/matroska/matroska-ids.h: + Recognise SSA/ASS and USF subtitle formats and + set proper caps when they are found. 2006-02-17 Tim-Philipp Müller <tim at centricular dot net> * ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_decode_direct), Index: matroska-demux.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-demux.c,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- matroska-demux.c 14 Feb 2006 23:23:08 -0000 1.66 +++ matroska-demux.c 18 Feb 2006 17:20:48 -0000 1.67 @@ -3408,13 +3408,38 @@ (GstMatroskaTrackContext *) subtitlecontext; */ GstCaps *caps = NULL; + /* for backwards compatibility */ + if (!g_ascii_strcasecmp (codec_id, "S_TEXT/ASCII")) + codec_id = GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8; + else if (!g_ascii_strcasecmp (codec_id, "S_SSA")) + codec_id = GST_MATROSKA_CODEC_ID_SUBTITLE_SSA; + else if (!g_ascii_strcasecmp (codec_id, "S_ASS")) + codec_id = GST_MATROSKA_CODEC_ID_SUBTITLE_ASS; + else if (!g_ascii_strcasecmp (codec_id, "S_USF")) + codec_id = GST_MATROSKA_CODEC_ID_SUBTITLE_USF; if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8)) { caps = gst_caps_new_simple ("text/plain", NULL); + } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_SUBTITLE_SSA)) { + caps = gst_caps_new_simple ("application/x-ssa", NULL); + } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_SUBTITLE_ASS)) { + caps = gst_caps_new_simple ("application/x-ass", NULL); + } else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_SUBTITLE_USF)) { + caps = gst_caps_new_simple ("application/x-usf", NULL); } else { GST_DEBUG ("Unknown subtitle stream: codec_id='%s'", codec_id); caps = gst_caps_new_simple ("application/x-subtitle-unknown", NULL); } + if (data != NULL && size > 0) { + GstBuffer *buf; + buf = gst_buffer_new_and_alloc (size); + memcpy (GST_BUFFER_DATA (buf), data, size); + gst_caps_set_simple (caps, "codec_data", GST_TYPE_BUFFER, buf, NULL); + gst_buffer_unref (buf); + } return caps; } @@ -3501,6 +3526,9 @@ }; const gchar *subtitle_id[] = { GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8, + GST_MATROSKA_CODEC_ID_SUBTITLE_SSA, + GST_MATROSKA_CODEC_ID_SUBTITLE_ASS, + GST_MATROSKA_CODEC_ID_SUBTITLE_USF, /* FILLME */ NULL Index: matroska-ids.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/matroska/matroska-ids.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- matroska-ids.h 23 Jan 2006 18:39:31 -0000 1.15 +++ matroska-ids.h 18 Feb 2006 17:20:48 -0000 1.16 @@ -168,6 +168,9 @@ /* TODO: AC3-9/10 (?), Musepack, Quicktime */ #define GST_MATROSKA_CODEC_ID_SUBTITLE_UTF8 "S_TEXT/UTF8" +#define GST_MATROSKA_CODEC_ID_SUBTITLE_SSA "S_TEXT/SSA" +#define GST_MATROSKA_CODEC_ID_SUBTITLE_ASS "S_TEXT/ASS" +#define GST_MATROSKA_CODEC_ID_SUBTITLE_USF "S_TEXT/USF" /* * Matrodka tags. Strings. |