Commit graph

191 commits

Author SHA1 Message Date
Mathieu Duponchelle
caca46e0e6 subparse: convert from pango-markup to utf8 ..
when downstream requires it
2020-03-27 15:27:06 +00:00
Niels De Graef
7a36730fb4 subparse: Use G_DECLARE_FINAL_TYPE 2020-03-16 15:47:58 +00:00
Mathieu Duponchelle
0739fafd62 subparse: accept WebVTT timestamps without an hour component
https://www.w3.org/TR/webvtt1/#webvtt-timestamp

mm:ss,000 is a valid WebVTT timestamp
2020-03-11 05:44:23 +00:00
Tim-Philipp Müller
289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Thibault Saunier
909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Thibault Saunier
27ba8d24ec doc: Port to hotdoc 2019-05-13 11:34:08 -04:00
Antonio Ospite
1c454fdafc subparse: fix pushing WebVTT cue when last is not an empty line
If the last WebVTT cue does not have an empty line after it, or if it
does not end with a newline at all, it does not get pushed out and it
won't be displayed.

gst_sub_parse_sink_event() already handles the issue for other subtitle
formats, enable handling it for GST_SUB_PARSE_FORMAT_VTT too.

While at it also add a test for this case.
2019-05-06 13:28:02 +02:00
Jordan Petridis
5396ef6e45 subparse: do not assert when failing to parse subrip timestamp
If a badly formatted was passed into `parse_subrip_time` it would
assert instead of exiting gracefully. This is problematic since
the input is provided by the user, and will trigger a crash.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/532
2019-01-14 11:43:57 +00:00
Edward Hervey
3ac37bbe67 subparse: Don't read beyond array
If num_open_tags is 0, we shouldn't try to get the "last" open tag
since there isn't any.
2018-05-30 11:39:40 +02:00
Philippe Normand
b7e8d1657d subparse: follow-up build fix after d871b1205 2018-05-12 17:21:01 +01:00
Philippe Normand
8cfd85ec61 subparse: support for more than 32 unclosed markup tags
https://bugzilla.gnome.org/show_bug.cgi?id=796043
2018-05-12 17:05:06 +01:00
Xavier Claessens
201e7c7803 Meson: Generate pc file for all plugins in base
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:05:56 +01:00
Tim-Philipp Müller
3219b704fd subparse: fix pushing out of last chunk if last line has no newline
With playbin the last subtitle chunk would not get displayed
if the last chunk was missing a newline at the end. This is
because streamsynchronizer will hold back the EOS event until
the audio and video streams are finished too, so subparse
would never forcefully push out the last chunk until the very
end when it is too late.

We get a STREAM_GROUP_DONE event from streamsynchronizer however,
so handle that like EOS and force out any remaining text then.

https://bugzilla.gnome.org/show_bug.cgi?id=771853
2018-01-25 18:42:08 +00:00
Satya Prakash Gupta
075dac486f ssaparse: Fix buffer leak in error case
https://bugzilla.gnome.org/show_bug.cgi?id=785331
2017-07-24 11:56:50 +03:00
Mark Nauwelaerts
dac113a867 subparse: ensure serialized sending of segment event at proper time 2017-06-25 22:25:40 +02:00
Nicolas Dufresne
8e6c6266d7 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 13:42:07 -04:00
Sebastian Dröge
d894c19db6 samiparse: Check that the string has a non-zero length before overwriting the last byte with '\0'
https://bugzilla.gnome.org/show_bug.cgi?id=777502
2017-01-20 08:03:33 +02:00
Sebastian Dröge
d452ad0eca ssaparse: Free initialization section before storing the next one
If getting multiple caps events.

https://bugzilla.gnome.org/show_bug.cgi?id=775480
2016-12-01 19:57:47 +02:00
Nirbheek Chauhan
5c4f4ac1bd Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:09:51 +01:00
Tim-Philipp Müller
92786741df subparse: fix some leaks
Fixes check-valgrind for subparse test.
2016-07-19 13:26:06 +01:00
Víctor Manuel Jáquez Leal
c646c62a02 subparse: don't reset allowed tags
When a discont buffer is processed, the state is re-initialized, which
nullifies the allowed_tags.

The problem is when a subrip string with tags is processed and allowed_tags is
NULL. The function subrip_unescape_formatting() calls g_strjoinv with a
str_array as NULL, leading to a GLib-CRITICAL.

This patch removes the allowed_tags resetting, in parser_state_init(), but
move it into gst_sub_parse_format_autodetect().

https://bugzilla.gnome.org/show_bug.cgi?id=768525
2016-07-07 19:38:07 +02:00
Vincent Penquerc'h
d1ecd3cfa7 subparse: fix build with GCC 4.6.3
gstsubparse.c: In function ‘parse_subrip’:
gstsubparse.c:988:7: error: ignoring return value of ‘strtol’, declared with attribute warn_unused_result [-Werror=unused-result]
cc1: all warnings being treated as errors

https://bugzilla.gnome.org/show_bug.cgi?id=765042
2016-04-15 13:33:41 +01:00
Jan Schmidt
c27df799bf subparse: WebVTT Cue identifiers are optional
Don't require a cue identifier preceding the time range line
when parsing WebVTT. We could also store the CueID, but it's
not using anywhere, so just ignore it for now.
2016-04-06 21:00:10 +10:00
Jan Schmidt
1851777b94 subparse: Add more parsing guards
Insert extra checks for the validity of the incoming
data when parsing subrip/webvtt content and debug log
output for invalid content.

Should fix Coverity warnings.
2016-03-29 22:19:47 +11:00
Luis de Bethencourt
01778c5ac9 subparse: add missing break between formats
A break is missing at the end of case GST_SUB_PARSE_FORMAT_LRC or it will
fallthrough to WebVTT. This fixes commit fd2a14144a.
2016-03-29 11:27:40 +02:00
Jan Schmidt
fd2a14144a subparse: WebVTT parsing support
WebVTT is a new subtitle format for HTML5 video. In this first
version of the parser the cue settings are parsed but only stored in
the internal parser state structure. Later on these settings could be
part of the GstBuffer metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=629764
2016-03-25 00:58:42 +11:00
Vineeth TM
44b70ca3a1 base: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763075
2016-03-24 14:25:41 +02:00
Tim-Philipp Müller
7fb9cd453b subparse: detect closing tags even if there's a space after the slash
</ i> should be handled like </i>

https://bugzilla.gnome.org/show_bug.cgi?id=755875
2015-09-30 18:17:13 +01:00
Eunhae Choi
b1f78b5d23 subparse: use g_clear_error instead of g_error_free
To avoid invalid pointer accees the err pointer should be set to NULL.
By using g_clear_error() it calls free and clear the pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=753817
2015-08-19 16:21:25 +03:00
Tim-Philipp Müller
6020b0cf2b Update mailing list address from sourceforge to freedesktop 2015-07-16 17:17:16 +01:00
Sebastian Dröge
90eb93c2ef Don't compare booleans for equality to TRUE and FALSE
TRUE is 1, but every other non-zero value is also considered true. Comparing
for equality with TRUE would only consider 1 but not the others.
2014-12-01 09:51:12 +01:00
Sebastian Dröge
218d0702c9 subparse: Add support for parsing LRC subtitles
https://bugzilla.gnome.org/show_bug.cgi?id=678590
2013-12-18 15:52:53 +01:00
Sebastian Dröge
bc2342e4ad subparse: Add typefinder for LRC subtitles 2013-12-18 15:52:53 +01:00
Jihyun Cho
a81b2380cf subparse: fix null pointer access in sami parser
https://bugzilla.gnome.org/show_bug.cgi?id=712805
2013-11-21 16:34:04 +00:00
Tim-Philipp Müller
5d7125413e subparse: g_memmove() is deprecated
Just use plain memmove(), g_memmove() is deprecated in
recent GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=712811
2013-11-21 15:19:47 +00:00
Tim-Philipp Müller
7d16f95730 subparse: use g_strdup() and friends
Fixes build issue on windows, but is also better seeing that
these string are going to get freed with g_free() and not free().
2013-07-17 09:04:47 +01:00
Tim-Philipp Müller
3eea81e4a2 subparse: don't leak parse context for sami and qttext
In gst_sub_parse_dispose() parser_type will be UNKNOWN,
so these deinit calls were never executed. And we should
clean up the parser state in the downwards state change
anyway.
2013-07-16 18:31:46 +01:00
Young-Ho Cha
f597efe24b subparse: remove libxml dependency for sami parser and re-enable sami parser
To celebrate 2013.gnome.asia, updated sami parser for gstreamer 1.x. :D

Remove conditional block for check libxml usage and
implement a simple html markup parser for the sami
parser.

https://bugzilla.gnome.org/show_bug.cgi?id=693056
2013-07-16 18:04:02 +01:00
Sebastian Dröge
b19d64d785 subparse/ssaparse: Fix event handling and order 2013-05-10 12:21:31 +02:00
Sebastian Dröge
948a4a3632 gst: Add better support for static plugins 2013-04-15 15:52:58 +02:00
Arnaud Vrac
4816885ce3 subparse: fix off by one offset calculation
Do not use the buffer start offset when it is invalid, otherwise a
discontinuity is detected on the next buffer, and the subtitle parser
reset and some subtitle lines are not shown.

Also remove unused next_offset field.

https://bugzilla.gnome.org/show_bug.cgi?id=693981
2013-03-22 11:09:11 +00:00
Tim-Philipp Müller
53072a4326 ssaparse: ignore invalid UTF-8 in init section
The codec data blob we get from matroskademux with the SSA/ASS
init section is supposed to be valid UTF-8. If it's not, just
continue with the bits that are valid UTF-8 instead of erroring
out. We don't actually parse the init section yet anyway..

https://bugzilla.gnome.org/show_bug.cgi?id=607630
2012-12-17 01:09:11 +00:00
Tim-Philipp Müller
6549db36cd subparse: fix GError leak 2012-12-16 12:34:14 +00:00
Tim-Philipp Müller
5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Sebastian Dröge
3c1041d5eb Revert "gst: Add better support for static plugins"
This reverts commit d2d79e3bc2,
which was accidentially pushed.
2012-10-24 13:26:26 +02:00
Sebastian Dröge
d2d79e3bc2 gst: Add better support for static plugins 2012-10-24 12:10:44 +02:00
Edward Hervey
5f4bd0a4e8 subparse: Call default query handler 2012-09-11 16:29:21 +02:00
Tim-Philipp Müller
7c2e7b1a4f text/plain + text/x-pango-markup -> text/x-raw 2012-09-02 02:45:41 +01:00
Sebastian Dröge
99d73c94e9 tag: Update for taglist/tag event API changes 2012-07-28 00:35:02 +02:00
Wim Taymans
a2172bdb4b update for tag event change 2012-06-06 13:05:47 +02:00