Commit graph

229 commits

Author SHA1 Message Date
Matthew Waters
c827d1f804 glimagesink: clobber the alpha channel by default
this can be disabled with the ignore-alpha property
2015-01-30 15:54:05 +11:00
Alessandro Decina
5f547c5600 gl: initial support for texture targets other than GL_TEXTURE_2D
Make GstGLMemory hold the texture target (tex_target) the texture it represents
(tex_id) is bound to. Modify gst_gl_memory_wrapped_texture and
gst_gl_download_perform_with_data to take the texture target as an argument.

This change is needed to support wrapping textures created outside libgstgl,
which might be bound to a target other than GL_TEXTURE_2D. For example on OSX
textures coming from VideoToolbox have target GL_TEXTURE_RECTANGLE.

With this change we still keep (and sometimes imply) GL_TEXTURE_2D as the
target of textures created with libgstgl.

API: modify GstGLMemory
API: modify gst_gl_memory_wrapped_texture
API: gst_gl_download_perform_with_data
2015-01-30 00:34:08 +11:00
Matthew Waters
6cf97eb221 glwindow: make showing a window explicit
Also fixes the cgl context always displaying a window to render to for
every GstGLContextCocoa created
2015-01-29 22:26:37 +11:00
Edward Hervey
88038884a8 gltestsrc: Ensure variable is initialized before usage
Coverity CID: 1256569
2015-01-23 12:41:29 +01:00
Matthew Waters
ab48bb6f0f glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2015-01-23 16:11:31 +11:00
Sebastian Dröge
80e02cbdf9 Constify some static arrays everywhere 2015-01-21 10:18:50 +01:00
Nicola Murino
907e02cfa9 glimagesink: fix memleak
https://bugzilla.gnome.org/show_bug.cgi?id=743142
2015-01-19 14:33:02 +11:00
Matthew Waters
39e6f621b3 glvideomixer: don't upload if alpha <= 0
Implemented using a upload_buffer vfunc within GstGLMixer allowing
NULL uploaded buffers.
2015-01-15 09:50:02 +11:00
Matthew Waters
d5c3693791 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2015-01-14 22:22:13 +11:00
Tim-Philipp Müller
4e6f8a76f0 glmixer, glvideomixer: update for GstAggregatorPadForeachFunc change 2014-12-30 19:43:43 +00:00
Tim-Philipp Müller
de5604483f glmixer: update for aggregator start/stop vfunc change 2014-12-30 19:26:47 +00:00
Nirbheek Chauhan
888b531940 glvideomixer: Point to compositor for the pad properties documentation 2014-12-27 11:05:17 +00:00
Nicolas Dufresne
9954de1ccd gl: Add support for GstVideoAlignment
This allow saving a copy with libav video decoders or decoders with
similar padding requirement.

https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 12:11:08 -05:00
Matthew Waters
15fc4b9bbe glfiltercube: use a shader everywhere 2014-12-11 19:41:23 +11:00
Matthew Waters
f021549294 gl: fixup vao and vbo usage for legacy GL 2014-12-11 19:41:23 +11:00
Matthew Waters
1d324e259a gleffects: don't abort when setting the effect to 0,1,2 2014-12-11 19:41:23 +11:00
Ramprakash Jelari
26d99a6f3e gl: Rename gst-launch-0.10 to gst-launch-1.0 in docs 2014-12-04 16:25:57 +01:00
Matthew Waters
6361df77e8 glimagesink: properly handle the !opengl3 case
https://bugzilla.gnome.org/show_bug.cgi?id=740012
2014-11-30 00:44:46 +11:00
Tim-Philipp Müller
5299d683ee glfilterapp: fix unused variable compiler warning
When GST_GL_HAVE_OPENGL is 0 or unset.
2014-11-28 16:04:54 +00:00
Matthew Waters
26fc4e2bd5 glfilterapp is now available on gles2 as well so build it 2014-11-28 14:08:40 +11:00
Matthew Waters
820162f84c gl: fix typo in #if
GST_GL_API_HAVE_OPENGL doesn't exist
2014-11-28 11:04:22 +11:00
Matthew Waters
57898fec2a gl: fix various build errors without desktop gl 2014-11-28 10:59:46 +11:00
Matthew Waters
3c1e77eb31 gldisplay: implement runtime GL api filtering
Needed so that the pipeline/application can limit the choice of GL api
to what it supports
2014-11-28 09:14:26 +11:00
Matthew Waters
6bd1150ca8 gl: remove the use of glu 2014-11-28 09:14:26 +11:00
Matthew Waters
f2af65ee2d gl: add a sync meta for synchronizing across GL contexts
A context can create a GLsync object that can be waited on in order
to ensure that GL resources created in one context are able to be
used in another shared context without any chance of reading invalid
data.

This meta would be placed on buffers that are known to cross from
one context to another.  The receiving element would then wait
on the sync object to ensure that the data to be used is complete.
2014-11-28 09:14:25 +11:00
Matthew Waters
18ae2d35e9 glfilterapp: port to gles2 and gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
1331cbc54e gloverlay: support gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
45ac7be402 glvideomixer: add support for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
d661fb959e glfiltercube: add a gl3 code path 2014-11-28 09:14:25 +11:00
Matthew Waters
67762e8d58 glfiltershader: support gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
3772c83f94 gltransformation: support gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
dd80a40604 gleffects: support gl3 whereever gles2 is supported 2014-11-28 09:14:25 +11:00
Matthew Waters
f2d1f7dd0f glcolorscale: support gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
f0d2346c52 glimagesink: use vbo's and vao's for gl3 2014-11-28 09:14:25 +11:00
Thibault Saunier
9d8055186d videoaggregator: Expose vmethods to set converters and prepare/clean frames
This gives more flexibility to the subclasses and permits to remove the
GstVideoAggregatorClass->disable_frame_conversion ugly API.

WARNING: This breaks the API as it removes the disable_frame_conversion
field

API:
  + GstVideoAggregatorClass->find_best_format
  + GstVideoAggregatorPadClass->set_format
  + GstVideoAggregatorPadClass->prepare_frame
  + GstVideoAggregatorPadClass->clean_frame

  - GstVideoAggregatorClass->disable_frame_conversion

https://bugzilla.gnome.org/show_bug.cgi?id=740768
2014-11-27 19:10:58 +01:00
Matthew Waters
a7ce611970 glimagesink: only attempt a resize when the window has already resized
fixes a black startup screen on wayland
2014-11-27 13:03:21 +11:00
Matthew Waters
810d38c29f glupload: rearchitecture for non GLMemory inputs/outputs
Allows other memory types to be implemented/returned/used by the caller.
2014-11-23 17:13:36 +11:00
Vineeth T M
47f3a1954e glimagesink: critical error while seek playback-test(stop state)
If we seek when media is in stop state, playback-test gives
critical error, since context of glimagesink is destroyed during stop.
But since context is not present, we need not handle send_event in glimagesink
Hence adding a condition to check if context is valid.

https://bugzilla.gnome.org/show_bug.cgi?id=740305
2014-11-20 15:39:42 +11:00
Matthew Waters
df12001781 glmixer: add read-only context property 2014-11-17 18:50:04 +11:00
Matthew Waters
5c48440c9a glimagesink: don't set the upload to NULL on the drain query
https://bugzilla.gnome.org/show_bug.cgi?id=732694
2014-11-12 11:44:43 +11:00
Julien Isorce
004a414b4a glimagesink: release stored buffers on drain query
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732694
2014-11-12 00:08:04 +00:00
Matthew Waters
36ade75f4a gl: remove the width/height fields from the caps to support frame resizing
It was previously only occuring with sysmem caps features

https://bugzilla.gnome.org/show_bug.cgi?id=739334
2014-11-11 14:23:55 +11:00
Alessandro Decina
7d48fe1c1e glimagesink: don't make gst_glimage_sink_handle_events call _ensure_gl_setup
gst_glimage_sink_handle_events can be called from the overlay interface and from
the main thread before GL is setup. Before this change, that would call
_ensure_gl_setup() and deadlock on OSX.

Change things so that it's always safe to call gst_glimage_sink_handle_events()
without stuff deadlocking.
2014-11-07 00:22:09 +01:00
Alessandro Decina
b60fe0271f glimagesink: fix possible deadlock on osx
Remove gst_glimage_sink_handle_events call in gst_glimage_sink_init. It was
unnecessary and when the element was instantiated from the main thread, caused a
deadlock in OSX creating the context (thread).
2014-11-07 00:22:09 +01:00
Matthew Waters
7e62c790d2 glimagesink: clamp the resize width/height to >= 1 to avoid a GL error 2014-11-07 10:03:08 +11:00
Lubosz Sarnecki
6702811e14 glimagesink: implement gst_video_overlay_handle_events
https://bugzilla.gnome.org/show_bug.cgi?id=736035
2014-11-06 16:04:11 +11:00
Matthew Waters
0537cbfa5b glimagesink: resize the viewport correctly on a caps change
with force-aspect-ratio=true, if the width or height changed, the
viewport wasn't being updated to respect the new video width and height
until a resize occured.
2014-10-31 21:29:26 +11:00
Matthew Waters
d6247993f7 glmixer: advertise support for changing input caps mid-stream
https://bugzilla.gnome.org/show_bug.cgi?id=739334
2014-10-31 21:29:25 +11:00
Matthew Waters
a4af98b8c6 glmixer: don't get the current caps from GstVideoInfo for the srcpad
It's missing the caps features needed.
2014-10-30 23:08:00 +11:00
Lubosz Sarnecki
27da1e5aaf satisfy gst-indent 2014-10-29 23:42:54 +11:00
Jan Schmidt
70e4d4123c glfiltercube: Fix typo in property description 2014-10-29 23:23:13 +11:00
Wang Xin-yu (王昕宇)
a9d13db8c6 glmixer:fix incorrect parameter passed to handle_set_context 2014-10-29 20:43:31 +11:00
Matthew Waters
9ac74f6226 glmixer: override the caps query in order to 'convert' capsfeatures
Otherwise, it is only possible for the sink pads and the src pads to
have the exact same caps features.  We can convert from any feature
to another feature so support that.
2014-10-24 00:35:22 +11:00
Matthew Waters
7d9044cf05 glmixer: override the accept caps query in order to 'convert' capsfeatures
Otherwise, it is only possible for the sink pads and the src pads to
have the exact same caps features.  We can convert from any feature
to another feature so support that.
2014-10-23 23:58:33 +11:00
Matthew Waters
e40d70c69a gl: propogate other-context using GstContext 2014-10-23 23:58:33 +11:00
Matthew Waters
73a484d500 glmixer: fixup eglimage include path 2014-10-21 06:04:10 +11:00
Matthew Waters
2e49c99db3 glbufferpool: add the GstVideoGLTextureUploadMeta buffer pool option 2014-10-21 02:00:09 +11:00
Matthew Waters
f0caf04ad6 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
2014-10-21 01:14:36 +11:00
Matthew Waters
771b94b3ca gldeinterlace: ref the uploaded buffer
Instead of the possibly non-GL input buffer.
2014-10-14 16:54:01 +02:00
Sebastian Dröge
302034ac4c glimagesink: Only finalize the other context in finalize()
Otherwise we change a value of a property when going to READY state,
which is unexpected behaviour.
2014-10-13 13:28:57 +02:00
Sebastian Dröge
dbdeed9b15 glmixer: Call the pad's parent class finalize method 2014-10-13 13:27:55 +02:00
Sebastian Dröge
f1fd536dc4 glmixer: Only finalize the other context in finalize()
Otherwise we change a value of a property when going to READY state,
which is unexpected behaviour.
2014-10-13 13:27:11 +02:00
Sebastian Dröge
fe3fafe652 gltestsrc: Add other-context property 2014-10-13 13:25:42 +02:00
Sebastian Dröge
d8a262a589 glimagesink: Don't leak other-context 2014-10-13 11:57:22 +02:00
Sebastian Dröge
3efaa0dec0 glmixer: Add other-context property 2014-10-13 11:57:22 +02:00
Vivia Nikolaidou
7872359239 gloverlay: And fix another unused variable compiler warning 2014-10-08 21:51:12 +03:00
Vivia Nikolaidou
b8d64301af gloverlay: Fix unused variable compiler warning when compiling without desktop GL 2014-10-08 21:49:59 +03:00
Wang Xin-yu (王昕宇)
e6212f5156 gltestsrc: implement checkers pattern with GLSL
https://bugzilla.gnome.org/show_bug.cgi?id=737505
2014-10-07 23:41:38 +11:00
Lubosz Sarnecki
04034b11f4 gltransformation: graphene multiplication order has changed
https://bugzilla.gnome.org/show_bug.cgi?id=733510
2014-09-30 22:11:35 +10:00
Matthew Waters
d1360ef2c7 glvideomixer: update element documentation 2014-09-30 20:39:36 +10:00
Matthew Waters
3ab17dfbe3 Revert accidental push: "gltestsrc: implement checkers pattern with GLSL"
This reverts commit eae09179f0.
2014-09-29 00:27:30 +10:00
Wang Xin-yu (王昕宇)
eae09179f0 gltestsrc: implement checkers pattern with GLSL 2014-09-28 21:43:34 +10:00
Matthew Waters
b658f04d6c gloverlay: fix zero output frames with YUY2/UYVY
also, be nice and disable blending for other elements
2014-09-26 22:29:56 +10:00
Matthew Waters
720ba932c9 gloverlay: protect desktop gl specific tokens with #if 2014-09-26 22:22:06 +10:00
Matthew Waters
eaa424cec7 gloverlay: free the image memory every time the location changes
fixes a memory leak
2014-09-26 12:28:55 +10:00
Sebastian Dröge
9c6c82887f gloverlay: Include into the build with GLES2 only too 2014-09-25 20:48:59 +03:00
Matthew Waters
7e69750336 gltestsrc: free the shader on stop 2014-09-26 01:59:44 +10:00
Matthew Waters
acb21cdb83 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).
2014-09-26 01:59:43 +10:00
Matthew Waters
7b3024c387 gloverlay: reimplement everything
- update for shaders
 - add alpha property
 - image placement properties shamelessly borrowed from gdkpixbufoverlay
 - image placement properties are GstController able
 - use GstGLMemory for the overlay image data
 - add support for gles2
2014-09-26 01:59:43 +10:00
Matthew Waters
9f953f297f glvideomixer: skip input frames with an alpha of 0 2014-09-24 14:31:19 +10:00
Matthew Waters
c44352b11f gl: download whenever we have sysmem capsfeatures
Otherwise we could pass on a RGBA formatted buffer and downstream would
misinterpret that as some other video format.

Fixes pipelines of the form

    gleffects ! tee ! xvimagesink
2014-09-24 13:16:30 +10:00
Lubosz Sarnecki
b2398e3fd1 gltestsrc: add Mandelbrot fractal pattern.
https://bugzilla.gnome.org/show_bug.cgi?id=735131
2014-09-24 00:40:57 +10:00
Lubosz Sarnecki
3736f944b5 gltestsrc: implement snow pattern with GLSL.
https://bugzilla.gnome.org/show_bug.cgi?id=735131
2014-09-24 00:40:37 +10:00
Matthew Waters
5b8d7a443e glupload: provide the output buffer that is rendered into
Allows callers to properly reference count the buffers used for
rendering.

Fixes a redraw race in glimagesink where the previous buffer
(the one used for redraw operations) is freed as soon as the next
buffer is uploaded.

1. glimagesink uploads in _prepare() to texture n
1.1 glupload holds buffer n
2. glimagesink _render()s texture n
3. glimagesink uploads texture n+1
3.1 glupload free previous buffer which deletes texture n
3.2 glupload holds buffer n+1
4. glwindow resize/expose
5. glimagesink redraws with texture n

The race is that the buffer n (the one used for redrawing) is freed as soon as
the buffer n+1 arrives.  There could be any amount of time and number of
redraws between this event and when buffer n+1 is actually rendered and thus
replaces buffer n as the redraw source.

https://bugzilla.gnome.org/show_bug.cgi?id=736740
2014-09-21 21:36:49 +10:00
Sanjay NM
a1ae26acbd gl: Removed unreachable break, unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=736957
2014-09-19 21:48:14 +10:00
Ognyan Tonchev
66967bb203 gltestsrc: do not leak pool in error cases
https://bugzilla.gnome.org/show_bug.cgi?id=736730
2014-09-16 12:48:43 +03:00
Ognyan Tonchev
31703f9ac3 glmixer: do not leak pool in error cases
https://bugzilla.gnome.org/show_bug.cgi?id=736729
2014-09-16 12:48:01 +03:00
Lubosz Sarnecki
f1b026c480 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
2014-09-05 09:39:34 +10:00
Sebastian Dröge
e4b084acd9 glimagesink: Add missing break to switch
CID 1232801
2014-08-28 16:42:30 +03:00
Lubosz Sarnecki
ddaaff3376 glimagesink: expose context
* expose context in draw / reshape callbacks
* add context property

https://bugzilla.gnome.org/show_bug.cgi?id=734482
2014-08-21 17:38:57 +10:00
Matthew Waters
30ddb384ab glmixer: unref the GstGLUpload in the pad if freed while running
Dynamic pipelines that get and release the sink pads will finalize
the pad without going through gst_gl_mixer_stop() which is where the
upload object is usually freed.  Don't leak objects in such case.
2014-08-19 17:01:36 +10:00
Wang Xin-yu (王昕宇)
98152017b7 glvideomixer: avoid gl resource race condition between different thread
https://bugzilla.gnome.org/show_bug.cgi?id=734830
2014-08-19 17:00:58 +10:00
Matthew Waters
0b0c116327 glvideomixer: don't clobber unnecessary GstVideoInfo fields
otherwise we might clobber other important fields such as the frame rate.
2014-08-19 14:44:29 +10:00
Matthew Waters
510a016c88 glvideomixer: get the attribute from the correct shader 2014-08-19 14:43:42 +10:00
Matthew Waters
c6706adfcc glimagesink: unref the window on navigation event
plugs a memory leak
2014-08-19 14:24:02 +10:00
Tim-Philipp Müller
c81a2d1c6c opengl: update element docs for 1.x 2014-08-10 18:07:28 +01:00
Matthew Waters
dab074899e glvideomixer: add a background property
That's compatible with the compositor/videomixer property

https://bugzilla.gnome.org/show_bug.cgi?id=731954
2014-08-07 19:21:02 +10:00
Vasilis Liaskovitis
4dacc4ba55 GstGLWindow, GstGLImagesink, x11: Scale navigation events on resized windows
If window is resized, GstStructure pointer values have to be rescaled to
original geometry. A get_surface_dimensions GLWindow class method is added for
this purpose and used in the navigation send_event function.

https://bugzilla.gnome.org/show_bug.cgi?id=703486
2014-08-07 13:55:02 +10:00
Matthew Waters
707cb58004 gl: document GST_GL_* environment variables
https://bugzilla.gnome.org/show_bug.cgi?id=733245
2014-08-01 16:43:47 +10:00
Matthew Waters
13960f0043 glimagesink: keep the uploaded buffer around on successful redisplay
We might need it later to perform a redisplay.  GstGLUpload will take
of releasing the previous buffer when it receives a new buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=733726
2014-07-29 13:25:22 +10:00