Solved with a simple shader templating mechanism and string replacements
of the necessary sampler types/texture accesses and texture coordinate
mangling for rectangular and external-oes 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.
Currently float and int are supported by default. vec2, vec3, vec4
and mat4 are supported if graphene is used. Of course if one wants
to set custom uniforms they can also be set using the create-shader
signal.
One may not have an GstGLContext available or current in the thread where one
would need to update the shader. Support this by signalling create-shader
whenever the one-shot 'update-shader' is set to TRUE.
A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program. The uniform/attribute
interface has remained the same.
This allow properly copying selected meta, like the composition
overlay. Note that output buffer need to be readable, but GlUpload
keeps a ref. For now, simply drop GlUpload ref after perform,
leaving that ref has no purpose. The method shall be removed
in the future.
https://bugzilla.gnome.org/show_bug.cgi?id=754047
Use base class default method instead of only copying flags and
timestamp. This way, selected meta's like compostion overlay will
be passed downstream as expected.
https://bugzilla.gnome.org/show_bug.cgi?id=754047
During allocation query, when this element is not passthrough, it must
relay the overlay compostion meta and it's parameters. Fortunatly, base
transform can do this for us.
https://bugzilla.gnome.org/show_bug.cgi?id=753850
The current code was ignoring the par/dar aspect when transforming
from window coordinates to stream coordinates resulting in incorrect
coordinates being sent upstream in the navigation events.
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
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.