Commit graph

378 commits

Author SHA1 Message Date
Sebastian Dröge
e87fa73e60 compositor: Implement different operators via per-pad property
This removes the crossfade-ratio property and replaces it with an
operator property. Currently this implements the following operators:

- SOURCE: Copy over the source and don't look at the destination
- OVER: Default blending of the source over the destination
- ADD: Like OVER but simply adding the alpha instead

See the example for how to implement crossfading with this.

https://bugzilla.gnome.org/show_bug.cgi?id=797169
2018-10-28 17:13:26 +00:00
Sebastian Dröge
c41439d16f compositor: Remove extra header for the pad declaration
There's no reason for having this separate apart from making things less
discoverable.
2018-10-27 13:59:57 +01:00
Seungha Yang
5adec0db4f meson: Replace empty configuration_data() with copy keyword
Use 'copy' keyword to avoid meson warning message.
Note that 'copy' keyword in configure_file() is available
since meson 0.47.0

https://bugzilla.gnome.org/show_bug.cgi?id=797298
2018-10-17 14:08:47 +01:00
Matthew Waters
89c14c955b glvideomixer: fix the default blend modes for unpremultipled alpha
Alpha in GStreamer is unpremultiplied
2018-10-05 01:18:59 +10:00
Matthew Waters
2f88e2ae16 glmixerbin: add gloverlaycompositor to each input stream
Flattens the overlay compositions into the stream before the mixer will
mix them.

https://bugzilla.gnome.org/show_bug.cgi?id=759867
2018-10-04 14:32:14 +10:00
Sebastian Dröge
b37c08ecb5 glstereomix: Fix build after deprecating misnamed GST_TYPE_GL_STEREO_DOWNMIX_MODE_TYPE 2018-10-03 16:00:23 +03:00
Sebastian Dröge
b59fcdc789 glmixerbin: "latency" property on aggregator is uint64, not int64
Also update the property description and range with aggregator's values.
2018-09-24 23:26:52 +03:00
Matthew Waters
f757da1160 glvideomixer: fix constant alpha enum value for constant alpha 2018-09-21 19:45:13 +10:00
Sebastian Dröge
05d0c72a59 glvideomixer: Fix typo in property description 2018-09-19 10:28:56 +03:00
Sebastian Dröge
5485a2b9ee compositor: Define crossfade-ratio to have range [0.0,1.0]
Previously negative values had the same effect as 0.0, which was
confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=796845
2018-08-16 17:08:06 +03:00
Sebastian Dröge
8430e47006 videoaggregator: Make sure to hold object lock while iterating sink pads
They might otherwise just change while we iterate.
2018-08-16 10:03:19 +03:00
Sebastian Dröge
3e067ae333 compositor: Don't leak all buffers while crossfading and not all pads are crossfading 2018-07-26 00:20:02 +03:00
Sebastian Dröge
aa3e64c71d compositor: Use 255 as maximum alpha instead of 256
255 will easily become 0 in the blending function as they expect
the maximum value to be 255.

Can be reproduce with

gst-launch-1.0 videotestsrc pattern=ball ! c.sink_0 \
               videotestsrc pattern=snow ! c.sink_1 \
               compositor name=c \
                 sink_0::zorder=0 sink_1::zorder=1 sink_0::crossfade-ratio=0.5 \
                 background=black ! \
               videoconvert ! xvimagesink

crossfade-ratio +/- 0.001 makes it work correctly and the same happens
at e.g. 0.25, 0.75, N*0.0625

https://bugzilla.gnome.org/show_bug.cgi?id=796846
2018-07-23 18:59:33 +03:00
Seungha Yang
4380d57779 compositor: Update conversion info in property setter
... not in getter. Otherwise, video-converter will not be updated
with new width/height

https://bugzilla.gnome.org/show_bug.cgi?id=796828
2018-07-18 14:41:31 +03:00
Matthew Waters
3a3577f826 glvideomixer: fix default placement when different sized output
i.e. when expanding from 320x240 to 800x600, the resulting frame should
appear in the top left corner, not the middle.

https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-12 12:48:39 +10:00
Daniel Klamt
32c7249c5e glvideomixer: Moves the objects to zero on z axis
Matches the output from a similar glimagesink pipeline when
rotating from an upstream gltransformation passed through
the affine transformation meta with xpos/ypos being set.

https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-12 12:46:40 +10:00
Nicolas Dufresne
443b321ca1 glvideomixer: Fix coding style 2018-07-10 09:45:31 -04:00
Nicolas Dufresne
5958b0bd32 glvideomixer: Add missing string.h include 2018-07-10 09:42:47 -04:00
Daniel Klamt
b1bd804cb3 Moved the pad offset and aspect ratio to a matrix so it will be added in view space and not in world space
https://bugzilla.gnome.org/show_bug.cgi?id=794401
2018-07-10 20:31:26 +10:00
Tim-Philipp Müller
b342955a64 videoaggregator: Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 01:47:29 +02:00
Tim-Philipp Müller
69534fe9a0 gl: Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 01:37:08 +02:00
Seungha Yang
5934fb1bb6 videoaggregator: Fix string leak
gst_video_colorimetry_to_string() returns allocated memory which
must be freed.

https://bugzilla.gnome.org/show_bug.cgi?id=796596
2018-06-15 10:17:14 -04:00
Tim-Philipp Müller
ecd58f2775 videoaggregator: log an ERROR if we're going to return a flow error 2018-06-11 13:48:09 +01:00
Olivier Crête
91692122d3 videoaggregator: Remove custom get_next_time implementation
GstAggregator now has the same thing in the simple implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 22:24:18 +02:00
Sebastian Dröge
c43bae0a42 videoaggregator: Set video-meta option on buffer pool configuration correctly
CID 1435451
2018-05-07 17:53:32 +03:00
Sebastian Dröge
4291ee94c4 videoaggregator: First override set/get_property vfuncs, then install properties
Gives assertions otherwise.
2018-05-07 09:17:16 +02:00
Sebastian Dröge
73f843539d videoaggregator: Some more documentation fixes 2018-05-06 16:49:57 +02:00
Mathieu Duponchelle
1492fb4ef9 videoaggregator: expose converter-config on convert pads
This in order to allow users control over the conversion
process, for example the scaling method.
2018-05-06 16:45:43 +02:00
Sebastian Dröge
049877e5d0 videoaggregator: Fix up documentation some more 2018-05-06 16:43:32 +02:00
Sebastian Dröge
9d6d46f4cb videoaggregator: Clean up header and update docs a bit 2018-05-06 16:22:01 +02:00
Sebastian Dröge
dbb21615c4 videoaggregator: Rename get_output_buffer() to create_output_buffer()
For consistency with GstAudioAggregator.
2018-05-06 16:05:28 +02:00
Sebastian Dröge
429e6c8532 videoaggregator: Validate pool configuration and create a new pool if it just does not work
Also pass the given allocator to the pool if one is set.
2018-05-06 15:49:36 +02:00
Sebastian Dröge
33a8e28207 videoaggregator: Switch to a GstVideoAggregatorConvertPad subclass
This moves all the conversion related code to a single place, allows
less code-duplication inside compositor and makes the glmixer code less
awkward. It's also the same pattern as used by GstAudioAggregator.
2018-05-06 15:22:51 +02:00
Sebastian Dröge
d37e778692 glmixer: Include string.h for memset()
gstglmixer.c:143:5: error: implicit declaration of function ‘memset’ [-Werror=implicit-function-declaration]
     memset (prepared_frame, 0, sizeof (GstVideoFrame));
     ^~~~~~
gstglmixer.c:143:5: error: incompatible implicit declaration of built-in function ‘memset’ [-Werror]
2018-05-05 17:48:30 +02:00
Sebastian Dröge
b73b7230d2 videoaggregator: Remove sink_non_alpha_caps class field
This is only used for caching reasons and should never actually be in
the public API. If this is ever a bottleneck later, caching around a
class private struct could be implemented.
2018-05-05 16:32:19 +02:00
Sebastian Dröge
233ee9f077 videoaggregator: Move needs_alpha pad field to the private struct
And also trigger renegotiation if the value has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=795836
2018-05-05 16:32:19 +02:00
Sebastian Dröge
1c8110ab17 videoaggregator: Move aggregated_frame and the pad buffer into the private struct
The aggregated_frame is now called prepared_frame and passed to the
prepare_frame and cleanup_frame virtual methods directly. For the
currently queued buffer there is a method on the video aggregator pad
now.
2018-05-05 16:32:19 +02:00
Sebastian Dröge
404b802846 glmixer: Move frame/texture mapping/unmapping into prepare/clean_frame
Previously we assumed that the texture ID is going to be valid even
after unmapping the frame, as it was immediately unmapped before even
being used. Now we only unmap once we're done with the texture.
2018-05-05 12:17:34 +02:00
Sebastian Dröge
8b231d502c videoaggregator: Move property storage to private pad struct 2018-05-04 17:18:12 +02:00
Sebastian Dröge
51c359dda6 videoaggregator: Rename ignore-eos pad property to repeat-after-eos
What it does is to repeat the last frame forever after EOS, it does not
literally ignore EOS.
2018-05-04 16:46:00 +02:00
Sebastian Dröge
a240fb7997 videoaggregator: Move GstChildProxy implementations into leaf classes
Not every subclass will want to expose the pads via the interface.

https://bugzilla.gnome.org/show_bug.cgi?id=739011
2018-05-04 16:13:16 +02:00
Sebastian Dröge
c13357f22b videoaggregator: Get rid of separate header for the aggregator pad 2018-05-04 15:35:52 +02:00
Xavier Claessens
9ae9d2686f 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
Tim-Philipp Müller
b69e7eef8b video: GST_EXPORT -> GST_URI_VIDEO_BAD_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 13:36:33 +00:00
Mathieu Duponchelle
b59da8eced Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793946
2018-03-01 15:37:06 +01:00
Tim-Philipp Müller
ea30f86ccc Dist compositor crossfade example and pythons script for meson build
And add to autotools build so it gets disted.
2018-02-15 18:51:44 +00:00
Edward Hervey
3b9843d13b Update ORC fallback disted code 2018-02-14 14:36:00 +01:00
Vincent Penquerc'h
6df4606044 glvideomixer: fix vertex_buffer leak
We call the base class first as this will remove the pad from
the aggregator, thus stopping misc callbacks from being called,
one of which (process_textures) will recreate the vertex_buffer
if it is destroyed

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2018-01-29 09:58:00 +00:00
Mathieu Duponchelle
a4f609f847 videoaggregatorpad: implement skip_buffer
Skip buffers from sources with a framerate higher than the output
framerate.

https://bugzilla.gnome.org/show_bug.cgi?id=781928
2018-01-23 20:19:38 +01:00
Tim-Philipp Müller
944f74b834 Update for renamed aggregator pad API
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:01:00 +00:00