Commit graph

50 commits

Author SHA1 Message Date
Matthew Waters
956c4d0bde gl/format: use our own GL format enum's instead of gstvideo's
They can describe in more detail (such as component sizes) the requested format.
2017-03-13 21:10:58 +11:00
Sebastian Dröge
2132ba9a94 qml: Add support for Vivante EGL FS windowing system
https://bugzilla.gnome.org/show_bug.cgi?id=778825
2017-02-27 10:42:05 +02:00
Sebastian Dröge
bba07f3c35 qt: The code requires at least C++11
... and clang requires this to be specified on the commandline while gcc
nowadays defaults to C++11 or even newer.
2017-01-25 19:21:03 +02:00
Matthew Waters
4315a4b54d gl/utils: also take care of the local GL context in query functions
Simplifies a deduplicates a lot of code in elements retrieving/setting
the local OpenGL context.
2017-01-13 11:20:51 +11:00
Haihua Hu
afa9c57a52 qmlglsrc: use glBlitFramebuffer to copy texture for GLES3.0
If support glBlitFrameBuffer, use it for texture copy instead
of glCopyTexImage2D

https://bugzilla.gnome.org/show_bug.cgi?id=777078
2017-01-10 21:34:30 +11:00
Tim-Philipp Müller
0489f4eac5 qt: improve element and property descriptions a bit 2016-12-17 13:42:34 +00:00
Sergey Borovkov
d694184524 qml: Fix egl being deinitialized on display cleanup
Use the with_egl_display() variant in order to not destroy the
EGLDisplay on destruction.

https://bugzilla.gnome.org/show_bug.cgi?id=775793
2016-12-09 21:44:05 +11:00
Matthew Waters
afae1c53d2 qml/item: also unref the display on destruction
Leaking objects (and a thread!) is never a good idea.

https://bugzilla.gnome.org/show_bug.cgi?id=775746
2016-12-07 23:02:02 +11:00
Haihua Hu
e570f729c4 qmlglsrc: some enhancements for qmlglsrc
1. Need set use-default-fbo to qquickwindow during set property
   to support change render target on the fly.
2. Calculate qmlglsrc refresh frame rate in qtglwindow

https://bugzilla.gnome.org/show_bug.cgi?id=774035
2016-11-08 02:05:20 +11:00
Matthew Waters
41a6448918 gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2016-11-03 16:16:12 +11:00
Sergey Borovkov
950a7945e4 qt: Fix failing build on RPI
https://bugzilla.gnome.org/show_bug.cgi?id=773026
2016-10-18 11:25:03 +11:00
Haihua Hu
f15a3e3657 qmlglsink: check qt_context_ first in GstQSGTexture::bind()
When start qmlglsink app, it will set NULL buffer to GstQSGTexture
in which case that qt_context_ will be a random value and cause
gst_gl_context_activate() fail.

https://bugzilla.gnome.org/show_bug.cgi?id=770925
2016-09-07 00:15:02 +10:00
Jan Schmidt
117f81dc00 qt: Use wglShareLists() workaround unconditionally.
Sometimes wglCreateContextAttribsARB() exists, but
isn't functional (some Intel drivers), so it's
easiest to do the workaround unconditionally.
2016-08-16 00:53:38 +10:00
Jan Schmidt
23fc5e31b0 qt: Move debug statement to after the category init
Don't output debug to an uninitialised debug category.
2016-08-16 00:43:39 +10:00
Haihua Hu
0b23bb5a59 qt: implement qmlglsrc for qml view grab
[Matthew Waters]: gst-indent sources

https://bugzilla.gnome.org/show_bug.cgi?id=768160
2016-08-03 22:11:11 +10:00
Tim-Philipp Müller
013eaee06b qt: fix build some more when QPA is not available
Compiler would complain about include directory that didn't
exist because QPA_INCLUDE_PATH gets subst-ed regardless
(and if it didn't we'd have just an empty -I argument).

https://bugzilla.gnome.org/show_bug.cgi?id=767553
2016-07-01 19:29:49 +01:00
Haihua Hu
d60b071474 qmlglsink: Fix build error when don't have QPA installed.
Check header file existance and wrap the header file include
in the necessary #ifdef to avoid build error.

https://bugzilla.gnome.org/show_bug.cgi?id=767553
2016-06-27 22:44:56 +10:00
Matthew Waters
ba69afdc47 qmlglsink: add win32 support
The current state of c++ ABI's on Window's and Gst's/Qt's conflicting
mingw builds means that we cannot use mingw for building the qt plugin.

Instead, a qmake .pro file is provided that is expected to be used with the
msvc binaries provided by Qt like so:

(with the PATH environment variable containing the path to the qt biniaries
and PKG_CONFIG_PATH containing the path to GStreamer modules)
cd /path/to/sources/gst-plugins-bad/ext/qt
qmake -tp vc

Then open the resulting VS project and build the library.  Then

cp debug/libgstqtsink.dll /path/to/prefix/lib/gstreamer-1.0/libgstqtsink.cll

https://bugzilla.gnome.org/show_bug.cgi?id=761260
2016-06-22 14:26:05 +10:00
Sergey Borovkov
180405714c qml: Enable qmlglsink for eglfs
https://bugzilla.gnome.org/show_bug.cgi?id=763044
2016-06-16 01:49:16 +10:00
Matthew Waters
14c6fece09 qmlglsink: propagate GL context creation failure upwards
Otherwise an application cannot know if the qmlglsink will be displaying frames
incorrectly/at all.
2016-06-16 01:49:16 +10:00
Matthew Waters
ef508b8461 qmlglsink: also allow wayland-egl as a platform name 2016-06-16 01:49:16 +10:00
Haihua Hu
3903406304 qmlglsink: Add Wayland support
Don't use gstgldisplay to get wayland display. Should use QPA on wayland
to get wayland display for QT.

https://bugzilla.gnome.org/show_bug.cgi?id=767553
2016-06-16 01:49:16 +10:00
Vineeth TM
8cdfb13658 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
Sergey Borovkov
7981c1cb86 qml: Fix leak of the OpenGL contexts
[Matthew Waters]: add NULL checks before unreffing

https://bugzilla.gnome.org/show_bug.cgi?id=762999
2016-03-03 13:13:26 +11:00
Matthew Waters
c086540291 qt: use a static_cast instead of dynamic one
The dynamic_cast is a little but of overkill as the app will still crash if it
fails in the later g_assert.

Allows compilation with -fno-rtti

https://bugzilla.gnome.org/show_bug.cgi?id=762526
2016-02-24 21:20:18 +11:00
Sergey Borovkov
0d80be0ce0 qmlglsink: Schedule onSceneGrpahInitialized to execute on render thread
onSceneGraphInitialized() is called from non render thread currently when
scene graph is already initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=761003
2016-02-22 20:26:41 +11:00
Matthew Waters
6ab40e8531 qt: specify that we currently only take 2D textures
Fixes black screen video playback on android without a caps filter.
2016-01-27 16:13:28 +11:00
Sergey Borovkov
155f0acfab qml: Mark material dirty when texture buffer is updated
Qt might not redraw the scene otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=758286
2016-01-15 14:11:52 +11:00
Nicolas Dufresne
516047f66f qtsink: Add configured GL cflags to the build
We don't directly link to GL in the element, though we use GL headers.
For this reason we need to include the proper GL headers path. This
prevent this element from using a different GL header then libgstgl.
2015-12-15 19:28:22 -05:00
Matthew Waters
2b7495bbc1 glmemory: base classify and add the pbo memory on top
The base class is useful for having multiple backing memory types other
than the default.  e.g. IOSurface, EGLImage, dmabuf?

The PBO transfer logic is now inside GstGLMemoryPBO which uses GstGLBuffer
to manage the PBO memory.

This also moves the format utility functions into their own file.
2015-12-14 16:35:32 +11:00
Roman Nowicki
21348cf772 qml: reuse existing GstQSGTexture
Fixes a memory leak leaking the texture objects.

https://bugzilla.gnome.org/show_bug.cgi?id=758286
2015-11-20 11:18:43 +11:00
Matthew Waters
33d98ddf48 qml: activate the wrapped context when binding
Mitigates the following critical

gst_gl_context_thread_add: assertion 'context->priv->active_thread == g_thread_self ()' failed
2015-11-20 11:09:45 +11:00
Roman Nowicki
27c94f3375 qml: proper initialization if scene is already initialized
The scene graph can be initialized when the we receive window handle change
notification and so we will not receive a scenegraph initialization
notification.  Initialize ourself in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=758337
2015-11-20 09:41:56 +11:00
Matthew Waters
3dfc6899ad gl: be consistent in gobject boilerpate
GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'
2015-10-19 15:15:30 +11:00
Matthew Waters
30194cc368 qt: add support for building on osx/ios
Including:
- Necessary configure checks
- Necessary compile time platform checks
- Necessary runtime qt iOS/OSX platform detection

https://bugzilla.gnome.org/show_bug.cgi?id=755100
2015-10-02 22:29:45 +10:00
Luis de Bethencourt
ff8f648f37 qtsink: explicitely fallthrough switch statement
In case ret is False, fallthrough to default case.

CID #1320705
2015-09-29 13:37:08 +01:00
Luis de Bethencourt
86151cbf06 qml: remove overwritten value
Value in tex is overwritten before being used. Removing it.

CID 1320715

https://bugzilla.gnome.org/show_bug.cgi?id=754253
2015-09-28 18:17:22 +10:00
Matthew Waters
18d5ed0408 qt: add support for building/running on android
Including:
- Necessary configure checks
- Necessary compile time platform checks
- Necessary runtime qt android platform detection
- Escaping GLsync definition with Qt's GLES2 implementation

https://bugzilla.gnome.org/show_bug.cgi?id=754466
2015-09-28 16:47:00 +10:00
Matthew Waters
f12caa5c22 qt: don't use CPPFLAGS for tools that cannot use them
For example moc will bail out when given arguments it does not
know about.  The moc specific MOC_CPPFLAGS can still be used
to pass flags to moc.

https://bugzilla.gnome.org/show_bug.cgi?id=754466
2015-09-28 16:47:00 +10:00
Matthew Waters
fdf2a73ec0 qt: rename library to include gst prefix
libqtsink -> libgstqtsink

https://bugzilla.gnome.org/show_bug.cgi?id=754466
2015-09-28 16:47:00 +10:00
Matthew Waters
38d360675c gtk, qt: more specifically define the compile time requirements
Otherwise we could include headers/configurations that will
never been installed.

https://bugzilla.gnome.org/show_bug.cgi?id=754732
2015-09-10 13:11:06 +10:00
Matthew Waters
bca1fd1040 qt: use our function table instead of directly calling gl functions
Otherwise when building with --as-needed we would need to link to
a GL or GLES library.

https://bugzilla.gnome.org/show_bug.cgi?id=754732
2015-09-10 00:33:40 +10:00
Nirbheek Chauhan
77f68f6e10 qmlsink: Ensure that at least one windowing system is available
Otherwise, we'll just crash at runtime because the gl context is NULL

https://bugzilla.gnome.org/show_bug.cgi?id=754108
2015-08-31 23:16:07 +01:00
Tim-Philipp Müller
1cb3e8c591 gtk, qt, gl: fix typo in debug and error messages 2015-08-31 18:06:31 +01:00
Matthew Waters
6b8cf8419d qml: implement the required multiple GL context synchonisation
From GStreamer's GL context into the QML context
2015-08-08 17:30:42 +02:00
Edward Hervey
3b751bf775 qt: Don't dist files that might not exist
We only require moc building at build time.
2015-07-22 15:14:28 +02:00
Edward Hervey
5f8633b6f3 qt: Tidy up makefile a bit more
Separate generated files, from disted files
2015-07-22 08:06:19 +02:00
Matthew Waters
d5996de5d7 glcontext: fix get_current_gl_api on x11/nvidia drivers
They require to get_proc_address some functions through the
platform specific {glX,egl}GetProcAddress rather than the default
GL library symbol lookup.
2015-07-18 18:18:22 +10:00
Edward Hervey
7cb734b1cd configure/qt: Fix build without Qt5X11Extras 2015-07-10 14:01:59 +02:00
Matthew Waters
769fffa3d9 new qt5 qml GL video sink
Very much in the same spirit as the Gtk GL sink

Two things are provided
1. A QQuickItem subclass that renders out RGBA filled GstGLMemory
   buffers that is instantiated from qml.
2. A sink element that will push buffers into (1)

To use
1. Declare the GstGLVideoItem in qml with an appropriate
   objectName property set.
2. Get the aforementioned GstGLVideoItem from qml using something like

QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

QObject *rootObject = engine.rootObjects().first();
QQuickItem *videoItem = rootObject->findChild<QQuickItem *> ("videoItem");

3. Set the videoItem on the sink

https://bugzilla.gnome.org/show_bug.cgi?id=752185
2015-07-10 15:25:26 +10:00