Commit graph

25 commits

Author SHA1 Message Date
Matthew Waters
afd3624b28 gltransformation: reconfigure the src when changing to/from passthrough
Otherwise it's very possible that any GL resources have not been created yet.
2017-12-09 19:32:16 +00:00
Matthew Waters
0e928db89e gltransformation: always build a valid mvp matrix
The default case is to build an identity matrix.
2017-12-09 19:32:14 +00:00
Matthew Waters
e8544db8cf gltransformation: support negative scales
A scale of -1.0 means to flip the video.
2017-12-09 19:32:14 +00:00
Matthew Waters
d05bd79042 gltransformation: implement passthrough handling 2017-12-09 19:32:14 +00:00
Matthew Waters
1fe2996b01 gltransformation: implement navigation events
Reverses the transformation applied through the properties and forwards the
event.

The process for finding the coordinates on the video are as follows:
1. Convert the given pointer_x and pointer_y to model space at the near and far planes
2. Get the equation of the video plane
3. Find where the ray in 1 intersects the plane
4. Profit!
2017-12-09 19:32:14 +00:00
Vineeth TM
0061913f08 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
2017-12-09 19:32:12 +00:00
Matthew Waters
a1cc1116b5 gltransformation: clear to transparent
Otherwise composition will result in a black frame outside the transformed
video.
2017-12-09 19:32:12 +00:00
Lubosz Sarnecki
6a58c684a7 gltransformation: implement pivot point for rotation and scale
https://bugzilla.gnome.org/show_bug.cgi?id=744763

Add a pivot vector for setting the origin of rotations and scales.

With the pivot point the rotation and scale operations can have
different origins. This adds the ability to rotate around different points.
Currently the default (0, 0) pivot point is possible,
a rotation around the center, and zooming into and out of the center.

With an pivot point this is optional.
I defined the following image coordinates for the pivot point:

	 (-1,1) ------------------------- (1,1)
		|			|
		|			|
		|			|
		|	  (0,0)		|
		|			|
		|			|
		|			|
	(-1,-1) ------------------------- (1,-1)

Example:

	Rotate the video at the bottom left corner

	gst-launch-1.0 videotestsrc \
			! gltransformation \
		 		scale-x=0.5 \
				scale-y=0.5 \
				rotation-z=25.0 \
				pivot-x=-1.0 \
				pivot-y=-1.0 \
			! glimagesink

The pivot-z option defines the pivot point in 3D space.
This only affects rotation, since we have no Z data to scale.
With this option a video can be rotated around a point in 3D space.

Example:

	Rotate around point behind the video:

    	gst-launch-1.0 videotestsrc \
			! gltransformation \
				rotation-x=10.0 \
				pivot-z=-4.0 \
			! glimagesink
2017-12-09 19:32:07 +00:00
Matthew Waters
e4af6201c0 gltransformation: correct vao usage
keep the vao bound after uploading the new vertex data

fixes a mesa GL error "no vertex array object bound" on caps changes
2017-12-09 19:32:05 +00:00
Matthew Waters
1d796508e8 gltransformation: fix DrawElements call for element array buffers
https://bugzilla.gnome.org/show_bug.cgi?id=749734
2017-12-09 19:32:02 +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
Matthieu Bouron
cf438d7def gltransformation: Unref shader in ::stop() 2017-12-09 19:32:00 +00:00
Sebastian Dröge
ee6bfe0127 glfilter: De-camelcase onInitFBO() vfunc 2017-12-09 19:31:59 +00:00
Lubosz Sarnecki
590c7032d8 gltransformation: don't initialize multiple shaders on renegotiation
https://bugzilla.gnome.org/show_bug.cgi?id=748407

* delete shader if one exists
* set it to NULL after unrefing
2017-12-09 19:31:59 +00:00
Lubosz Sarnecki
85d9185b0c gltransformation: fix shader memory leak 2017-12-09 19:31:59 +00:00
Matthew Waters
92f0aa9bd8 gl: get the context from basemixer/basefilter 2017-12-09 19:31:57 +00:00
Xavier Claessens
7fac5085e6 gltransformation: normalize translations
https://bugzilla.gnome.org/show_bug.cgi?id=744763

* Lubosz: use maxfloat for transformation range
2017-12-09 19:31:56 +00:00
Xavier Claessens
1250285b30 gltransformation: Fix doc typo
https://bugzilla.gnome.org/show_bug.cgi?id=744763
2017-12-09 19:31:56 +00:00
Nicolas Dufresne
345f1dfb64 gltransform: Fix includes of graphene headers
The graphene-1.0 part should not be in the source code. This directory
is part of the cflags include. This is similar to gstreamer-1.0/
directory. This break compilation if the include directory where
graphene is installed is not in your include path.
2017-12-09 19:31:55 +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
f99e9d01a9 gltransformation: support gl3 2017-12-09 19:31:51 +00:00
Lubosz Sarnecki
28d4d57180 gltransformation: graphene multiplication order has changed
https://bugzilla.gnome.org/show_bug.cgi?id=733510
2017-12-09 19:31:47 +00:00
Lubosz Sarnecki
e3aa918032 gltransformation: fix issues and expose mvp matrix
* aspect should not be 0 on init
* rename fovy to fov
* add mvp to properties as boxed graphene type
* fix transformation order. scale first
* clear color with 1.0 alpha

https://bugzilla.gnome.org/show_bug.cgi?id=734223
2017-12-09 19:31:46 +00:00
Lubosz Sarnecki
7e6962c95e opengl: add element for transforming video geometry
* add graphene as soft dependency for linear algebra
2017-12-09 19:31:43 +00:00