Commit graph

709 commits

Author SHA1 Message Date
Julien Isorce
2115f11f0b gl: no need to initialize a frame buffer object to upload an eglimage
Fix https://bugzilla.gnome.org/show_bug.cgi?id=729588
2014-05-06 15:39:12 +01:00
Julien Isorce
65381ee664 gl: use GST_CAT_ERROR instead of GST_ERROR_OBJECT
It fixes segault when GST_DEBUG is at least level 1 and eglCreateImage fails
2014-05-06 15:39:12 +01:00
Julien Isorce
dd8929a272 gl: delete texture used with GstVideoGLTextureUploadMeta 2014-05-06 15:39:12 +01:00
Julien Isorce
73a3c173c7 gl: use gst_gl_context_gen_shader helper instead of duplicating code 2014-05-06 15:35:00 +01:00
Matthew Waters
f19e5abcb8 gl/display: clean up pre gstglcontext api and struct fields
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2014-05-06 21:08:30 +10:00
Matthew Waters
c28dd9b0d3 gl/display: add get_handle_type
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2014-05-06 21:08:30 +10:00
Matthew Waters
1eeecae29e gl/display: avoid opening the X11 display on systems with Cocoa (OS X)
https://bugzilla.gnome.org/show_bug.cgi?id=729551
2014-05-06 21:08:30 +10:00
Matthew Waters
8743301af9 gl/window: fix string length check for eagl 2014-05-06 21:08:30 +10:00
Matthew Waters
b694b292b9 gl/display: check the correct env variable for choosing an egl display
GST_GL_WINDOW is used for window system specific choices.
An EGLDisplay can be created from window systems with egl support by using
eglGetDisplay().

https://bugzilla.gnome.org/show_bug.cgi?id=729551
2014-05-06 21:07:38 +10:00
Edward Hervey
48f770a2df gl/cocoa: Use OBJCFLAGS where needed
Should fix usage of c-compiler-only flags with an objective-c compiler
2014-05-06 12:57:36 +02:00
Matthew Waters
dfc6745143 gl: use the bufferpool's upload when available
Avoids duplicating GL resources

https://bugzilla.gnome.org/show_bug.cgi?id=728872
2014-05-02 15:59:28 +10:00
Julien Isorce
cf509574be gl: show internal cocoa window on top of others
Useful when your OSX terminal is fullscreen

https://bugzilla.gnome.org/show_bug.cgi?id=728127
2014-05-02 06:03:23 +01:00
Matthew Waters
b903c61ceb gl/pool: init the upload object on start
Theoretically, set_config could be called multiple times
2014-05-02 14:16:49 +10:00
Sebastian Dröge
cad1bb32c8 gl: Try harder to load symbols from the correct place
This commit makes the loading of the GModules threadsafe, and
always first tries to load the symbol for the GL library that
is selected for the current context. Only then it falls back
to looking into the current module (NULL), and only as a last
resort the context specific function (e.g. eglGetProcAddress())
is called.

Also add configure parameters to select the names of the library
modules instead of using the defaults, and let the defaults be
independent of the G_MODULE_SUFFIX.

https://bugzilla.gnome.org/show_bug.cgi?id=728753
2014-05-01 14:36:54 +02:00
Matthew Waters
598a79a5e2 gl/mem: implement texture copying between formats with strides properly
Previously, we used the width to determine the amount of data to be
copied using pbos.  This, makes it allocate enough data for the
the strides as well.
2014-05-01 14:00:04 +10:00
Matthew Waters
29ff67a60a gl/mem: pad the public struct 2014-05-01 14:00:04 +10:00
Nicolas Dufresne
441ac82d7f gl: no need to provide full lib path to load symbols
- Make gstgl work on Mali
- Keep it work on RPI
- fallback to NULL name module if fails with usual lib name

https://bugzilla.gnome.org/show_bug.cgi?id=728753
2014-04-30 15:16:06 -04:00
Julien Isorce
64e5b5a203 gl: add convenient functions to setup default vertex and fragment shaders
Most of our 2D filters use the same simple vertex shader.
Also define the default fragment shader as the identity.

Avoid duplicating the same vertex and fragment shader text.
2014-04-30 15:35:49 +01:00
Philippe Normand
eee4f95a1f gl: add missing G_BEGIN/END_DECLS in utils header 2014-04-29 19:24:08 +01:00
Jan Schmidt
4296dc12f7 gl: Reduce noisy Info level output to LOG 2014-04-29 22:19:37 +10:00
Julien Isorce
1525fa8bad gl: use gst_gl_platform_from_string because we support gl shareList on all platforms 2014-04-28 15:59:06 +01:00
Julien Isorce
6a18a1346b glfilter: only warn when other_context attribute is set
Fix false positive
2014-04-28 15:59:06 +01:00
Julien Isorce
9cb3f93b4a gl: fix string literal warning
warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2014-04-28 15:59:06 +01:00
Nicolas Dufresne
70350bd89e gl/x11: Removed unused variable 2014-04-24 13:59:51 -04:00
Sebastian Dröge
eb88f19c10 gl/x11: Get rid of unneeded second display connection and do everything from the main loop 2014-04-24 19:11:31 +02:00
Sebastian Dröge
42a3bb7d6e gl/x11: Block rendering until swapbuffers is called and don't go via X11 events as unneeded indirection
This should fix QoS problems, where basesink believed it was rendering with
20FPS but actually we were just queueing up X11 Expose events and only once
in a while something was rendered.
2014-04-24 19:11:31 +02:00
Julien Isorce
b92b86bdd9 gl/rpi: do not scale to full screen
Having a 640x360 movie being scaled to 1900x1200 does not look nice
2014-04-24 15:26:17 +01:00
Julien Isorce
562399a71a gl/rpi: change dispmanx attributes of existing element instead of creating a new one
I was lucky that:
e1 = vc_dispmanx_element_add ()
eglCreateWindowSurface (e1)
vc_dispmanx_element_remove (e1)
e2 = vc_dispmanx_element_add ()

resulted in having e2 equal to e1. And also having the egl surface
that does not allocate its buffers before the first draw.
2014-04-24 15:26:17 +01:00
Julien Isorce
9bae6a9c2e gl/rpi: ensure the dispmanx element to be opaque
So that we ensure it does not get alpha composited with other
dispmanx elements like the desktop.
2014-04-24 15:26:17 +01:00
Julien Isorce
510040e033 gl/cocoa: pass a NSView to set_window_handle instead of a NSWindow
Fix backwards compatibility

https://bugzilla.gnome.org/show_bug.cgi?id=728451
2014-04-24 10:37:00 +01:00
Julien Isorce
162dfcdf75 gl/cocoa: only draw once the window has been resized
It avoids to draw the first frame with an incorrect view port.
2014-04-24 09:09:20 +01:00
Julien Isorce
aa4bdcd707 gl/cocoa: set the view to use for drawing by the context
It avoids to draw to an invalid buffer.
Withtout this the default frame buffer is undefined:
glBindFramebuffer (GL_FRAMEBUFFER, 0)

Visually you could see some white frames at the beginning
when lunching videotestsrc ! glimagesink

With OpenGL Profiler from XCode you could see some
GL_INVALID_FRAMEBUFFER_OPERATION for the first frames
2014-04-24 09:09:13 +01:00
Julien Isorce
1ced9b1005 gl: fix declaration-definition mismatch for _init_upload 2014-04-23 21:10:07 +01:00
Julien Isorce
453245304d gl/bufferpool: do not reset upload when set_config does not change the caps
With videotestsrc ! glimagesink it was reset 3 times
2014-04-23 21:10:03 +01:00
Julien Isorce
8fd840166b gl: use #ifdef instead of #if for __APPLE__
warning: "__APPLE__" is not defined [-Wundef]

with gcc version 4.7.2 20120731 (prerelease)
    (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08)
2014-04-23 21:09:58 +01:00
Nicolas Dufresne
9205bcdedb glmemory: User g_slice_new0 to ensure fully initilized structure
The pbo pointer not being initialized would trigger a use of unitilialized variable
in valgrind.
2014-04-23 12:42:44 -04:00
Vincent Penquerc'h
6ec86ca1dc gl: prevent division by 0 on unsupported texture type
Coverity 1199697
2014-04-21 13:23:45 +01:00
Jan Schmidt
b2fe0c50ff glcolorconvert: Fix bt709 conversion matrices.
Fix the sign on one entry in the bt.709 YUV->RGB conversion
matrix, and the corresponding inverse matrix. Fixes really
wrong colouring of some videos.
2014-04-21 22:03:15 +10:00
Julien Isorce
d93ed2b870 gl: allow to include GLES/gl.h
https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-04-15 17:40:54 +01:00
Sebastian Dröge
e5d96d052b gl/eagl: Fix compilation 2014-04-13 19:20:32 +02:00
Sebastian Dröge
d3d1b5a5e2 gl/eagl: Notify the window's resize callback about surface dimension changes
https://bugzilla.gnome.org/show_bug.cgi?id=728107
2014-04-13 16:55:26 +02:00
Sebastian Dröge
ef509077db gl/eagl: Remove spurious private struct pointer 2014-04-13 16:55:26 +02:00
Sebastian Dröge
5db4db6836 gl/android: Notify the window's resize callback about surface dimension changes
https://bugzilla.gnome.org/show_bug.cgi?id=728107
2014-04-13 16:55:26 +02:00
Matthew Waters
7f37505503 gl/context: output available extensions 2014-04-13 13:49:22 +10:00
Matthew Waters
24f533fae7 gl/context: provide get_gl_version 2014-04-13 13:44:31 +10:00
Julien Isorce
0586e49726 gl/color: restore viewport dimensions when fbo done
Regression introduced by 95abfda139.
It caused to display the wrong frame size when resizing the window.
2014-04-13 10:00:46 +10:00
Sebastian Dröge
47f7bf269a gl: Import QuartzCore/QuartzCore.h for CAEAGLLayer on older iOS versions 2014-04-12 22:45:30 +02:00
Sebastian Dröge
ae81268565 gl: Add support for iOS EAGL platform
https://bugzilla.gnome.org/show_bug.cgi?id=703341
2014-04-12 22:25:13 +02:00
Julien Isorce
6b2c24d0c4 gl/cocoa: make gst_gl_window_cocoa_send_message_async re-entrant
Backends that use g_main_context_invoke are re-entrant.

Il allows to call two nested gst_gl_context_thread_add.
ex: init_upload / init_colorconvert
2014-04-12 17:33:44 +01:00
Julien Isorce
871ddef9ce gl/cocoa: fix NSAutoreleasePool initialization 2014-04-12 15:51:47 +01:00
Julien Isorce
3c49f0f42a gl/cocoa: ensure to call NSApplication:sharedApplication in the main thread
"(NSApplication *)sharedApplication This method also makes a connection
to the window server and completes other initialization"
The implicit thing which is not mentioned is that it required
to be called in the main thread.

Fix a regression introduces by 82b7c915bb
When using with gst-launch, it was not possible to click on the close
cross of the window anymore which is a bit anoying and also because
it's was possible before.

Prior to this commit the GstGLContextCocoaClass was initialized
in the main thread because gst_gl_context_new was called in the
state change function from going from ready to paused.

From this commit this call is done from the streaming thread.
So that the call to [NSApplication sharedApplication];
was not done in the main thread anymore.

We now ensure that by assuming there is a GMainLoop running.
It's for debugging purpose so that's ok to do that. Also
note we already do this assumtion to run app itereations.

The regression had no consequence on the cocoa/videooverlay example
(that should be moved from gst-plugins-gl to -bad) because the
application is responsible for that necessary call.
2014-04-12 15:46:47 +01:00
Julien Isorce
995db85435 gl/color: fix warning type qualifiers ignored
i686-apple-darwin11-llvm-gcc-4.2
"warning: type qualifiers ignored on function return type"
2014-04-12 14:55:45 +01:00
Matthew Waters
ab9b54efdd gl/color: remove if statement with no effect
Coverity 1199698
2014-04-12 18:24:43 +10:00
Matthew Waters
a05d62d5ca gl/color: pass large value by reference
Coverity 1199700
2014-04-12 18:18:08 +10:00
Matthew Waters
b69e1f42bb gl/mem: cache the stride/unpack length for upload 2014-04-11 17:26:09 +10:00
Matthew Waters
7a424780ce gl/color: explicitly map the buffers we are copying into
Otherwise it may not be downloaded at all.
2014-04-11 17:26:09 +10:00
Matthew Waters
1e948cb42e gl/color: cache the temporary textures 2014-04-11 16:09:09 +10:00
Matthew Waters
d92eb6dbbe gl/mem: provide defines for tokens not defined in GLES2/ancient platforms 2014-04-11 11:04:43 +10:00
Matthew Waters
8cc10a1c9c gl: fixup incorrect number of arguments 2014-04-11 11:03:19 +10:00
Matthew Waters
ad30c8e7e8 gl: fix incorrect usage of g_return_if_fail 2014-04-11 10:55:21 +10:00
Matthew Waters
15d0c04933 gl/mem: allocate the memory per plane
This patch provides the basic infrastructure required for this.
Upload and Download has been ported to this.

Has the nice effect of allowing GstGLMemory to be our
refcounted texture object for any texture type (not just RGBA).

Should not lose any features/video formats.
2014-04-11 10:37:06 +10:00
Matthew Waters
d8b6303c95 gl/eglimage: #if 0 unused code 2014-04-11 10:37:06 +10:00
Matthew Waters
95abfda139 gl: add colorconvert object that converts between color spaces/formats
Currently used by both upload and download objects separately.
2014-04-11 10:37:05 +10:00
Vincent Penquerc'h
cdfce09fb7 gl: fix leaks
As the relevant variables are initialized to 0/NULL, we can loop
over the full range and make sure we free partial allocations
when an error happens partway through initialization.
2014-04-08 15:54:01 +01:00
Matthew Waters
e01e2cce9f gl: pass video info's by reference 2014-04-02 23:05:47 +11:00
Matthew Waters
7d2d3b3b80 gl/glx: use the context's display rather than asking for the window's 2014-04-02 22:53:10 +11:00
Matthew Waters
e58cd96b96 gl: avoid adding a NULL pool to propose allocation 2014-04-02 22:42:50 +11:00
Matthew Waters
14e993e745 gl: fix detection of extensions with GL versions < 3
Mesa, for example returns valid pointers for glGetIntegerv and
glGetStringi even if the gl version is less than that required for
both those functions to supposedly exist.

https://bugzilla.gnome.org/show_bug.cgi?id=727324
2014-04-01 22:02:46 +11:00
Tim-Philipp Müller
0f02311d13 gl: egl: fix distcheck and out of source build 2014-03-28 20:22:43 +00:00
Rico Tzschichholz
d10fcf4d3f build: Fix make dist 2014-03-28 20:02:40 +00:00
Matthew Waters
e356088f15 gl: fix out-of-source builds pt2
21b897de2f did this for x11 and wayland.
Do it for the other backends as well.
2014-03-27 22:03:14 +11:00
Julien Isorce
75c92dc915 gl: only set CAPS_FEATURE_MEMORY_EGL_IMAGE on egl platform 2014-03-27 07:07:01 +00:00
Julien Isorce
218244a040 gl: let the user includes itself our egl headers if needed
Forgot to address this change.

https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-03-26 19:17:03 +00:00
Julien Isorce
0ae3c984aa gl: add EGLImage support
* picked from old libgstegl:
  - GstEGLImageMemory
  - GstEGLImageAllocator
  - last_buffer management from removed GstEGLImageBufferPool

* add-ons:
  - GstEGLImageMemory now old a reference on GstGLContext
    so that it can delete the EGLImage and its gltexture source
    while having the associated gl context being current.
  - add EGLImage support for GstVideoGLTextureUploadMeta which
    mainly call EGLImageTargetTexture2D
  - GstGLBufferPool now supports GstEGLImageAllocator
  - glimagesink / glfilters / etc.. now propose GstEGLImageAllocator
    to upstream

https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-03-26 19:09:13 +00:00
Julien Isorce
6d10548e7f gl: deploy egl headers in gst/gl/egl instead of gst/gl
https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-03-26 14:52:39 +00:00
Julien Isorce
5bb4c4e866 gl: remove commented and unsued code in x11 Makefile.am
https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-03-26 14:52:31 +00:00
Julien Isorce
2893a70aa0 gl: fix crash if _build_extension_string is not called
On GLES2 then (gl->GetIntegerv && gl->GetStringi) is false
regression introduced by cc6df204e2

https://bugzilla.gnome.org/show_bug.cgi?id=703343
2014-03-26 14:51:41 +00:00
Gwenole Beauchesne
21b897de2f gl: fix out-of-source builds.
Always use the locally generated <gst/gl/gstglconfig.h> file.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-03-24 17:56:13 +01:00
Matthew Waters
48ef9402bf gl/download: add support for the bt709 color matrix 2014-03-25 00:50:30 +11:00
Matthew Waters
6d452f60ee gl/upload: add support for the bt709 color matrix 2014-03-25 00:34:13 +11:00
Matthew Waters
9908375fc0 gl: remove explicit reference to X_CFLAGS
They are in GL_CFLAGS if required
2014-03-24 23:19:02 +11:00
Matthew Waters
f55b299826 gl/upload: remove the legacy GL 1.x upload path
uploading requires shaders and fbos available in GL2.
2014-03-24 23:19:02 +11:00
Julien Isorce
cc6df204e2 gl: fallback to glGetString if GL_NUM_EXTENSIONS fails
Need it on MacOSX 10.7.5
2014-03-23 11:02:08 +00:00
Matthew Waters
11e8b3017a gl: and update the Makefile 2014-03-23 01:02:03 +11:00
Matthew Waters
3180899a98 gl: reorganize the extension headers by function rather than api 2014-03-23 00:39:43 +11:00
Matthew Waters
45c94fa750 gl/win32: use the correct include and gst-indent 2014-03-23 00:39:43 +11:00
Wang Xin-yu (王昕宇)
05cb4bc6a5 gl: use wglCreateContextAttribsARB to create share context
https://bugzilla.gnome.org/show_bug.cgi?id=726494
2014-03-20 15:45:02 +11:00
Matthew Waters
58aa3e9d64 gl/mixer: fix download check for failure 2014-03-20 07:01:01 +11:00
Matthew Waters
faa94a8737 gl: silence a critical if upstream does not provide us with meta params 2014-03-20 07:01:01 +11:00
Julien Isorce
fa4ce072ee gl: silence warnings building for RPI related to 'vcos_*'
Similar than 1190a79b19
2014-03-19 14:43:13 +00:00
Julien Isorce
e870244e39 gl: keep only one occurence of '#include <EGL/egl.h>'
To simply maintainance if we need to put specific includes around it.
2014-03-19 14:43:13 +00:00
Руслан Ижбулатов
2a8f52a976 gl: fix the use of always-defined macros
After 2a0f0399ae GST_GL_* macros are always
defined to 0 or 1. Don't use #ifdef ... or #if defined() on them.

https://bugzilla.gnome.org/show_bug.cgi?id=726591
2014-03-18 06:17:03 +00:00
Matthew Waters
a64dd649f5 gl: add GModule libs for win32 2014-03-17 15:16:13 +01:00
Matthew Waters
567820c551 gl: only link against gstegl if we are using egl
Assuming if we are building egl that the egl library is built
2014-03-17 15:06:25 +01:00
Matthew Waters
acf1616251 gl: add path of the gstegl library
Temporary until we merge the two libraries
2014-03-17 14:37:13 +01:00
Matthew Waters
023c10891e Revert "gl: add dep on gstegl"
It was already in _LIBADD

This reverts commit b10a353080.
2014-03-17 14:26:31 +01:00
Matthew Waters
b10a353080 gl: add dep on gstegl
Temporary until we merge the two libraries
2014-03-17 14:12:50 +01:00
Edward Hervey
16e60d0129 gl/cocoa: Fix debug statements and platform 2014-03-17 14:06:53 +01:00
Edward Hervey
0ae0bfcbc7 gl: Fix static build with objective-C
--tag=CC is needed for static build
2014-03-17 12:05:14 +01:00
Matthew Waters
49b37650f6 gl: Add EGLDisplay display subclass 2014-03-17 10:56:39 +01:00