Commit graph

115 commits

Author SHA1 Message Date
Stéphane Cerveau
6638dd2ff4 assrender: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>
2021-03-23 14:19:16 +00:00
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
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
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
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
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
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
Wim Taymans
b8f913555d ffmpegcolorspace is no more 2012-09-14 16:45:34 +02:00
Mark Nauwelaerts
dd3ae904f9 assrender: process ATTACHMENT tag as sample 2012-07-27 13:22:52 +02:00
Andre Moreira Magalhaes (andrunko)
2213a44214 assrender: Refactoring and make core more similar to textoverlay
Especially the combining of the text and video buffers is now
almost the same as in textoverlay.

We should really get a base class for this.

Conflicts:

	ext/assrender/gstassrender.c
	ext/assrender/gstassrender.h
2012-05-29 11:47:21 +02:00
Sebastian Dröge
cda192b3b7 gst: Update for GST_PLUGIN_DEFINE() API changes 2012-04-05 18:02:56 +02:00
Sebastian Dröge
860ccd414d Merge remote-tracking branch 'origin/0.10'
Conflicts:
	NEWS
	RELEASE
	common
	configure.ac
	docs/libs/gst-plugins-bad-libs-sections.txt
	docs/plugins/gst-plugins-bad-plugins.args
	docs/plugins/gst-plugins-bad-plugins.hierarchy
	docs/plugins/gst-plugins-bad-plugins.interfaces
	docs/plugins/inspect/plugin-adpcmdec.xml
	docs/plugins/inspect/plugin-adpcmenc.xml
	docs/plugins/inspect/plugin-assrender.xml
	docs/plugins/inspect/plugin-audiovisualizers.xml
	docs/plugins/inspect/plugin-autoconvert.xml
	docs/plugins/inspect/plugin-bayer.xml
	docs/plugins/inspect/plugin-bz2.xml
	docs/plugins/inspect/plugin-camerabin2.xml
	docs/plugins/inspect/plugin-celt.xml
	docs/plugins/inspect/plugin-dataurisrc.xml
	docs/plugins/inspect/plugin-debugutilsbad.xml
	docs/plugins/inspect/plugin-dtmf.xml
	docs/plugins/inspect/plugin-dtsdec.xml
	docs/plugins/inspect/plugin-dvbsuboverlay.xml
	docs/plugins/inspect/plugin-dvdspu.xml
	docs/plugins/inspect/plugin-faac.xml
	docs/plugins/inspect/plugin-faad.xml
	docs/plugins/inspect/plugin-gsm.xml
	docs/plugins/inspect/plugin-h264parse.xml
	docs/plugins/inspect/plugin-mms.xml
	docs/plugins/inspect/plugin-modplug.xml
	docs/plugins/inspect/plugin-mpeg2enc.xml
	docs/plugins/inspect/plugin-mpegdemux2.xml
	docs/plugins/inspect/plugin-mpegtsdemux.xml
	docs/plugins/inspect/plugin-mpegvideoparse.xml
	docs/plugins/inspect/plugin-mplex.xml
	docs/plugins/inspect/plugin-pcapparse.xml
	docs/plugins/inspect/plugin-rawparse.xml
	docs/plugins/inspect/plugin-rtpmux.xml
	docs/plugins/inspect/plugin-rtpvp8.xml
	docs/plugins/inspect/plugin-scaletempo.xml
	docs/plugins/inspect/plugin-schro.xml
	docs/plugins/inspect/plugin-sdp.xml
	docs/plugins/inspect/plugin-segmentclip.xml
	docs/plugins/inspect/plugin-shm.xml
	docs/plugins/inspect/plugin-videomaxrate.xml
	docs/plugins/inspect/plugin-videoparsersbad.xml
	docs/plugins/inspect/plugin-vp8.xml
	docs/plugins/inspect/plugin-y4mdec.xml
	ext/celt/gstceltdec.c
	ext/dts/gstdtsdec.c
	ext/modplug/gstmodplug.cc
	ext/opus/gstopusenc.c
	gst-libs/gst/video/gstbasevideocodec.c
	gst-libs/gst/video/gstbasevideocodec.h
	gst-libs/gst/video/gstbasevideodecoder.c
	gst-libs/gst/video/gstbasevideodecoder.h
	gst-libs/gst/video/gstbasevideoencoder.c
	gst-libs/gst/video/gstbasevideoencoder.h
	gst/adpcmdec/Makefile.am
	gst/audiovisualizers/gstbaseaudiovisualizer.c
	gst/h264parse/gsth264parse.c
	gst/mpegdemux/mpegtsparse.c
	gst/mpegtsdemux/mpegtsbase.c
	gst/mpegtsdemux/mpegtspacketizer.c
	gst/mpegtsdemux/mpegtsparse.c
	gst/mpegtsdemux/tsdemux.c
	gst/mpegtsdemux/tsdemux.h
	gst/mxf/mxfdemux.c
	gst/rawparse/gstaudioparse.c
	gst/videoparsers/gsth263parse.c
	gst/videoparsers/gsth264parse.c
	sys/d3dvideosink/d3dvideosink.c
	sys/decklink/gstdecklinksink.cpp
	sys/dvb/gstdvbsrc.c
	sys/shm/gstshmsrc.c
	sys/vdpau/h264/gstvdph264dec.c
	sys/vdpau/mpeg/gstvdpmpegdec.c
	tests/examples/opencv/gst_element_print_properties.c
	win32/common/config.h
2012-03-29 17:41:53 +02:00
Wim Taymans
77299ba6ae fix for caps api changes 2012-03-11 19:06:59 +01:00