Commit graph

68 commits

Author SHA1 Message Date
Olivier Crête
00760618df gl*mixer: Use propose_allocation from the GstAggregator base class
https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-12-09 19:32:28 +00:00
Matthew Waters
ffe51f38fc aggregator: add simple support for caps handling
Modelled off the videoaggregator caps handling as that seems the most
mature aggregtor-using implementation that has caps handling there is.

https://bugzilla.gnome.org/show_bug.cgi?id=776931
2017-12-09 19:32:28 +00:00
Tim-Philipp Müller
7ee90afce2 glvideomixer: fix whole example launch line actually 2017-12-09 19:32:27 +00:00
Tim-Philipp Müller
c6ab669b52 glvideomixer: remove extraneous \ from example launch line in docs 2017-12-09 19:32:27 +00:00
Thibault Saunier
95ac4d5175 docs: Port all docstring to gtk-doc markdown 2017-12-09 19:32:27 +00:00
Sebastian Dröge
0e2f93589d glvideomixer/compositor: Correctly error out if calculating DAR fails
CID 1320700
2017-12-09 19:32:26 +00:00
Sebastian Dröge
dc28155e21 gl: Rename gst_gl_get_affine_transformation_meta_as_ndc_ext() to prevent symbol conflict
The same symbol also exists in libgstgl, although marked as private and
internal. This has no effect when doing static linking and there's a
symbol conflict.
2017-12-09 19:32:26 +00:00
Matthew Waters
cfc16f6dae gl: remove custom control binding proxy
Use the existing GstProxyControlBinding instead.
2017-12-09 19:32:25 +00:00
Sebastian Dröge
faf1e388f7 glvideomixer: Reject multiview video
glvideomixer does not support it currently and it needs special support
for handling this correctly, and is rather non-trivial to implement for
all formats.
2017-12-09 19:32:25 +00:00
Matthew Waters
8a1d31f6ab gl/utils: move gen_shader() to the plugin and remove del_shader()
gst_gl_context_del_shader() can be replaced by a g_object_unref().
gst_gl_context_gen_shader() should be replaced by using GstGLSLStage.
2017-12-09 19:32:24 +00:00
Matthew Waters
18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2017-12-09 19:32:23 +00:00
Jan Schmidt
bcc29643db gl: Update glvideomixer doc 2017-12-09 19:32:22 +00:00
Matthew Waters
4bbda2b626 glframebuffer: rewrite for a more consistent API
Facilities are given to create fbo's and attach GL memory (renderbuffers
or textures).  It also keeps track of the renderable size for use with
effective use with glViewport().
2017-12-09 19:32:21 +00:00
Matthew Waters
7f10822de4 gl: use GLMemory for accessing textures everywhere
This simplifies and consolidates a lot of duplicated code creating
and modifying textures.
2017-12-09 19:32:21 +00:00
Matthew Waters
2d62b2910c gl: take the affine transformation in NDC
Provide a function to get the affine matrix in the meta in terms of NDC
coordinates and use as a standard opengl matrix.

Also advertise support for the affine transformation meta in the allocation
query.
2017-12-09 19:32:19 +00:00
Matthew Waters
7f8e09523f videoaggregator: repect the result of find_best_format in the default update_caps
We weren't using the result of find_best_format at all.

Also, move the find_best_format usage to the default update_caps() to make
sure that it is also overridable.

https://bugzilla.gnome.org/show_bug.cgi?id=764363
2017-12-09 19:32:19 +00:00
Matthew Waters
aae649dc75 glvideomixer: add support for the affine transformation meta 2017-12-09 19:32:18 +00:00
Matthew Waters
7b2ab7279f glvideomixer: signal continuation in reset
We want to iterate over all the pads, not just the first one.  Fix by returning
TRUE in the GstAggregatorPadForeachFunc.

Removes a GST_IS_GL_CONTEXT() assertion on shutdown with >2 inputs
using gst-launch.
2017-12-09 19:32:17 +00:00
Wang Xin-yu (王昕宇)
35765bec0e glmixer: iterator didn't advance in continue statement
Leading to a deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2017-12-09 19:32:17 +00:00
Wang Xin-yu (王昕宇)
176149039b glvideomixer: don't leak pad's vertex buffer on release_pad
https://bugzilla.gnome.org/show_bug.cgi?id=760873
2017-12-09 19:32:16 +00:00
Matthew Waters
c1376c91ef glmixer: Remove usage of GstGLMixerFrameData
Subclasses can just iterate over the list of pads themselves

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2017-12-09 19:32:16 +00:00
Wang Xin-yu (王昕宇)
46cf23b0a1 glvideomixer: fix checker vbo leak
https://bugzilla.gnome.org/show_bug.cgi?id=760925
2017-12-09 19:32:15 +00:00
Matthew Waters
931090bf18 glvideomixer: par may not exist in the caps
Fixes a critical in the gst-validate tests:

gst_structure_fixate_field_nearest_fraction: assertion 'gst_structure_has_field
(structure, field_name)
2017-12-09 19:32:15 +00:00
Matthew Waters
e03e983e90 videoaggregator: don't do caps processing that is not overridable
Allows the subclass to completely override the chosen src caps.

This is needed as videoaggregator generally has no idea exactly
what operation is being performed.

- Adds a fixate_caps vfunc for fixation
- Merges gst_video_aggregator_update_converters() into
  gst_videoaggregator_update_src_caps() as we need some of its info
  for proper caps handling.
- Pass the downstream caps to the update_caps vfunc

https://bugzilla.gnome.org/show_bug.cgi?id=756207
2017-12-09 19:32:15 +00:00
Matthew Waters
2cef90184e gl: move control binding proxy implementation from glvideomixer
Other elements may need to use it's functionality
2017-12-09 19:32:15 +00:00
Matthew Waters
1d55ce912b glvideomixer: implement glBlendFunc and glBlendEquation
Allows more blending options than just A over B

e.g. frame comparisons are now possible.
  glvideomixer name=m
    sink_0::zorder=0
    sink_1::zorder=1
    sink_1::blend-equation-rgb={subtract,reverse-subtract}
    sink_1::blend-function-src-rgb=src-color
    sink_1::blend-function-dst-rgb=dst-color
  ! glimagesinkelement
  videotestsrc pattern=checkers-4 ! m.sink_0
  videotestsrc pattern=checkers-8 ! m.sink_1
2017-12-09 19:32:14 +00:00
Nirbheek Chauhan
5890c51bd3 glvideomixer: Proxy the ignore-eos videoaggregator property as well
Identical to how the z-order property is proxied
2017-12-09 19:32:09 +00:00
Matthew Waters
dec64d9036 glvideomixer: swap control binding proxy
The ref_object and object parameters were the wrong way around.

For the typical use case where an application is setting a
GstControlBinding on the returned ghost pad:
1. our control binding would be removed when the new one was set
2. sync_values calls were not being forwarded from the internal
   pad to the ghost pad.

If an application attempts to perform other control binding
operations (get_* family of functions) on the internal pad, they
will also be forwarded to the ghost pad where a possible
GstControlBinding will provide the necessary values.
2017-12-09 19:32:07 +00:00
Olivier Crête
f59948c5c0 glvideomixer: Add GstControlBinding proxy
This is used to proxy GstControlBinding to the pad on the
parent object. This avoid having to sync the values in the proxy pad,
this is too early if you have a queue between the pad and the actual
aggregation operation.

https://bugzilla.gnome.org/show_bug.cgi?id=734060
2017-12-09 19:32:06 +00:00
Olivier Crête
1c99bc92ca glvideomixer, glmixer: Add description and klass 2017-12-09 19:32:05 +00:00
Sebastian Dröge
5503937337 compositor/glvideomixer: Don't calculate PAR/DAR with unset GstVideoInfos
Otherwise we divide by zero.
2017-12-09 19:32:02 +00:00
Matthew Waters
44153e637b compositor/glvideomixer: fix up par handling
We were using the wrong formula

https://bugzilla.gnome.org/show_bug.cgi?id=749634
2017-12-09 19:32:01 +00:00
Matthew Waters
72993f54fa gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
2017-12-09 19:32:01 +00:00
Matthew Waters
65c57b77ff gl: element buffers are part of vao state
Use them as such.  They are also required for GL3 core profile support
with glDrawElements on OS X.
2017-12-09 19:32:01 +00:00
Matthew Waters
06cbb3389b glvideomixer: implement par handling
We were previously ignoring it completely
2017-12-09 19:32:01 +00:00
Matthew Waters
5d3dd13433 glvideomixer: don't upload the vertex data every frame
Add the missing cache tracking statement.
2017-12-09 19:32:01 +00:00
Sebastian Dröge
3d6031b75c Revert "Revert "glvideomixer: implement with glmixerbin""
This reverts commit b4bd11f2f3.
2017-12-09 19:32:00 +00:00
Matthew Waters
eb5d578a95 Revert "glvideomixer: implement with glmixerbin"
This reverts commit 0fb56738a1.
2017-12-09 19:32:00 +00:00
Edward Hervey
36419f2f79 glvideomixer: Don't use context if not present
Avoids assertions at runtime
2017-12-09 19:31:58 +00:00
Matthew Waters
92f0aa9bd8 gl: get the context from basemixer/basefilter 2017-12-09 19:31:57 +00:00
Matthew Waters
b42e4ba079 glvideomixer: implement with glmixerbin
The relevant properties are forwarded to/from the containing bin
and sink pads.
2017-12-09 19:31:57 +00:00
Matthew Waters
02fdc64844 glvideomixer: don't upload if alpha <= 0
Implemented using a upload_buffer vfunc within GstGLMixer allowing
NULL uploaded buffers.
2017-12-09 19:31:52 +00:00
Tim-Philipp Müller
3c3ca1c842 glmixer, glvideomixer: update for GstAggregatorPadForeachFunc change 2017-12-09 19:31:52 +00:00
Nirbheek Chauhan
c1b1f546d5 glvideomixer: Point to compositor for the pad properties documentation 2017-12-09 19:31:52 +00:00
Matthew Waters
ba3a3cd783 gl: fixup vao and vbo usage for legacy GL 2017-12-09 19:31:52 +00:00
Matthew Waters
4bd62ebb03 gldisplay: implement runtime GL api filtering
Needed so that the pipeline/application can limit the choice of GL api
to what it supports
2017-12-09 19:31:51 +00:00
Matthew Waters
65c89e07fb glvideomixer: add support for gl3 2017-12-09 19:31:51 +00:00
Matthew Waters
3cccd77d5d videoaggregator: operate on caps rather than video info
Otherwise the CapsFeatures will be lost along with the possibility
of multiple output types and formats.

https://bugzilla.gnome.org/show_bug.cgi?id=738129
2017-12-09 19:31:48 +00:00
Matthew Waters
d30a476c1c glvideomixer: update element documentation 2017-12-09 19:31:47 +00:00
Matthew Waters
f5006bdf09 glvideomixer: fix blending with low-alpha sources
We also need to apply the blend paramaters to the alpha channel otherwise
the output of the blend will appear black at low alpha values (< 0.2).
2017-12-09 19:31:46 +00:00