Commit graph

250 commits

Author SHA1 Message Date
Matthew Waters
92245ec05f 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
2016-04-07 20:30:25 +10:00
Matthew Waters
f2c2717ac7 glvideomixer: add support for the affine transformation meta 2016-04-05 20:50:24 +10:00
Matthew Waters
71877db25f glmixer: set the current texture to 0 before mapping
If we fail mapping, we don't want to use undefined video data in the subclass.
2016-04-05 16:24:53 +10:00
Matthew Waters
efc1299426 glmixerbin: proxy the start-time-* properties from aggregator 2016-04-04 20:54:23 +10:00
Nirbheek Chauhan
3c7906c13b tests/compositor: Add test for aggregator pad numbering
Tests that the behaviour in 7a5cb5a473 is being conformed to.
2016-03-28 13:46:00 +03:00
Vineeth TM
8741806671 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
Matthew Waters
81d724a325 glstereo{mix,split}: allow running on GLES 2/3
It's mostly supported for GLES 2.x, fully supported on GLES 3.x
2016-03-17 02:28:32 +11:00
Matthew Waters
ca15a26c11 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.
2016-03-08 02:06:46 +11:00
Thiago Santos
3d0f8cfc21 tests: compositor: drop special case for valgrind timeout
The default one is 6 minutes, the test was using 5 minutes so just
resort to using the default.

For the non-valgrind test also use the default 20 secs instead of
reducing it to 6s. No real reason to set a custom value here.
2016-02-25 11:43:43 -03:00
Thiago Santos
ea7e099307 tests: compositor: add tests for caps queries
Verifies that proper caps are returned based on what downstream
restricts.
2016-02-25 11:43:43 -03:00
Thiago Santos
86d21e9455 videoaggregator: fix caps queries to allow proper renegotiation
When caps are already negotiated it should be possible to
select formats other than the one that was negotiated. If downstream
allows alpha video caps and it has already negotiated to a non-alpha
format, caps queries should still return the alpha caps as a possible
format as caps renegotiation can happen.

Includes tests (for compositor) to check that caps queries done after
a caps has been negotiated returns complete results

https://bugzilla.gnome.org/show_bug.cgi?id=757610
2016-02-25 11:43:43 -03:00
Wang Xin-yu (王昕宇)
a8862ac440 glmixer: iterator didn't advance in continue statement
Leading to a deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2016-02-24 18:27:44 +11:00
Matthew Waters
0d50d92279 gl: error out if the configured GL API is unsupported by our element
https://bugzilla.gnome.org/show_bug.cgi?id=759801
2016-02-22 20:52:54 +11:00
Wang Xin-yu (王昕宇)
282c7eca06 glvideomixer: don't leak pad's vertex buffer on release_pad
https://bugzilla.gnome.org/show_bug.cgi?id=760873
2016-02-17 10:30:45 +11:00
Matthew Waters
03d1f755fa glmixer: Remove usage of GstGLMixerFrameData
Subclasses can just iterate over the list of pads themselves

https://bugzilla.gnome.org/show_bug.cgi?id=760873
2016-02-17 10:30:45 +11:00
Matthew Waters
a3b2d36abd glmixer: don't hold the object lock while calling into GL
Doing so can deadlock between the GL thread and the object lock e.g.
when performing reconfigure events in glimagesink on a resize event.

https://bugzilla.gnome.org/show_bug.cgi?id=760559
2016-02-17 10:30:45 +11:00
Wang Xin-yu (王昕宇)
18a643d36f glvideomixer: fix checker vbo leak
https://bugzilla.gnome.org/show_bug.cgi?id=760925
2016-02-01 13:55:05 +11:00
Matthew Waters
5a7f92aa51 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)
2016-01-29 14:03:26 +11:00
Matthew Waters
f1323fb6df 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
2016-01-27 20:36:25 +11:00
Matthew Waters
adec074d7e gl: move control binding proxy implementation from glvideomixer
Other elements may need to use it's functionality
2016-01-27 20:01:25 +11:00
Matthew Waters
afdc81fe4d 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
2016-01-13 12:00:03 +11:00
Matthew Waters
353b105816 gldownload: remove helper api from the library
It was never used by anyone and is not needed anymore with the element
and GstGLMemory's transparent support for downloading textures.
2015-12-14 13:55:16 +11:00
Matthew Waters
c5f2c56fe2 glviewconvert: remove set_format
We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output
2015-11-11 15:16:37 +11:00
Tim-Philipp Müller
2dd8148b30 glmixerbin: fix minor leak
Don't leak removed list node.
2015-11-06 13:00:55 +00:00
Luis de Bethencourt
73977da3f9 videoaggregator: use GST_STIME_ARGS for GstClockTimeDiff
No need to manually handle negative values of diff, GST_STIME_ARGS does
exactly this.
2015-11-02 17:00:22 +00:00
Matthew Waters
5b07a52038 glmemory: add support for rectangle textures
Add the various tokens/strings for the differnet texture types (2D, rect, oes)

Changes the GLmemory api to include the GstGLTextureTarget in all relevant
functions.

Update the relevant caps/templates for 2D only textures.
2015-10-30 14:24:53 +11:00
Nirbheek Chauhan
1cdc07b307 glvideomixer: Proxy the ignore-eos videoaggregator property as well
Identical to how the z-order property is proxied
2015-10-06 16:57:53 +01:00
Tim-Philipp Müller
b66af464df videoaggregator: fix compilation with older glib version
Remove weird use of private gtype defines and fix compilation
with older glib versions such as 2.36.

https://bugzilla.gnome.org/show_bug.cgi?id=755754
2015-09-29 14:40:26 +01:00
Matthew Waters
a238af84a0 gl: chain up to the parent class for GstElement::set_context
https://bugzilla.gnome.org/show_bug.cgi?id=705579
2015-09-28 22:24:04 +10:00
Nirbheek Chauhan
4d307bf4e2 check: Add test for videoaggregator sinkpads being sorted by zorder
https://bugzilla.gnome.org/show_bug.cgi?id=754285
2015-09-26 10:31:17 +01:00
Jan Schmidt
d5f2742ad0 Don't throw compiler warnings with G_DISABLE_ASSERT
Disable code that warns about unused variables when G_DISABLE_ASSERT
is defined, as it is in tarballs and pre-releases.
2015-09-18 00:29:51 +10:00
Vineeth T M
78e07d02eb gl: Fix GError leaks during failures
https://bugzilla.gnome.org/show_bug.cgi?id=755140
2015-09-17 11:52:55 +02:00
Sebastian Dröge
895e71e810 videoaggregator: Fix mixup of running times and segment positions
We have to queue buffers based on their running time, not based on
the segment position.

Also return running time from GstAggregator::get_next_time() instead of
a segment position, as required by the API.

Also only update the segment position after we pushed a buffer, otherwise
we're going to push down a segment event with the next position already.

https://bugzilla.gnome.org/show_bug.cgi?id=753196
2015-09-14 19:56:43 +02:00
Thiago Santos
ac503aee7d videoaggregator: fix caps query to properly handle alpha formats
Only accept alpha if downstream has alpha as well. It could
theoretically accept alpha unconditionally if blending is
properly implemented for handle it but at the moment this
is a missing feature.

Improves the caps query by also comparing with the template
caps to filter by what the subclass supports.

https://bugzilla.gnome.org/show_bug.cgi?id=754465
2015-09-11 18:03:26 -03:00
Nirbheek Chauhan
f1f8e465f2 compositor: Ensure all arguments to CLAMP are signed int
If any of the arguments to CLAMP are unsigned integers, the comparison causes
an automatic conversion of the signed int to unsigned, which causes -1 to become
UINT_MAX and get clamped to the high value of the CLAMP instead of 0.

See 716 at http://c0x.coding-guidelines.com/6.3.1.8.html

Also add a test for this.

https://bugzilla.gnome.org/show_bug.cgi?id=754576
2015-09-04 23:32:36 +02:00
Thiago Santos
4eea087f68 videoaggregator: lift restriction of changing pixel-aspect-ratio
The videoaggregator can convert PAR, there is no reason for
restricting it.

https://bugzilla.gnome.org/show_bug.cgi?id=754291
2015-09-03 11:18:22 -03:00
Nirbheek Chauhan
8c06c85d83 compositor: variables in clamp_rectangle() should be signed
x/y/w/h are signed integers. As can be seen in GstCompositorPad.
The prototype for clamp_rectangle was wrong. This commit reverts the change
and fixes the prototype.

This reverts commit bca444ea4a.
2015-08-29 17:27:45 +01:00
Luis de Bethencourt
e4b584b3e5 compositor: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative
number since it is an unsigned integer. Removing that check and only checking if
it is bigger than max by using MIN().

CID 1320707
2015-08-28 15:21:13 +01:00
Nirbheek Chauhan
f12ef34410 compositor: Actually use the output resolution for clamping
The obscured check in compositor was using the dimensions of the pad to clamp
the h/w of the pad instead of the output resolution, and was doing an incorrect
calculation to do so. Fix that by simplifying the whole calculation by using
corner coordinates. Also add a test for this bug which fell through the cracks,
and just skip all the obscured tests if the pad's alpha is 0.0.

https://bugzilla.gnome.org/show_bug.cgi?id=754107
2015-08-26 15:03:05 +03:00
Ben Browitt
708936de49 videoaggregator: Always set the pad's buffer_vinfo when storing a buffer
Otherwise it might be unset, and then the buffer is used and
gst_video_frame_map() will crash because of invalid video-info.

https://bugzilla.gnome.org/show_bug.cgi?id=753805
2015-08-20 14:22:49 +03:00
Matthew Waters
81a78449d5 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.
2015-08-03 20:08:52 +10:00
Olivier Crête
db0a5ece02 videoaggregator: Remove broken _clip vfunc
It never does anything.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-07-30 14:00:05 -04:00
Luis de Bethencourt
7e67bcba2f glstereomix: remove redundant initialization
v is initialized in the for loop init, no need to do it twice. Removing
first initialization.
2015-07-29 17:49:01 +01:00
Sebastian Dröge
dc4c420217 compositor: Add unit tests for the new aggregator start-time-selection property
https://bugzilla.gnome.org/show_bug.cgi?id=749966
2015-07-29 14:35:50 +01:00
Sebastian Dröge
bd66c6b665 aggregator: Add property to select how to decide on a start time
Before aggregator based elements always started at running time 0,
now it's possible to select the first input buffer running time or
explicitly set a start-time value.

https://bugzilla.gnome.org/show_bug.cgi?id=749966
2015-07-29 14:35:50 +01:00
Olivier Crête
b05002776b 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
2015-07-22 20:59:50 -04:00
Julien Isorce
884e68c713 gl: use gst_gl_display_create_context in more elements.
glbasefilter, glbasemixer and gltestsrc.

https://bugzilla.gnome.org/show_bug.cgi?id=750310
2015-07-21 11:37:21 +01:00
Thibault Saunier
df274deb0b videoaggregator: Remove pixel-aspect-ratio field from the caps returned by getcaps
Avoiding not negotiated error while negotiating as we anyway force 1/1
as output
2015-07-06 18:53:38 +02:00
Olivier Crête
50d5d0a161 glvideomixer, glmixer: Add description and klass 2015-07-03 12:28:47 -04:00
Nicolas Dufresne
1c66a33c56 gl: Don't leak pool if set_config failed 2015-07-02 09:40:05 -04:00