Commit graph

122 commits

Author SHA1 Message Date
Sebastian Dröge
b258144c16 assrender: Don't try unlocking unlocked mutex
When flushing right at the beginning of the video chain function or
when failing negotiation at the top of the function, the assrender mutex
would be unlocked without being previously locked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1918>
2020-12-29 11:19:53 +00:00
Aaron Boxer
6d3429af34 documentation: fixed a heap o' typos 2019-11-05 09:11:25 -05:00
Tim-Philipp Müller
f218ec2794 Remove autotools build system 2019-10-14 13:54:27 +01:00
Matthew Waters
84718775a2 ass: avoid infinite unref loop with bad data
A classic case of not updating the next item to iterate after deleting
it from the singly linked list.

Only ever hit with a text buffer with GST_CLOCK_TIME_NONE for either the
timestamp or duration.
2019-10-07 00:07:36 +11:00
Thibault Saunier
47a49f3381 docs: Build documentation with hotdoc 2019-05-13 17:00:00 -04:00
Tim-Philipp Müller
ab12a4cd0f assrender: fix seeking backwards
Use proper API to flush libass events when we do
a flushing seek, and also do it in FLUSH_STOP
rather than FLUSH_START, so we can be sure
streaming has stopped.

Fixes seeking back in time.

Something seems to have changed in libass that
renders the old manual way of flushing events
ineffective and libass then seems to ignore
timestamps that are older than the ones last
seen then if we do it the old way.

Fixes #916
2019-04-06 15:19:07 +01:00
Tim-Philipp Müller
e52f33430d assrender: improve debug logging in video chain
Print video timestamps only once and enumerate text
buffers to make output more concise and nicer to read.
2019-04-06 14:33:45 +01:00
Tim-Philipp Müller
eb6a1cf07e assrender: use subtitle segment to calculate running time for text
Not the video segment. This just for correctness, shouldn't make
any difference in practice since we don't support external SSA yet.
2019-04-06 14:31:37 +01:00
Tim-Philipp Müller
8ee9a94c4d assrender: fix some leaks
g_slist_remove_*() removes the list node without freeing it.
2019-03-08 23:49:49 +00:00
Michael Drake
bba33533ab assrender: fix multiple subtitles on screen simultaneously
This fixes an issue with SSA/ASS subtitles, where subtitles
would fail to appear if there was already a subtitle on screen.

This was because `struct _GstAssRender` had a single
`GstBuffer *subtitle_pending` member.  This meant that
the assrender context could only be aware of one subtitle
at a time.

This patch changes the subtitle_pending member to a
linked list of pending subtitles.

The `gst_ass_render_chain_text` function no longer needs
to care about whether there are already subtitles pending,
it simply appends new subtitles to the list.

The `gst_ass_render_chain_video` function has been modified
to handle the list of pending subtitles.

Finally, the `gst_ass_render_pop_text` function has been
modified to pop the entire list of pending subtitles.

https://bugzilla.gnome.org/show_bug.cgi?id=735944
2018-08-14 23:00:34 +10:00
Nirbheek Chauhan
b55dfb5313 Add feature options for almost all plugins
The only plugins remaining are those that haven't been ported to Meson
yet, and msdk. Also, the tests are still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 19:04:38 +05:30
Xavier Claessens
83d0623293 Meson: Generate pc file for all plugins in bad
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:08:09 +01:00
Nicolas Dufresne
4261692187 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 14:05:52 -04:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Tim-Philipp Müller
24ee608947 Update for 'mad' mp3 decoder removal
https://bugzilla.gnome.org/show_bug.cgi?id=776140
2017-03-20 17:15:54 +00:00
Sebastian Dröge
b2dd97a3d0 assrender: Mark pad as needing reconfiguration again if reconfiguration failed
Also return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:22:44 +02:00
Nirbheek Chauhan
42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.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:35:54 +01:00
Vineeth TM
8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Tim-Philipp Müller
384987341b assrender, dvbsuboverlay: fix example pipelines in docs 2015-12-19 21:25:49 +00:00
Vineeth TM
7c42ba97d7 plugins-bad: Fix example pipelines
rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

https://bugzilla.gnome.org/show_bug.cgi?id=759432
2015-12-15 10:30:49 +00:00
Tim-Philipp Müller
63853b7b0d assrender: don't send flush events on seeks
It's for the upstream element driving the pipeline to
handle seeks and send flush events or not, filters
should not interfere here, otherwise downstream pads
could be flushing before upstream pads are flushing,
which can result in GST_FLOW_ERROR being sent instead
of GST_FLOW_FLUSHING when trying to forward sticky
events at just the wrong moment.
2015-11-06 20:31:31 +00:00
Tim-Philipp Müller
734d5a79c5 Fix code indentation 2015-11-06 19:29:49 +00:00
Arnaud Vrac
3b1e095169 assrender: optimize blending
Skip empty source pixels when blending an image. There can be hundreds
of images to blend at each frame, so this brings a nice performance
boost.

https://bugzilla.gnome.org/show_bug.cgi?id=753821
2015-10-02 17:23:57 +03:00
Arnaud Vrac
ecdc7bb37d assrender: Use the window size from downstream
This allows rendering the overlay at a resolution matching the video
resolution.

https://bugzilla.gnome.org/show_bug.cgi?id=753824
2015-10-02 17:18:33 +03:00
Arnaud Vrac
f021d32bef assrender: Improve negotiation
This is mostly a copy/paste of the negotiation function in
basetextoverlay, which was improved recently to handle many more cases.

This will allow us to negotiate a window size with downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=753824
2015-10-02 17:17:24 +03:00
Arnaud Vrac
31c6902373 assrender: render the subtitles with the proper aspect
This bumps the libass version requirement to 0.10.2.

https://bugzilla.gnome.org/show_bug.cgi?id=753824
2015-10-02 17:16:31 +03:00
Arnaud Vrac
5d0db38df3 assrender: fix leak of tag samples in the tag list
Move handling of a GstSample in a separate function, and unref the
sample after calling it. libass copies the font data so we don't need to
keep it around.

https://bugzilla.gnome.org/show_bug.cgi?id=755759
2015-09-29 09:38:05 +01:00
Arnaud Vrac
c6ce769a18 assrender: fix gap event leak and invalid return value
We don't want the gap event to be forwarded

https://bugzilla.gnome.org/show_bug.cgi?id=755759
2015-09-29 09:37:59 +01:00
Arnaud Vrac
6a884bf08d assrender: check video frame mapping succeeded before blending
If the mapping fails just skip overlay rendering and push the video
frame downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=753822
2015-08-19 16:54:41 +03:00
Tim-Philipp Müller
cd325defca assrender: remove code that can't be reached
If this code could ever be reached, it would leak
memory (CID 1231979), but gst_caps_get_features()
never returns NULL, so that can't happen.
2014-08-29 19:26:40 +01:00
Thiago Santos
7863be66ed assrender: save a few ref/unref pairs
The event/query functions already have a reference to the element, avoid
ref/unref in the functions handling caps queries and events.
2014-08-11 12:32:04 -03:00
Thiago Santos
0b67f872dc assrender: remove obsolete fixme 2014-08-11 12:31:17 -03:00
Thiago Santos
33c2372ae3 assrender: improve negotiation
Check if downstream supports overlay meta, if possible use it and
if not fallback to no-overlay caps

https://bugzilla.gnome.org/show_bug.cgi?id=733916
2014-08-11 12:22:44 -03:00
Thiago Santos
7895d88369 assrender: always intersect with the filter caps
Avoids returning values that peers can't use

https://bugzilla.gnome.org/show_bug.cgi?id=733916
2014-08-11 12:21:28 -03:00
Sebastian Dröge
7f7793ef79 assrender: Make static caps actually static
Otherwise we leak once caps instance on every function call.
2014-06-29 21:05:27 +02:00
Sebastian Dröge
d578cbf7d7 assrender: Do not try to add a feature to a caps features ANY
It does not makes sense and asserts

Based on 7f9aac386f from gst-plugins-base.
2014-05-11 07:56:50 +02:00
Matthieu Bouron
4da4dfc4bf assrender: handle video/x-raw(ANY) if downstream supports the GstVideoOverlayCompositionMeta API
https://bugzilla.gnome.org/show_bug.cgi?id=721950
2014-03-05 20:41:20 +01:00
Sebastian Dröge
e51cd4fe2f gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
Arnaud Vrac
8d837cbac4 assrender: reenable unit tests and up rank to primary again 2013-01-22 00:24:52 +00:00
Arnaud Vrac
143c0cbd45 assrender: use overlay composition to blit subtitles on video frames
Re-uses existing blitting code and also means we can support
a lot more video formats out of the box, hence avoid unnecessary
pixel format or colour space conversions.

https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:31 +00:00
Arnaud Vrac
5f91366553 assrender: render overlay composition if supported downstream
This allows rendering ASS subtitles on top of video when
using hardware-accelerated video decoders based on e.g.
VA-API or VDPAU.

https://bugzilla.gnome.org/show_bug.cgi?id=678389
https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:25 +00:00
Arnaud Vrac
30222d6080 assrender: add wait-text property
This is the same property as in the pango element, to allow waiting for
text on the text pad before rendering the video.

https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:20 +00:00
Arnaud Vrac
c78714ced3 assrender: fix some subtitles being ignored
https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:17 +00:00
Arnaud Vrac
c16d41d709 assrender: refactor code to avoid duplication
https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:13 +00:00
Arnaud Vrac
61976b7aa7 assrender: proxy allocations on video pad
Forward allocation queries on video sink pad instead
of discarding them.

This allows the upstream elements to use the allocation
parameters or pools from the downstream elements like
videosink.

https://bugzilla.gnome.org/show_bug.cgi?id=692012
2013-01-22 00:24:06 +00:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Sebastian Dröge
4dd39a3856 assrender: Handle GAP events 2012-10-25 14:05:49 +02:00
Tim-Philipp Müller
32ba17cd0f Use gst_element_class_set_static_metadata()
where possible. Avoids some string copies. Also re-indent
some stuff. Also some indent fixes here and there.
2012-10-17 17:46:34 +01:00
Tim-Philipp Müller
cc8bd6af0b assrender: disable for autoplugging until it works
https://bugzilla.gnome.org/show_bug.cgi?id=683192
https://bugzilla.gnome.org/show_bug.cgi?id=684683
2012-09-23 21:08:30 +01:00
Mark Nauwelaerts
578861abea replace gst_element_class_set_details_simple with gst_element_class_set_metadata 2012-09-14 17:27:49 +02:00