mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 19:55:32 +00:00
discoverer: Consider closedcaption/ as subtitles and improve subtitle caps detection
Generally all subtitle/, subpicture/, text/, closedcaption/ and application/x-subtitle caps instead of hardcoding a small set of caps. https://bugzilla.gnome.org/show_bug.cgi?id=797072
This commit is contained in:
parent
595dd27ede
commit
14031f1c63
1 changed files with 17 additions and 4 deletions
|
@ -544,17 +544,30 @@ _event_probe (GstPad * pad, GstPadProbeInfo * info, PrivateStream * ps)
|
||||||
return GST_PAD_PROBE_OK;
|
return GST_PAD_PROBE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStaticCaps subtitle_caps = GST_STATIC_CAPS ("text/x-raw; "
|
static GstStaticCaps subtitle_caps =
|
||||||
"subpicture/x-pgs; subpicture/x-dvb; subpicture/x-dvd; "
|
GST_STATIC_CAPS
|
||||||
"application/x-subtitle-unknown; application/x-ssa; application/x-ass; "
|
("application/x-ssa; application/x-ass; application/x-kate");
|
||||||
"subtitle/x-kate; application/x-kate; subpicture/x-xsub");
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_subtitle_caps (const GstCaps * caps)
|
is_subtitle_caps (const GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstCaps *subs_caps;
|
GstCaps *subs_caps;
|
||||||
|
GstStructure *s;
|
||||||
|
const gchar *name;
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
|
|
||||||
|
s = gst_caps_get_structure (caps, 0);
|
||||||
|
if (!s)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
name = gst_structure_get_name (s);
|
||||||
|
if (g_str_has_prefix (name, "text/") ||
|
||||||
|
g_str_has_prefix (name, "subpicture/") ||
|
||||||
|
g_str_has_prefix (name, "subtitle/") ||
|
||||||
|
g_str_has_prefix (name, "closedcaption/") ||
|
||||||
|
g_str_has_prefix (name, "application/x-subtitle"))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
subs_caps = gst_static_caps_get (&subtitle_caps);
|
subs_caps = gst_static_caps_get (&subtitle_caps);
|
||||||
ret = gst_caps_can_intersect (caps, subs_caps);
|
ret = gst_caps_can_intersect (caps, subs_caps);
|
||||||
gst_caps_unref (subs_caps);
|
gst_caps_unref (subs_caps);
|
||||||
|
|
Loading…
Reference in a new issue