Commit graph

2913 commits

Author SHA1 Message Date
Matthew Waters
e8a251db4b glmemory: expose gst_gl_memory_texsubimage
Removes extremely similar code from glmemorypbo.
2016-01-11 20:40:39 +11:00
Matthew Waters
0ebd719644 glfeature add a specific debug category
Saves having to trawl through the 'default' category when function retrieval
goes wrong.
2016-01-11 20:40:39 +11:00
Thiago Santos
16a2f7f5c0 adaptivedemux: fix seeking that just updates stop position
Fixed adaptivedemux seeking without flushing that just wants
to update stop position. This required protecting the segment
variables with a new mutex so that the seeking thread and the
download threads could safely manipulate the segment and
events related to it.

This contention is only locked/unlocked when starting a new
download, when the first fragment of a segment is received and
when seeking so, hopefully, it won't damage performance.
2016-01-07 15:46:01 -03:00
Thiago Santos
eaace4922c adaptivedemux: fix segment update on seeks
Fixes typo on reverse rate check and also only update the
position when the start/stop was actually changed.
2016-01-07 15:45:56 -03:00
Matthew Waters
11fb4fff80 glsyncmeta: only flush with a shared context
The wait code will flush for us for single context pipelines.
2016-01-07 14:11:13 +11:00
Matthew Waters
2aadd7eaf9 glcontext: implement checking whether a context has been shared
Some operations are unnecessary when running with only a single GL
context.
e.g. glFlush when setting a fence object as the flush happens on wait.

API: gst_gl_context_is_shared
2016-01-07 14:11:13 +11:00
Sebastian Dröge
7f8d9d1df2 player: Only set the pipeline to PLAYING in play() if buffering>=100%
Otherwise the application can break the buffering logic by setting the
pipeline to PLAYING before we buffered enough.
2016-01-06 16:55:44 +02:00
Thiago Santos
f57109ad2e adaptivedemux: stop reverse playback when we reach the limit
Avoids downloading and pushing a full segment just to get 1 nanosecond
of data. This happens frequently when seeking is done with flags
that adjust to boundaries or when the start is aligned with segment
starts. The later is common when segment durations is a multiple of
a second.
2016-01-06 10:23:13 -03:00
Thiago Santos
bf272edaf3 adaptivedemux: correctly track segment.position in reverse playback
For reverse, set position to segment.stop when starting and also
don't set the position to fragment end timestamp when it finishes,
just leave it at the fragment start.
2016-01-06 10:23:13 -03:00
Matthew Waters
519280204c glcolorconvert: implement usage of a buffer pool
Saves unnecessary glGenTextures and glDeleteTextures which may have a
non-trivial cost.
2016-01-06 16:48:33 +11:00
Matthew Waters
37264a86e1 glbasememory: fix copying GstGLAllocationParams
Fixes a GST_IS_GL_CONTEXT critical
2016-01-06 16:48:33 +11:00
Matthew Waters
8d34c91855 glmemorypbo: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=759679
2016-01-06 16:48:33 +11:00
Matthew Waters
479dcdc3b4 glupload: always add texture-target field to GL caps
1. Various elements/base classes only perform a subset check on accept-caps
2. Some GL elements have texture-target in their pad template
3. When checking subsets, only the caps to check are allowed to contain extra
   fields.  If the 'template' caps have extra fields, the subset fails.
Thus without texture-target on the caps, various accept-caps implementations
were failing.

Also, add some convenience functions for setting and retrieving
texture targets to/from GValue.

https://bugzilla.gnome.org/show_bug.cgi?id=759860
2016-01-05 13:28:19 +11:00
Matthew Waters
65f03061ad glupload: passthrough composition caps features
Don't unconditionally add it to any and all caps transformations.

https://bugzilla.gnome.org/show_bug.cgi?id=759860
2016-01-05 13:28:19 +11:00
Sebastian Dröge
b53972a5cb player: Remove gst_player_new() and make gst_player_new_full() the normal constructor
In very few cases the simple version was actually needed and having the
parameters hidden by a _full() version caused application that actually needed
it to not use it.
2016-01-04 09:55:28 +02:00
Jan Schmidt
40b0736dfd glviewconvert: Fix stereoscopic handling w/ texture-target
The addition of texture-target negotiation broke stereoscopic
handling when not in passthrough mode, so fix that.
2016-01-04 01:04:23 +11:00
Tim-Philipp Müller
4e37976d83 codecparsers: vp9: minor clean-up
Remove setting of parser variable to NULL after free,
that makes no sense (and coverity is no doubt going
to complain about it).
2015-12-30 13:17:24 +00:00
Tim-Philipp Müller
d6834432ed codecparsers: vp9: fix macro namespacing and rename GstVp9InterpFilter 2015-12-30 13:12:13 +00:00
Tim-Philipp Müller
75b31d1872 codecparsers: vp9: fix doc typos and sprinkle some Since markers 2015-12-30 13:09:23 +00:00
Tim-Philipp Müller
10392acca5 codecparsers: vp9: move license blurb into header and remove aux files
This is just a bunch of lookup tables..
2015-12-30 11:04:32 +00:00
Sebastian Dröge
814cb85822 codecparsers: Add another G_GNUC_INTERNAL 2015-12-30 11:54:14 +02:00
Sebastian Dröge
d0332c2a16 codecparsers: Spread some G_GNUC_INTERNAL in various places 2015-12-30 11:40:59 +02:00
Sebastian Dröge
1bf448cbbd vp9parser: Fix indentation to make gst-indent happier 2015-12-30 11:38:14 +02:00
Sebastian Dröge
45f2ad952f vp9parser: Rename symbols to prevent symbol conflicts
Also make clamp() a static function for the same reason and use CLAMP (as
defined by GLib) in the GStreamer code.
2015-12-30 11:37:59 +02:00
Sreerenj Balachandran
b245e0f16c codecparsers: Add VP9 codec parser
https://bugzilla.gnome.org/show_bug.cgi?id=757597
2015-12-30 11:19:33 +02:00
Matthew Waters
4717b48a03 glmemorypbo: fix wrapping data on GL 2.1
GL 2.1 only supports pbo upload.

The wrapped data pointer was only being set on the pbo memory and on the
glmemory so when a download was requested (in GL 2.1), glmemory was
allocating a new data pointer and thus not returning the wrapped data.
2015-12-30 12:16:29 +11:00
Matthew Waters
49291bc927 glmemorypbo: only create a pbo memory if the context actually supports it
e.g. GL <= 2.0 does not support pbo usage and GL 2.1 only supports pbo upload.
2015-12-30 12:16:29 +11:00
Matthew Waters
6917b3b35a glmemory: small code reformat
makes the alloc_params selections fit on a single line.
2015-12-30 12:16:29 +11:00
Sebastian Dröge
aaa660ac9d glbasememory: Remove bogus NULL check
CID 1346534
2015-12-29 18:01:30 +02:00
Sebastian Dröge
22a0914cce gl: Add \0 terminators for the Apple sync extension
Otherwise GL initialization might check for extensions forever and never finishes.
2015-12-28 15:53:59 +02:00
Sebastian Dröge
3d0257e1b6 glcontext: Add some debug output when the GL thread is actually running 2015-12-28 14:41:59 +02:00
Vineeth TM
572b9788f5 glbufferpool: Fix build error
When GST_GL_HAVE_PLATFORM_EGL is not defined, then info variable
will not be used and this results in build error

https://bugzilla.gnome.org/show_bug.cgi?id=759913
2015-12-27 21:54:50 -05:00
Sebastian Dröge
0b2d698b1e player: Import GstPlayer playback convenience API
Based on https://github.com/sdroege/gst-player
commit 9ce6ae0dbb8eeeefaf794cfae80e279a03cc598d
2015-12-23 09:54:37 +01:00
Sebastian Dröge
c4e5423f3b glmemorypbo: Comment out unused functions to fix compilation with clang
It's not clear if these are intentionally unused or the code should be
changed, but this fixes compilation for the time being at least.

See https://bugzilla.gnome.org/show_bug.cgi?id=759679
2015-12-23 09:51:05 +01:00
Sebastian Dröge
626bcccff9 glcontext: Signal context creation from inside the context loop and use g_thread_join() instead of a custom condition variable
Also protect against spurious condition variable wakeups during context
creation.
2015-12-21 12:16:35 +01:00
Sebastian Dröge
d81eea5de1 glwindow: Hide navigation specific internal API and add API to asynchronously send navigation events
Exposing the navigation thread's main context, GSourceFuncs and structs called
key_event and mouse_event is exposing a bit too much of the internals. Let's
just go with two functions to asynchronously send navigation events on the
window with the same API as the synchronous ones.
2015-12-21 11:27:09 +01:00
Sebastian Dröge
0952b3f986 glwindow: Use g_thread_join() instead of a custom condition variable for waiting for the navigation thread to finish
Also hide some internal functions and fields while we're at it and fix
a race condition with the startup condition variable.
2015-12-21 11:09:04 +01:00
Haihua Hu
62d79ae326 glwindow: Fix memory leak of navigation thread
When stopping the navigation thread, call g_thread_join() to release
the resources hold by it.

https://bugzilla.gnome.org/show_bug.cgi?id=758820
2015-12-21 10:42:41 +01:00
Nicolas Dufresne
937e249b44 glconvert: Fix compilation of GRAY16_LE/BE shader 2015-12-18 15:56:34 -05:00
Nicolas Dufresne
420a175b4f glupload: Add dmabuf upload method.
This upload method detect and optimize uploads of DMABuf memory. This is
done by creating and caching EGLImages wrapper around DMABuf. The
EGLImages are then binded to a texture which get converter using
standard shader.

Example pipeline:

GST_GL_PLATFORM=egl \
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=4 ! \
               video/x-raw,format=NV12 ! glimagesink

https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:34 -05:00
Nicolas Dufresne
7b335c4dd5 eglimagememory: Also import BGR16, ABGR, xBGR, AYUV, GRAY16_LE/BE and Y444
https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:34 -05:00
Nicolas Dufresne
b17a732d5f eglimagememory: Add RGB/BGR DMABuf importation support
https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:34 -05:00
Lubosz Sarnecki
1cd9786598 eglimagememory: Methods to create GstGLMemory from dmabufs
Maps GstVideoFormats to suitable DRM fourccs which work with
glcolorconvert, using gst_gl_memory_alloc(). We require mostly
only 4 formats to be supported by the driver. We require DRM
equivalent to RGB16, RGBA, R8 and RG88. This way it's compatible with
DesktopGL, since GL_TEXTURE_2D is used and limit driver requirements.
With this we can virtually support all formats the glcolorconvert
supports.

https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:34 -05:00
Lubosz Sarnecki
41738ca83b build: Add dmabuf build condition.
configure.ac: Build dmabuf when EGL and drm_fourcc.h is available.
gl: Link gst-allocators.

https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:34 -05:00
Lubosz Sarnecki
eb73cf3c2e gstglcontext_egl: Expose gst_gl_context_egl_get_error_string.
https://bugzilla.gnome.org/show_bug.cgi?id=743345
2015-12-18 15:56:33 -05:00
Alessandro Decina
6961945110 glmemory: add gst_gl_memory_allocator_get_default
Add gst_gl_memory_allocator_get_default to get the default allocator based on
the opengl version. Allows us to stop hardcoding the PBO allocator which isn't
supported on gles2.

Fixes GL upload on iOS9 among other things.
2015-12-18 14:25:32 +11:00
Matthew Waters
d8dacd50bf glbasememory: don't unconditionally add the alignment bytes to the size
e.g when wrapping a data pointer we don't want to map/unmap off the end of
pointer with the alignment bytes.

Instead track that information separately as maxsize is used for mapping by
GstMemory and thus represents a size without any alignment padding bytes.
2015-12-18 01:02:25 +11:00
Matthew Waters
4d88848fae glbuffer: add a name to the allocator 2015-12-17 15:50:40 +11:00
Matthew Waters
5dcd500257 gl*memory*: reverse the parameter order of user_data and destroy notify
The convention is to have the destroy notify last after any user data
2015-12-17 15:44:22 +11:00
Matthew Waters
779dc3132c glmemorypbo: remove our own alloc()/wrapped()/etc functions
replaced by equivalent functionality within gst_gl_base_memory_alloc()
2015-12-17 13:49:56 +11:00