Commit graph

151 commits

Author SHA1 Message Date
Guillaume Desmottes
293d6a7ebe glmixer: pass the proper free function to frames and buffers array
'array_buffers' contain borrowed GstBuffer and so shouldn't have a free
function. 'frames' is the one containing GstGLMixerFrameData and so should use
_free_glmixer_frame_data as free function.

Fix GstGLMixerFrameData leaks with the
validate.file.glvideomixer.simple.play_15s.synchronized scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=747913

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-17 14:28:25 +01:00
Sebastian Dröge
78a1841c86 gl: Remove some empty ::finalize() implementations 2015-04-17 14:09:47 +02:00
Sebastian Dröge
63c776adee videoaggregator: Remove broken timestamps-going-backwards check
This would've also triggered if for some reason the segment was updated
in such a way that PTS went backwards, but the running time increased. Like
what happens when non-flushing seeks are done.

We're doing a proper buffer-from-the-past check a few lines below based on the
running time, which is the only time we should care about here.
2015-04-08 19:31:43 -07:00
Olivier Crête
26d3057d98 aggregator: Query latency on first incoming buffer.
And keep on querying upstream until we get a reply.

Also, the _get_latency_unlocked() method required being calld
with a private lock, so removed the _unlocked() variant from the API.
And it now returns GST_CLOCK_TIME_NONE when the element is not live as
we think that 0 upstream latency is possible.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-04-01 22:39:26 -04:00
Edward Hervey
9a73ffcef3 glvideomixer: Don't use context if not present
Avoids assertions at runtime
2015-03-31 16:31:18 +02:00
Nirbheek Chauhan
af17a2cd4f videoaggregator: Check if there's a previous buffer to 'keep'
If we want to keep a previous buffer but there's no previous buffer, we actually
need more data instead.
2015-03-24 14:54:33 +01:00
Jan Schmidt
d9a96ac2ec compositor: Revert most of previous patch.
The calculation doesn't produce the same results.
Keep just the change to divide alpha by 255 instead of 256,
for slightly better accuracy
2015-03-16 04:00:44 +11:00
Jan Schmidt
6a1f97cd50 compositor: Fix blending functions
Correctly calculate alpha in a few places by dividing by 255,
not 256.

Fix the argb and bgra blending functions to avoid an off-by-one
error in the calculations, so painting with alpha = 0xff doesn't
ever bleed through from behind
2015-03-16 00:33:23 +11:00
Matthew Waters
875e5c0320 glsyncmeta: make context to wait and set sync explicit
otherwise we may wait on a sync object in same context by accident
2015-03-14 16:53:46 +00:00
Matthew Waters
4c72910825 gl: get the context from basemixer/basefilter 2015-03-13 12:30:20 +00:00
Matthew Waters
b0ee70e77a gl: retreive the gldisplay/app gl context as soon as possible
fixes the usage of gst_gl_display_filter_gl_api
2015-03-13 12:30:20 +00:00
Matthew Waters
f19b8f7665 gl: store the list of contexts within gldisplay
Removes the reliance on the allocation query to propogate GL contexts.

Allows thread safely getting a context for the a specific thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
acd9a252c0 glvideomixer: implement with glmixerbin
The relevant properties are forwarded to/from the containing bin
and sink pads.
2015-03-12 16:45:51 +00:00
Matthew Waters
b6cf2d9f21 glmixer: remove usage of upload/download objects 2015-03-12 16:45:51 +00:00
Matthew Waters
bf7409b831 gl: new glmixerbin element 2015-03-12 16:45:51 +00:00
Matthew Waters
d175b0be59 gl: add a new glbasemixer class below glmixer
It deals with propagating the gl display/contexts throughout the
application/pipeline
2015-03-12 16:45:50 +00:00
Nirbheek Chauhan
e387604d66 videoaggregator: While aggregating, sync values for all pads before converting frames 2015-03-12 09:47:50 +00:00
Nicolas Dufresne
f433695b5d glmixer: Don't share our downstream pool with upstream
Pool cannot have multiple owner. This can lead to spurious
pool was flushing error.

https://bugzilla.gnome.org/show_bug.cgi?id=74570
2015-03-06 20:12:09 -05:00
Sebastian Dröge
f153b9ee59 gl: Remove format info in glcolorconvert's transform_caps function instead of on every caller
... and let glmixer actually transform the caps it is supposed to transform
instead of inventing new caps.
2015-03-06 18:53:13 +01:00
Sebastian Dröge
5dfa3c8009 Revert "videoaggregator: Create new caps from the video-info"
This reverts commit 78215be0df.

because it broke glvideomixer with custom caps features.
2015-03-06 18:53:13 +01:00
Sebastian Dröge
3555c7bcd9 videoaggregator: Create new caps from the video-info
In case the original caps were missing some optional fields like
interlace-mode. We assume default values for those everywhere,
but they can still cause negotiation to fail if a downstream element
expects the field to be there and at a specific value.
2015-03-06 14:36:26 +01:00
Tim-Philipp Müller
8b87f3f2fe videoaggregator: use new gst_aggregator_pad_drop_buffer() 2015-02-13 16:25:52 +00:00
Tim-Philipp Müller
0d510b2da9 tests: remove GST_DISABLE_PARSE guards from two tests that don't require it 2015-02-13 16:25:14 +00:00
Sebastian Dröge
d9a267f030 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 14:16:21 +01:00
Sebastian Dröge
0d89c672e8 videoaggregator: When receiving timeout before caps, make sure to also advance our frame counter
Otherwise we will directly go EOS on the next non-timeout.
2015-02-10 10:57:38 +01:00
Matthew Waters
b4ee792fc2 videoaggregator: fix buffer selection when duration=-1
If the src framerate and videoaggreator's output framerate were
different, then we were taking every single buffer that had duration=-1
as it came in regardless of the buffer's start time.  This caused the src
to possibly run at a different speed to the output frames.

https://bugzilla.gnome.org/show_bug.cgi?id=744096
2015-02-10 14:44:21 +11:00
Tim-Philipp Müller
bde4292e90 videoaggregator: don't set element factory details
This is an abstract base class, not an element.
2015-02-08 14:32:22 +00:00
Tim-Philipp Müller
302353307a tests: compositor: add unit test for proper segment.base handling
As adjusted by gst_pad_set_offset(), or when doing segment seeks
or looping for example.
2015-02-05 15:48:41 +00:00
Matthew Waters
bae0d5755a gl: remove the egl caps from the src pads
we don't actually support producing EGLImage buffers anywhere.
2015-02-03 15:30:08 +11:00
Matthew Waters
47feb5e011 glupload/download/convert: provide transform_caps functions
Allows finer grain decisions about formats and features at each
stage of the pipeline.
Also provide propose_allocation for glupload besed on the supported
methods.
2015-02-03 14:32:55 +11:00
Alessandro Decina
4860e179fa gl: initial support for texture targets other than GL_TEXTURE_2D
Make GstGLMemory hold the texture target (tex_target) the texture it represents
(tex_id) is bound to. Modify gst_gl_memory_wrapped_texture and
gst_gl_download_perform_with_data to take the texture target as an argument.

This change is needed to support wrapping textures created outside libgstgl,
which might be bound to a target other than GL_TEXTURE_2D. For example on OSX
textures coming from VideoToolbox have target GL_TEXTURE_RECTANGLE.

With this change we still keep (and sometimes imply) GL_TEXTURE_2D as the
target of textures created with libgstgl.

API: modify GstGLMemory
API: modify gst_gl_memory_wrapped_texture
API: gst_gl_download_perform_with_data
2015-01-30 00:34:08 +11:00
Thibault Saunier
490444637f aggregator: More fixes around locking when accessing protected private fields
In some more places we were accessing GstAggregator->segment
and GstAggregator->seqnum without holding the GST_OBJECT_LOCK

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
83e1895dbf aggregator: Hide GstAggregatorPad buffer and EOS fileds
And add a getter for the EOS.

The user should always use the various getters to access
those fields

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
008de39d3f aggregator: Document locking for gst_aggregator_get_latency_unlocked()
Renamed it to _unlocked() to make it clear.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
f5d63b031d videoaggregator: Lock access to members of GstAggregatorPad
Take the pad's object lock before accessing members of the
GstAggregatorPad structure.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Nirbheek Chauhan
4527811b1f videoaggregator: If getting a timeout before having caps, just advance our position
This can happen if this is a live pipeline and no source produced any buffer
and sent no caps until an output buffer should've been produced according to the
latency.

This fix is similar in spirit to commit be7034d1 by Sebastian for audiomixer.
2015-01-29 09:47:32 +01:00
Tim-Philipp Müller
38a06d0a33 videoaggregator: fix crash when receiving buffer without timestamps
Unset out buffer in clip function when we unref the buffer to be
clipped, otherwise aggregator will continue to use the already-
freed buffer. Fixes crash when buffers without timestamps are
being fed to aggregator. Partly because aggregator ignores the
error flow return.

https://bugzilla.gnome.org/show_bug.cgi?id=743334
2015-01-26 09:24:40 +00:00
Vincent Penquerc'h
6b2f694455 compositor: fix illegal memory access in blend function with negative ypos
https://bugzilla.gnome.org/show_bug.cgi?id=741115
2015-01-19 12:38:13 +00:00
Matthew Waters
95a98d1d05 glvideomixer: don't upload if alpha <= 0
Implemented using a upload_buffer vfunc within GstGLMixer allowing
NULL uploaded buffers.
2015-01-15 09:50:02 +11:00
Nirbheek Chauhan
8e2ca1b6a7 compositor: Document the zorder pad property from gstvideoaggregator 2015-01-14 19:21:36 +01:00
Matthew Waters
bd04b36280 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2015-01-14 22:22:13 +11:00
Sebastian Dröge
e1f3214c6c compositor: Don't do any conversions if the pad is completely transparent anyway 2015-01-13 14:54:26 +01:00
Stefan Sauer
7d8b88ae3b gitignore: ignore more files 2015-01-12 22:52:36 +01:00
Tim-Philipp Müller
13af5efb07 glmixer, glvideomixer: update for GstAggregatorPadForeachFunc change 2014-12-30 19:43:43 +00:00
Tim-Philipp Müller
6ad57a882a glmixer: update for aggregator start/stop vfunc change 2014-12-30 19:26:47 +00:00
Tim-Philipp Müller
b8e97659fe videoaggregator: update for aggregator start/stop vfunc change 2014-12-30 17:56:35 +00:00
Tim-Philipp Müller
7d22da9510 aggregator: make padding larger
Esp. the class structures, can't have enough
spare space for virtual functions.
2014-12-28 01:13:33 +00:00
Nirbheek Chauhan
6351c0becc glvideomixer: Point to compositor for the pad properties documentation 2014-12-27 11:05:17 +00:00
Nirbheek Chauhan
a27431c680 compositor: Document the pad properties 2014-12-27 11:04:52 +00:00
Sebastian Dröge
b9312fe9a2 videoaggregator: Use the src query implementation of aggregator as the default case 2014-12-22 22:12:02 +01:00