Commit graph

3361 commits

Author SHA1 Message Date
Carlos Garcia Campos
429353337d uridownloader: Take the ownership of the src element
The URI downloader is creating the source element with
gst_element_factory_make() that returns a floating reference that nobody
is consuming. This is causing problems in WebKit, where the smart
pointers used to take references of the source elment get confused and
end up consuming the floating reference and then releasing the element,
which usually crashes because the URI downloader still tries to use its
src element. See https://bugs.webkit.org/show_bug.cgi?id=144040.
This commit adds two helper functions to ensure and destroy the source
element, to make the code simpler and less error prone. The ensure
method takes care of checking if we can reuse the existing one or we
need to create a new one, taking always its ownership. The destroy
method simply avoids duplicated code to set the source to NULL state and
then unref it.

https://bugzilla.gnome.org/show_bug.cgi?id=766053
2016-05-06 15:26:59 +02:00
Alex Ashley
792e9a6033 adaptivedemux: fix threading issues in gst_adaptive_demux_wait_until function
The gst_adaptive_demux_wait_until() function can be woken up either
by its end_time being reached, or from other threads that want to
interrupt the waiting thread.

If the thread is interrupted, it needs to cancel its async clock callback
by unscheduling the clock callback. However, the callback task might already
have been activated, but is waiting for the mutex to become available. In this
case, the call to unschedule does not stop the callback from executing.

The solution to this second issue is to use a reference counted object that
is decremented by both the gst_adaptive_demux_wait_until() function and the
call to gst_clock_id_wait_async (). In this way, the GstAdaptiveDemuxTimer
object is only deleted when both the gst_adaptive_demux_wait_until() function
and the async callback are finished with the object.

https://bugzilla.gnome.org/show_bug.cgi?id=765728
2016-05-06 09:42:41 +01:00
Matthew Waters
5498e97a11 gl/egl: replace gsteglimagememory with an EGLImage wrapper
That can be passed to GstGLMemoryEGL.

This also ports the dmabuf uploader to GstEGLImage and GstGLMemoryEGL.
2016-05-04 13:31:48 +10:00
Gwang Yoon Hwang
c83fd26c80 gl: implement GstGLMemoryEGL
Because current GstEGLImageMemory does not inherit GstGLMemory, GLUpload
allocates additional GLMemory and upload the decoded contents from the decoder
which uses EGLImage (e.g. gst-omx in RPi).

This work adds GstGLMemoryEGL to avoid this overhead. Decoders allocate
GstGLMemoryEGL and decode its contents to the EGLImage of GstGLMemoryEGL.  And
GLUpload uses this memory without allocation of additional textures and blit
operations.

[Matthew Waters]: gst-indent the sources and fix a critical retreiving the egl
display from the memory.

https://bugzilla.gnome.org/show_bug.cgi?id=760916
2016-05-04 12:57:27 +10:00
Matthew Waters
8ccf3dc589 glmemory: add wrapped data pointers to setup_buffer
Allows creating wrapped memories with GstGLAllocationParams.

The wrapped pointers will be set in the parameters before being passed
to the memory allocation function.
2016-05-04 12:51:59 +10:00
Matthew Waters
c9d9077a5f glbasememory: take a pointer as the wrapped gpu handle
Allows passing arbitrary data to wrap the the specific memory implementation
which is required for some memory implementations.
2016-05-04 12:51:59 +10:00
Matthew Waters
344e7db975 gl: fix gles3 header usage for older platforms
Some platforms provide an old version of GLES2/gl2.h and GLES2/gl2ext.h that
will fail when including GLES3/gl3.h due to missing typedef's.

Seen on the RPi.
2016-05-03 20:02:34 +10:00
Sebastian Dröge
7acb1a35cb player: Add required paths via pkg-config for gstreamer-base-1.0 and gstreamer-video-1.0 for gobject-introspection
The GstBase-1.0.gir and GstVideo-1.0.gir files are required by GstPlayer.
Uninstalled builds fail if these files cannot be found.

https://bugzilla.gnome.org/show_bug.cgi?id=765804
2016-04-29 15:15:30 +03:00
Barun Kumar Singh
bf43460018 player: Add audio-video-offset property and setter/getter API
https://bugzilla.gnome.org/show_bug.cgi?id=765315
2016-04-28 13:18:41 +03:00
Sebastian Dröge
b9cfa34118 glviewconvert: Port more things to GLES/GL 3 compatibility
And move the shader mangling code into a single place instead of having a copy
in glcolorconvert and glviewconvert.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2016-04-27 11:47:20 +03:00
Sebastian Dröge
57a4494528 glcolorconvert: GLES3 deprecates texture2D() and it does not work at all in newer versions than 3.3
Use the newer texture() function instead. This fixes glimagesink and other
things on various Android devices.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2016-04-27 11:47:20 +03:00
Thiago Santos
9cc00bf2c9 mpegtsmux: write language descriptor when language is available
Adds a new function to mpegts lib to create a iso639 language
descriptor from a language and use it in mpegtsmux to add
a language descriptor to audio streams that have a language set.

https://bugzilla.gnome.org/show_bug.cgi?id=763647
2016-04-26 23:45:34 -03:00
Nicolas Dufresne
38895f2364 aggregator: Check all pads for data when live
When live, we still need to inspect all pads queue in order to determin
if we have received the first buffer or not.

https://bugzilla.gnome.org/show_bug.cgi?id=765431
2016-04-26 06:54:37 -04:00
Nicolas Dufresne
fbd824a2b5 aggregator: Fix locking when using the clock
This fixes a race where we check if there is a clock, then it get
removed and we endup calling gst_clock_new_single_shot_id() with a NULL
pointer instead of a valid clock and also calling gst_object_unref()
with a NULL pointer later.

https://bugzilla.gnome.org/show_bug.cgi?id=757548
2016-04-26 06:54:37 -04:00
Florin Apostol
aa58a70d66 adaptivedemux: use realtime_clock for waiting for a condition
There are several places in adaptivedemux where it waits for
time to pass, for example to wait until it should next download
a fragment. The problem with this approach is that it means that
unit tests are forced to execute in realtime.

This commit replaces the use of g_cond_wait_until() with single
shot GstClockID that signals the condition variable. Under normal
usage, this behaves exactly as before. A unit test can replace the
system clock with a GstTestClock, allowing the test to control the
timing in adaptivedemux.

https://bugzilla.gnome.org/show_bug.cgi?id=762147
2016-04-21 16:46:09 -03:00
Florin Apostol
74d62b9144 adaptivedemux: use GstSystemClock to all real-time calculations
A realtime clock is used in many places, such as deciding which
fragment to select at start up and deciding how long to sleep
before a fragment becomes available. For example dashdemux needs
sample the client's estimate of UTC when selecting where to start
in a live DASH stream.

The problem with dashdemux calculating the client's idea of UTC is
that it makes it difficult to create unit tests, because the passage
of time is a factor in the test.

This commit changes dashdemux and adaptivedemux to use the
GstSystemClock, so that a unit test can replace the system clock when
it needs to be able to control the clock.

This commit makes no change to the behaviour under normal usage, as
GstSystemClock is based upon the system time.

https://bugzilla.gnome.org/show_bug.cgi?id=762147
2016-04-21 16:46:09 -03:00
Barun Kumar Singh
aa754f634c player: Add support for multiview settings
https://bugzilla.gnome.org/show_bug.cgi?id=765302
2016-04-21 14:58:18 +03:00
Hyunjun Ko
6a0b35bf37 gl/cocoa: Fix incompatible type warning
https://bugzilla.gnome.org/show_bug.cgi?id=765292
2016-04-20 10:11:03 +03:00
Thiago Santos
5fc6284cdc videoaggregator: plug caps leak
It was losing ref of the original 'ret' caps that would be returned
or returning it with 2 references to it.
2016-04-18 13:46:55 -03:00
Thiago Santos
641bb44226 videoaggregator: properly handle interlace-mode restrictions
videoaggregator can't handle interlace-mode changes so it must
always restrict itself to the first interlacing mode it receives.

Tests included

https://bugzilla.gnome.org/show_bug.cgi?id=754495
2016-04-18 13:46:48 -03:00
Heinrich Fink
ef12e05a59 gl/caopengllayer: Apply layer.contentsScale to viewport dims
Fixes blurry content on HiDPI screens

https://bugzilla.gnome.org/show_bug.cgi?id=765194
2016-04-18 10:32:07 +03:00
Reynaldo H. Verdejo Pinochet
58465bc90f Drop usage of 'overlayed' to mean 'overlaid' 2016-04-15 13:39:32 -07:00
Sreerenj Balachandran
8f853cfed5 codecparsers: mpegvideo: Parse more slice header fields
https://bugzilla.gnome.org/show_bug.cgi?id=733872
2016-04-15 01:22:52 +10:00
Sreerenj Balachandran
51c7526030 codecparsers: mpegvideo: Add vbv_delay field to PictureHeader
https://bugzilla.gnome.org/show_bug.cgi?id=733872
2016-04-15 01:22:52 +10:00
Sreerenj Balachandran
7b0b74041e codecparsers: mpegvideo: Add more fields to the GstMpegVideoSequenceHdr
Added the fields load_non_intra_quantiser_matrix and
load_chroma_intra_quantiser_matrix to the sequence header structure.

https://bugzilla.gnome.org/show_bug.cgi?id=733872
2016-04-15 01:22:52 +10:00
Sebastian Dröge
ccc068576a meta: Initialize all GstMeta fields
During allocation they are not initialized to all zeroes.

https://bugzilla.gnome.org/show_bug.cgi?id=764902
2016-04-13 10:17:24 +03:00
Matthew Waters
b3b73d39a0 gl/cocoa/eagl: don't leak GThread's when dispatching messages
gst_gl_context_get_thread() returns a refed pointer, we need to unref it.
2016-04-13 01:03:20 +10:00
Matthew Waters
5115eadc46 glupload: keep the parent buffer around when converting EGLImage to 2D textures
e.g. receiving and releasing a buffer from OMX too early will potentially
cause textures to be overwritten while/before they are displayed.
2016-04-12 09:41:23 +10:00
Alessandro Decina
b73d2586ce libgstgl: cocoa, eagl: use libdispatch to schedule GL calls
Use libdispatch instead of GMainLoop to dispatch GL calls. libdispatch is more
optimized and cuts a lot of poll()/pthread_* overhead.
2016-04-11 08:40:03 +10:00
Alessandro Decina
38cb69279b glwindow: reduce the number of GMutexes and GConds in send_message()
Don't create many short lived locks/conds in gst_gl_window_send_message. This is
a micro optimization to save a bunch of pthread_* calls which are expensive on
OSX/iOS and possibly other platforms.
2016-04-11 08:40:03 +10:00
Matthew Waters
aa2b23fe39 videoaggregator: repect the result of find_best_format in the default update_caps
We weren't using the result of find_best_format at all.

Also, move the find_best_format usage to the default update_caps() to make
sure that it is also overridable.

https://bugzilla.gnome.org/show_bug.cgi?id=764363
2016-04-07 20:30:25 +10:00
Aurélien Zanelli
7a599df9f4 aggregator: remove duplicated test of flow_return in pad_chain_internal
https://bugzilla.gnome.org/show_bug.cgi?id=764549
2016-04-04 10:56:33 +03:00
Sreerenj Balachandran
88a3b4da3c codecparser: vp9: move persistent fields from GstVp9FrameHdr to GstVp9Parser
The subsampling_x, subsampling_y, bit_depth, color_space and color_range
fileds are moved from GstVp9FrameHdr to the global GstVp9Parser structure.
These fields are only present in keyframe or intra-only frame, no need to
duplicate them for inter-frames. This is an ABI change.

https://bugzilla.gnome.org/show_bug.cgi?id=764370
2016-04-01 14:12:08 +03:00
Matthew Waters
5e80a99faf eglimage: perform eglCreateImage in the gl thread
while calling eglCreateImage without a GL context current in the executing
thread works on the RPi, some other implementations will return errors.

Marshall the eglCreateImage to the GL thread to appease these implementations.
2016-04-01 16:08:18 +11:00
Matthew Waters
beeb3ff883 glviewconvert: support outputting to multiple draw buffers on GLES3
A similar change that was done to glcolorconvert adding the necessary shader
mangling.
2016-04-01 15:37:04 +11:00
Matthew Waters
822f09f6ae glcolorconvert: implement multiple render targets for GLES3
There are numerous slight differences required between Desktop GL and GLES3 for
multiple render targets.

1. gl_FragData doesn't exist at all and one is required to use
   'layout (location = ?) out ...' instead.
2. gl_FragColor doesn't exist, same as 1
3. texture2D() has been deprecated

Fortunately most of these have been taken care of with GL3 and the shader
mangling already exists so just expand the conditions they are used in.  The
gl_FragData issue requires a new mangle pass though.  We also use this new
pass on desktop GL for consistency.
2016-04-01 15:37:04 +11:00
Matthew Waters
1fe958d6d3 glcolorconvert: don't use the predefined variable name sample
Using 'sample' as a variable name is an error in GLES3
2016-03-31 20:53:18 +11:00
Matthew Waters
9e40dd7d40 gl: add support for building against GLES3 headers
with a fallback to GLES2 headers if available.
2016-03-31 20:53:18 +11:00
Matthew Waters
9ea15579ec glmemory: add checking the read implementation format/type on gles2 platforms
By default, reading GL_RED or GL_RG us unsupported by glReadPixels unless
exposed through GL_COLOR_READ_IMPLEMENTATION_FORMAT/TYPE.  This allows
downloading multiple-planar video frames where possible.
2016-03-31 20:52:42 +11:00
Matthew Waters
afd0ce7160 glbasememory: rollback map state when subclass map fails
Otherwise our state doesn't reflect reality.
2016-03-31 20:52:42 +11:00
Matthew Waters
7685b052b8 glmemorypbo: unmap pbo memory on pbo read error
Otherwise we are returning failure with a dangling map!

Also only unset the NEED_DOWNLOAD flag in download_transfer() if the read actually
succeeds.
2016-03-31 20:52:42 +11:00
Matthew Waters
d38587c142 glshader: add glBindFragDataLocation
There are some cases where it's needed for binding in/out variables in shaders.
e.g. glsl 150 (gl 3.2) doesn't support the 'layout (location = ?)' specifiers in
the shader source so we have to bind them ourselves.
2016-03-31 20:52:42 +11:00
Sebastian Dröge
2125124755 adaptivedemux: Handle find_stream_for_pad() without g_assert_not_reached() if no pad is found
Happens e.g. if a RECONFIGURE event is sent from downstream while we're
switching pads at this very moment. The old pad is gone and the stream has a
new pad.

https://bugzilla.gnome.org/show_bug.cgi?id=764404
2016-03-31 12:21:57 +03:00
Nirbheek Chauhan
302a4a7b5c aggregator: Fix strcmp test for sink template 2016-03-28 13:46:00 +03:00
Nirbheek Chauhan
cb53a6284f aggregator: Don't try to be too smart while allocating pad names
Previously, while allocating the pad number for a new pad, aggregator was
maintaining an interesting relationship between the pad count and the pad
number.

If you requested a sink pad called "sink_6", padcount (which is badly named and
actually means number-of-pads-minus-one) would be set to 6. Which means that if
you then requested a sink pad called "sink_0", it would be assigned the name
"sink_6" again, which fails the non-uniqueness test inside gstelement.c.

This can be fixed by instead setting padcount to be 7 in that case, but this
breaks manual management of pad names by the application since it then becomes
impossible to request a pad called "sink_2". Instead, we fix this by always
directly using the requested name as the sink pad name. Uniqueness of the pad
name is tested separately inside gstreamer core. If no name is requested, we use
the next available pad number.

Note that this is important since the sinkpad numbering in aggregator is not
meaningless. Videoaggregator uses it to decide the Z-order of video frames.
2016-03-28 13:46:00 +03:00
Sebastian Dröge
10a9b78d40 player: Add is_live flag to the GstPlayerMediaInfo
https://bugzilla.gnome.org/show_bug.cgi?id=763126
2016-03-25 12:51:29 +02: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
Matthew Waters
c02f2718b2 gl/proto: sync operations are available on GLES 3.0
Without the GST_GL_API_GLES2 bit set, we will not even attempt to look
for the function pointers in the core library and will fallback to
glFlush/glFinish.
2016-03-22 23:30:10 +11:00
Matthew Waters
a9cf8476ea glmemory: unset GL_UNPACK_ROW_LENGTH in opengl3
If the user uploads their own texture without setting the unpack length, then
then the result will have the appearance of stride mismanagement due to
an incorrect row length.
2016-03-17 22:56:05 +11:00
Matthew Waters
74bbd4c1aa glutils: remove custom code for setting caps features
Just use gst_caps_set_features() instead.
2016-03-17 03:06:05 +11:00
Matthew Waters
200767ba0e glfilter: only allow the same src/sink caps when we are in passthrough mode
If we are given caps with extra features (like the overlay composition
features), we can only deal with that when we are in passthrough mode.

Previously we were bailing entirely and not allowing passthrough filter elements
with things like textoverlay.

Fixes the following pipeline (assuming glfilter supports passthrough):
gl ! textoverlay ! glfilter ! ... ! glimagesinkelement

https://bugzilla.gnome.org/show_bug.cgi?id=763756
2016-03-17 02:37:21 +11:00
Matthew Waters
993ec87ae6 glupload: deal with the ANY caps feature correctly
When transforming, xplode it out into the necessary caps features both
with and without the passthough features.

Fixes negotiation in the following class of pipelines:

gl ! textoverlay ! glupload ! glimagesinkelement

https://bugzilla.gnome.org/show_bug.cgi?id=763756
2016-03-17 02:37:15 +11:00
Matthew Waters
5061095e05 glshader: some compatibility changes for GL 1.4
GL 1.4 (with GL_ARB_shader_objects) doesn't have glIsProgram or glIsShader
equivalents.  As they are simply assertions, skip them when there isn't a
valid function pointer.
2016-03-10 22:53:02 +11:00
Matthew Waters
92b9b57d3e glfilter: retrieve the shader attributes from the GL thread
Otherwise we will receive bogus values

https://bugzilla.gnome.org/show_bug.cgi?id=763365
2016-03-10 22:53:01 +11:00
Edward Hervey
5ebf1d477d mpegvideoparser: Handle non-hierarchical profiles again
This is a regression from since mpegvideoparser was switched to
use the codecparsing library.

The problem is that the high bit of the profile_and_level is used
to specify non-hierarchical profiles and levels. Unfortunately we
were discarding that information.

Expose that escape bit, and use it in the element

https://bugzilla.gnome.org/show_bug.cgi?id=763220
2016-03-09 15:18:42 +01:00
Matthew Waters
aa6062945c gldisplay: make readding the same context a no-op
With e38af23044 returning the correct contexts,
gst_gl_display_add_context() was susceptible to causing infinte loops when
adding the same GstGLContext more than once.  Fix and add a test for
gst_gl_display_add_context().

Fixes glvideomixer gst-validate tests.
2016-03-08 02:06:13 +11:00
Sebastian Dröge
5f925a1580 Revert "libgstgl: cocoa, eagl: don't marshal GL calls to the context thread"
This reverts commit 797d6415df.

We're frozen for 1.8.0 release and this change might have bigger impact.
2016-03-07 08:54:47 +02:00
Alessandro Decina
797d6415df libgstgl: cocoa, eagl: don't marshal GL calls to the context thread
Execute GL calls without marshalling them to the context thread. In the cocoa
and eagl backends calling gst_gl_context_activate is cheap and therefore calling
it on the current thread and serializing GL calls with a per-context lock is
more efficient (faster and has less overhead) than marshalling everything to the
context thread.

This optimization cuts a large overhead in g_poll (continuously waking up the
context thread) and in g_mutex_*/g_cond_* (waiting for results from the context
thread).
2016-03-07 16:20:17 +11:00
Mark Nauwelaerts
e38af23044 gldisplay: really retrieve glcontext for a specific thread
When requesting a glcontext (regardless of thread), the result was correct.
However, when requesting current glcontext on a specific thread, it could
come up with a glcontext active on another thread.

https://bugzilla.gnome.org/show_bug.cgi?id=763168
2016-03-06 12:10:51 +01:00
Matthew Waters
23806d4953 gl: misc docs fixes/additions 2016-03-06 19:36:17 +11:00
Matthew Waters
dff43480ee gl*memory: document new functionality and objects 2016-03-06 19:36:17 +11:00
Mark Nauwelaerts
8d8c65b6d4 glfilter: handle some more unfixed fields when fixating caps 2016-03-05 19:48:57 +01:00
Nicolas Dufresne
140815ff93 glbasememory: Don't change maxsize at run-time
Maxsize is initialized once and should never change. Allocating data
should have no impact on the selected max size for this memory. This
causing memory map failure as the maxsize would become smaller then
size. This happened when using direct rendering in avviddec on GL that
does not support PBO transfer.

https://bugzilla.gnome.org/show_bug.cgi?id=763045
2016-03-03 19:47:26 -05:00
Sebastian Dröge
c22a8a6224 adaptivedemux: Fix REMOVE_SNAP_FLAGS() macro
!(flag1 | flag2 | flag3) is always evaluation to 0. ~ was meant here
instead of !.

CID 1352032.
2016-03-02 10:41:17 +02:00
Thiago Santos
c65b0e3a57 adaptivedemux: handle snap seeking without setting any position
When the start_type is GST_SEEK_TYPE_NONE for a forward seek
(or stop_type for a reverse) is not set on a snap seeking operation,
the element should use the current position and then snap as requested.

Also fixes uninitialized variable complaint by clang about
'ts' variable.
2016-02-26 18:17:37 -03:00
Matthew Waters
37ff267ff5 eglimagememory: add compatibility definitions for EGL dmabuf
e.g. the RPi doesn't have them defined
2016-02-26 21:15:20 +11:00
Matthew Waters
abec124f69 glcontext: add a method to add a context to another share group
Intended for use with wrapped contexts that are created shared with gst's
gl contexts in order to manage the internal sharegroup state correctly.

e.g. with caopengllayer (which is used in glimagesink and caopengllayersink
on OS X), we create a CGL context from the gst context and the sharing state
was not being correctly set on either GL context and gst_gl_context_is_shared()
was always returning FALSE.

With 11fb4fff80 only flushing with multiple
shared contexts, the required flush was not occuring causing screen
corruption or stuttering.

Note: this didn't affect GST_GL_API=opengl pipelines

https://bugzilla.gnome.org/show_bug.cgi?id=762620
2016-02-26 10:59:04 +11:00
Thiago Santos
f231598370 videoaggregator: fix caps queries to allow proper renegotiation
When caps are already negotiated it should be possible to
select formats other than the one that was negotiated. If downstream
allows alpha video caps and it has already negotiated to a non-alpha
format, caps queries should still return the alpha caps as a possible
format as caps renegotiation can happen.

Includes tests (for compositor) to check that caps queries done after
a caps has been negotiated returns complete results

https://bugzilla.gnome.org/show_bug.cgi?id=757610
2016-02-25 11:43:43 -03:00
Sebastian Dröge
18ac9d239e player: Expose more GstVideoOverlay API in the GstPlayerVideoOverlayVideoRenderer
Expose the expose() and set_render_rectangle() methods. These are useful for
proper functioning of the video overlay in various situations and toolkits.
2016-02-22 12:54:05 +02:00
Matthew Waters
98752fde48 gl: fix the build
2d287812 was incomplete
2016-02-22 21:03:28 +11:00
Matthew Waters
2d2878125e gl: error out if the configured GL API is unsupported by our element
https://bugzilla.gnome.org/show_bug.cgi?id=759801
2016-02-22 20:52:54 +11:00
Scott D Phillips
cf0d45c100 codecparsers: h265: Fix initialization of slice_deblocking_filter_disabled_flag
H.265 7.4.7.1 says:

> When slice_deblocking_filter_disabled_flag is not present, it is
> inferred to be equal to pps_deblocking_filter_disabled_flag.

https://bugzilla.gnome.org/show_bug.cgi?id=762351
2016-02-20 10:55:46 +02:00
Thiago Santos
115945b663 mpeg4parser: prevent assertion when scanning for sync code
Only search if there is indeed enough data to be searched otherwise
an assertion is raised
2016-02-19 16:42:35 -03:00
Julien Isorce
0da3390692 gldebug: make sure debug is initialized when calling gst_gl_insert_debug_marker
Usually gl debug is initialized in gst_gl_context_create_thread.
But this function is not used when using the GstGLContextGPUProcess
from ChromiumGStreamerBackend.

Received signal 11 SEGV_MAPERR 000000000000
gst_debug_category_get_threshold
gst_gl_insert_debug_marker
gst_gl_base_filter_gl_start
2016-02-18 16:38:31 +00:00
Sebastian Dröge
22e75a2112 gl: Fix compiler warning about unused const variable with gcc 6
CC       libgstgl_x11_la-gstglcontext_glx.lo
In file included from gstglcontext_glx.c:39:0:
../utils/opengl_versions.h:52:43: error: ‘gles2_versions’ defined but not used [-Werror=unused-const-variable]
 static const struct { int major, minor; } gles2_versions[] = {
                                           ^~~~~~~~~~~~~~
2016-02-18 10:33:20 +02:00
Sebastian Dröge
923dd696f2 gl: Move private headers from SOURCES to noinst_HEADERS 2016-02-18 10:29:21 +02:00
Matthew Waters
d99af79a2c glfilter: insert the debug marker from the GL thread
https://bugzilla.gnome.org/show_bug.cgi?id=761538
2016-02-17 13:01:35 +11:00
Philippe Normand
0b7276d01a adaptivedemux: restore bitrate averaging support
This was accidentally removed in commit ccff3be3.
https://bugzilla.gnome.org/show_bug.cgi?id=733959
2016-02-16 17:11:03 +02:00
Philippe Normand
4d1489b3de adaptivedemux: remove queue2 overrun notification
Due to performance impact concerns this is removed. An alternative
approach would be to rely on buffering messages monitoring.

https://bugzilla.gnome.org/show_bug.cgi?id=733959
2016-02-16 17:11:03 +02:00
Sebastian Dröge
c107a4f60a gl: Remove leftover g_prints
One was commented out, but we also don't use // comments :)
2016-02-16 08:48:23 +02:00
Matthew Waters
b26301bc8d gldebug: use the correct spelling for behavior
The headers use the american spelling of behavior not the UK/AUS version with
the extra U.
2016-02-16 14:41:37 +11:00
Matthew Waters
02262a20e8 glcontext: don't enable GL debug for messages that won't be logged
This is an optimization to avoid pointless string processing.
2016-02-16 14:00:05 +11:00
Florin Apostol
88e21e6089 dashdemux: gst_dash_demux_get_live_seek_range returns positive values
https://bugzilla.gnome.org/show_bug.cgi?id=752374
2016-02-10 14:34:48 -03:00
Tim-Philipp Müller
21dd771b69 gl: syncmeta: define GL_TIMEOUT_IGNORED in more portable way 2016-02-10 10:31:19 +00:00
Alessandro Decina
7c79b33108 gstglshader: cache uniform locations
Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.
2016-02-10 16:37:22 +11:00
Alessandro Decina
2c0aca52a8 gstglcontext: micro optimization to gst_gl_context_thread_add
Invoke the callback right away when called on the context thread. Removes
overhead when nesting libgstgl calls (for example when working with the sync
meta).
2016-02-10 13:11:35 +11:00
Matthew Waters
09c6df31e3 glsyncmeta: add compatibility definition for GL_TIMEOUT_IGNORED 2016-02-09 13:08:21 +11:00
Matthew Waters
cd4a93da3b glsyncmeta: separate out gpu/cpu waits.
CPU waits are more expensive and are only required if the CPU is ever going to
access the data. GPU waits perform inter-context synchronisation and are cheaper
as they don't require CPU intervention.
2016-02-09 12:30:25 +11:00
Luis de Bethencourt
44c0d75cff adaptivedemux: remove overwritten value
ret is overwitten before used with the return of the subclass seek.

CID #1352044
2016-02-08 23:17:40 +00:00
David Waring
90fe6c5a5b adaptivedemux: Update position in stream->segment for new stream segment message.
https://bugzilla.gnome.org/show_bug.cgi?id=761458
2016-02-05 10:47:37 -03:00
Matthew Waters
1b0198631c gl: add .def file for msvc builds
Also internalize some API from being exported.
2016-02-05 10:46:21 +11:00
Thiago Santos
731ab94cc3 adaptivedemux: handle snap seeks
Adaptive demuxers need to start downloading from specific positions
(fragments) for every stream, this means that all streams can snap-seek
to a different position when requested. Snap seeking in this case will
be done in 2 steps:

1) do the snap seeking on the pad that received the seek event and
   get the final position

2) use this position to do a regular seek on the other streams to
   make sure they all start from the same position

More arguments were added to the stream_seek function, allowing better control
of how seeking is done. Knowing the flags and the playback direction allows
subclasses to handle snap-seeking.
And also adds a new return parameter to inform of the final
selected seeking position that is used to align the other streams.

https://bugzilla.gnome.org/show_bug.cgi?id=759158
2016-02-04 14:05:08 -03:00
Thiago Santos
f16916f7e7 adaptivedemux: add utility function to get stream from pad
Simplifies the code a bit and avoid repeating this
common operation
2016-02-04 14:03:55 -03:00
Luis de Bethencourt
aeed18a2bf glquery: remove unnecessary pointer check
All uses of query->context in gstglquery.c assume it exists. We can assume
this as well before unrefing it. Furthermore, gst_object_unref() will just
silently return if it ever were to not exist.
2016-02-04 12:18:39 +00:00
Matthew Waters
4bbe16bb7f glbasefilter: enable qos by default
Improves the responsiveness of the pipeline when resources are close/above the
limitations of the hardware.

Any subclass that wishes not to enable qos can do so themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=761519
2016-02-04 17:31:03 +11:00
Tim-Philipp Müller
fdb45d84fa docs: remove some leftover 'Since 0.10.x' markers 2016-02-03 21:16:18 +00:00
David Waring
1328a44a01 libs: player: use configured GST_PKG_CONFIG_PATH when invoking the introspection scanner
https://bugzilla.gnome.org/show_bug.cgi?id=761460
2016-02-02 17:52:23 +00:00
Matthew Waters
eb14273631 Revert "gl/eagl: try getting a gles3 context"
This reverts commit 96b9666d59.
This reverts commit d11385d167.

This breaks the texture sharing with the applemedia elements as
CVOpenGLESTextureCache seems to have an arbitrary restriction on GLES2 only.
2016-02-02 18:37:44 +11:00
Matthew Waters
87573ba66c glcolorconvert: don't skip subset structures
We may need them to transform into a different set of formats.

Fixes YUV->YUV with two glcolorconverts, e.g:

format=I420 ! glcolorconvert ! glcolorconvert ! format=NV12
2016-02-02 16:21:14 +11:00
Matthew Waters
9b6be35222 glbasefilter: always call gl_start when not called already
Fixes elements transitioning out of passthrough mode using GL resources that
hadn'e been allocated yet.
2016-02-02 16:19:54 +11:00
Matthew Waters
10e85bfdc0 glcolorconvert: fix RGB,rectangle->planar YUV conversion
Converting to GRAY is no fun.  Another case of normalized vs unnormalized
texture coordinates.
2016-02-02 15:29:03 +11:00
Matthew Waters
cb08d13e45 glcolorconvert: fix YUY2/UYVY,rectangle->RGB conversion
1.0 / width does not offset by one pixel in rectangular textures (which use
unnormalized coordinates).

Provide the actual pixel offset as a uniform to the shader.
2016-02-02 14:55:10 +11:00
Matthew Waters
914da9f746 glcolorconvert: perform better negotiation
1. Correctly describe what we can caps we can transform to/from.
   i.e. no YUV->YUV or GRAY->YUV or YUV->GRAY (except for passthrough).
2. Prefer similar formats and ignore incompatible formats on fixation.
2016-02-02 13:27:06 +11:00
Julien Isorce
f1c053f644 gstglwindow: initialize navigation_loop to NULL
Useful when gst_gl_window.c::gst_gl_window_new is not used.
This is the case when using a custom GstGLWindow.
(ex: GstGLWindowGPUProcess from Chromium)
2016-02-01 13:59:22 +00:00
Tim-Philipp Müller
d11385d167 gl: eagl: fix build
gstglcontext_eagl.m:238:45: error: too few arguments to function call,
expected at least 4, have 3
2016-02-01 09:26:37 +00:00
Matthew Waters
96b9666d59 gl/eagl: try getting a gles3 context
Fallback to a gles2 context if that fails
2016-02-01 14:26:37 +11:00
Wang Xin-yu (王昕宇)
0891b90111 glprototypes: fix parameter type of glGenBuffers
The number of buffers should be GLsizei instead of GLuint.

https://bugzilla.gnome.org/show_bug.cgi?id=761272
2016-01-29 14:31:21 +11:00
Matthew Waters
406fe90331 glcontext: back out unintended lost_context changes 2016-01-29 12:45:57 +11:00
Matthew Waters
49199b03ac egl: implement selecting opengl3 contexts 2016-01-29 11:51:58 +11:00
Matthew Waters
f524419315 gl/egl: pass the error value to get_error_string() 2016-01-29 11:51:58 +11:00
Matthew Waters
87031b14cb videoaggregator: don't do caps processing that is not overridable
Allows the subclass to completely override the chosen src caps.

This is needed as videoaggregator generally has no idea exactly
what operation is being performed.

- Adds a fixate_caps vfunc for fixation
- Merges gst_video_aggregator_update_converters() into
  gst_videoaggregator_update_src_caps() as we need some of its info
  for proper caps handling.
- Pass the downstream caps to the update_caps vfunc

https://bugzilla.gnome.org/show_bug.cgi?id=756207
2016-01-27 20:36:25 +11:00
Matthew Waters
8c549633ee gl: move control binding proxy implementation from glvideomixer
Other elements may need to use it's functionality
2016-01-27 20:01:25 +11:00
Alex Ashley
cfb1b79516 adaptivedemux: fix leak of stream->internal_pad
The function gst_adaptive_demux_stream_update_source() function creates
a new GstPad called internal_pad. This pad is not freed when releasing
the stream.

The solution is to set GST_PAD_FLAG_NEED_PARENT so that the chain
functions do not get called when the pad has no parent and then
remove the parent in the gst_adaptive_demux_stream_free() function. This
causes the refcount of the pad to be set to zero.

https://bugzilla.gnome.org/show_bug.cgi?id=760982
2016-01-22 19:04:42 +02:00
Sebastian Dröge
c87a7e2667 base/audio/video: Install headers and pkg-config files
They are still considered unstable API but it would be good to give them some
wider testing already to make sure the API is useful.

https://bugzilla.gnome.org/show_bug.cgi?id=760733
2016-01-22 12:39:48 +02:00
Sebastian Dröge
8a1fa31c67 audio: Move audioaggregator base class to a library
It's useful enough already to be used in other elements for audio aggregation,
let's give people the opportunity to use it and give it some API testing.

https://bugzilla.gnome.org/show_bug.cgi?id=760733
2016-01-22 12:39:48 +02:00
Holger Kaelberer
a2376d00cf glwindow: Fix android build
https://bugzilla.gnome.org/show_bug.cgi?id=760972
2016-01-22 09:59:28 +02:00
Tim-Philipp Müller
e317a350bc libs: g-i: fix init section to avoid compiler warnings
..GstPlayer-1.0.c: In function ‘main’:
..GstPlayer-1.0.c:587:3: warning: implicit declaration of function ‘gst_init’

https://bugzilla.gnome.org/show_bug.cgi?id=760090
2016-01-19 08:40:35 +00:00
Sebastian Dröge
3184175dae glfilter: First make caps writable in fixate_caps(), then truncate them
Truncating requires writable caps.
2016-01-16 17:14:54 +02:00
Sebastian Dröge
c08c795bb4 glcolorconvert: Caps passed to fixate_caps() are not owned by us and guaranteed to be fixed
So don't try to fixate them, which takes ownership and steals them from
basetransform.

https://bugzilla.gnome.org/show_bug.cgi?id=760696
2016-01-16 17:12:29 +02:00
Sebastian Dröge
2018167ee2 Revert "glpool: fix caps refcount issue"
This reverts commit 3bdcdedfa0.

gst_caps_replace() takes a new reference already, if there is a problem then
it is elsewhere. And there are a few problems, see
https://bugzilla.gnome.org/show_bug.cgi?id=760696
2016-01-16 16:55:42 +02:00
Thiago Santos
b7a0be23c6 adaptivedemux: replace ghostpad with a standard pad
Handling the ghostpad and its internal pad was causing more issues
than helping because of their coupled activation/deactivation
actions.

As we have to install custom chain,event and query functions it is
better to use a floating sink pad internally in the demuxer and just
use those pad functions to push through a standard pad in the demuxer

https://bugzilla.gnome.org/show_bug.cgi?id=757951
2016-01-15 11:32:37 -03:00
Florin Apostol
d92f11b819 adaptivedemux: do not flush the input pad
gst_adaptive_demux_stream_clear_eos_and_flush_state() function will do
all the necessary cleaning.

https://bugzilla.gnome.org/show_bug.cgi?id=757951
2016-01-15 11:32:37 -03:00
Matthew Waters
a8b4c6c4ff glquery: provide compat definition for GL_QUERY_RESULT
e.g. android doesn't have it

While we're here move a state specific assertion after the supported check.
Removes an assertion on GLES
2016-01-15 17:00:55 +11:00
Matthew Waters
6b6b591370 gl: add compatibility definition of GLint64
e.g. anrdoid doesn't have it
2016-01-15 16:07:27 +11:00
Matthew Waters
3bdcdedfa0 glpool: fix caps refcount issue
The caps are from an allocation query which are transfer none but were being
treated as transfer full.
2016-01-15 14:00:56 +11:00
Matthew Waters
eb7ac03a91 glmemory: log the time for glTexSubImage/glReadPixels 2016-01-15 13:21:56 +11:00
Matthew Waters
5437874596 gl: add a gstglquery object for arbitrary GL queries
Currently only GL_TIME_ELAPSED and GL_TIMESTAMP are supported
2016-01-15 13:21:56 +11:00
Matthew Waters
2ef124dac6 gldebug: implement a delayed debug system
The messages are stored by gst_gl_async_debug_store_log_msg() and output later
by a corresponding store(), output() or an unset()/free().

Some wrapper macros are provided to avoid callers explicitly using __FILE__,
GST_FUNCTION and __LINE__
2016-01-15 12:19:02 +11:00
Matthew Waters
ad2f0cf619 gldebug: use gst_info_vasprintf in insert_debug_marker()
Allows expansion of GST_PTR_FORMAT and GST_SEGMENT_FORMAT arguments.
2016-01-15 12:19:02 +11:00
Matthew Waters
8e77cf1030 glfilter: recreate the fbo on caps changes
The width/height may change which requires recreating the depth buffer.
2016-01-15 12:05:03 +11:00
Matthew Waters
3e16a6a2e7 glbasefilter: add a class function on set_caps (from GL)
This is simply a convenience to avoid duplicating the thread marshalling on
set_caps.
2016-01-15 12:05:03 +11:00
Matthew Waters
82bb5d4e22 gl/x11/navigation: add button press to the selected event mask
Otherwise we won't get the button press events and GstNavigation fails.
2016-01-14 17:52:23 +11:00
Alessandro Decina
bef0a46c5d glcolorconvert: try harder to passthrough
This makes a pipeline like:

... ! video/x-raw(memory:GLMemory),format=UYVY ! glcolorconvert !
video/x-raw(memory:GLMemory),format={UYVY, NV12} ! ...

passthrough instead of converting UYVY => NV12. The conversion would happen
before this change since the element (and basetransform) transform the src caps
to format={NV12, UYVY} (since NV12 comes first in the glcolorconvert:src
template) and then the default caps fixate func would fixate to NV12. Blah.

Also there's no need to intersect against the template caps in ::transform_caps
since basetransform does that right after calling the vfunc.
2016-01-14 16:38:07 +11:00
Matthew Waters
0be9c9f960 gldebug: add a specific category for the debug spam from the driver 2016-01-13 12:00:03 +11:00
Matthew Waters
04ec728722 glbasememory: Free the actual memory object when requested
Otherwise we are leaking ~400B on each GstMemory allocation.

Freeing in the base class matches the GObject semantics.
2016-01-11 20:40:39 +11:00
Matthew Waters
3423e108d4 glmemorypbo: don't double read pixels
The optimistic download_transfer was not setting the required flag to not
perform glReadPixels on subsequent map (READ). resulting in glReadPixels
happening twice.
2016-01-11 20:40:39 +11:00
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
Matthew Waters
78fb4326eb glmemory: document gst_gl_memory_init 2015-12-17 13:49:56 +11:00
Matthew Waters
9fa1dd2e29 glbuffer: remove unneeded gst_gl_buffer_alloc()
Replaced by gst_gl_base_memory_alloc()
2015-12-17 13:49:56 +11:00
Matthew Waters
b8b4d8db51 glbasememory: document some functions 2015-12-17 13:49:56 +11:00
Matthew Waters
3aaec5b1d6 glmemory: add a default copy implementation
Subclasses still need to override this to copy into the correct memory type.
2015-12-17 13:49:56 +11:00
Matthew Waters
7c90b0435d glbufferpool: use gst_gl_base_memory_alloc as a generic GL allocation framework
Requires the usage of GstGLVideoAllocationParams however any user can set their
own parameters along with an allocator which will be used to allocate the
correct memory type.
2015-12-17 13:49:56 +11:00
Matthew Waters
d2c5fc3e87 glmemorypbo: implement GstGLBaseMemory:alloc
Uses the GstGLVideoAllocationParams parameters
2015-12-17 13:49:56 +11:00
Matthew Waters
bfb4c446bc glbuffer: implements GstGLBaseMemory::alloc
Create GstGLBufferAllocationParams which is subclass of GstGLAllocationParams
2015-12-17 13:49:56 +11:00
Matthew Waters
650e5c4fe5 glmemory: implement GstGLBaseMemory::alloc
- Create GstGLVideoAllocationParams which is a GstGLAllocationParams subclass.
- Make it possible to allocate glmemory objects directly if no frills are
  needed.
2015-12-17 13:49:55 +11:00
Matthew Waters
bd61e1274c glbasememory: add a generic interface for allocating GL memories
This is made possible by a subclassable GstGLAllocationParams that holds
the allocation parameters

Every allocation would now go through gst_gl_base_memory_alloc with the
allocation parameters now being specified in a single struct to allow
extension by different allocators.
2015-12-17 13:49:55 +11:00
Matthew Waters
640476fcba Revert "glbuffer: Don't pass allocation params"
This reverts commit 052f41e5c2.

This is incorrect and will affect any other glbuffer user that needs/wants to
perform data alignment.
2015-12-17 11:06:34 +11:00
Nicolas Dufresne
052f41e5c2 glbuffer: Don't pass allocation params
The imported memory has already been allocated, passing allocation
parameters with alignment confuses the memory which endup with a
size different from maxsize and lead to overrun when the memory
is being copied.
2015-12-16 12:07:17 -05:00
Alessandro Decina
c1720963e4 glupload: fix allocator name after GLMemory API changes 2015-12-16 17:03:03 +11:00
Nicolas Dufresne
4c19b415bd gl: Allow using non-system mesa with both GL and GLES
GCC automatically disable redundance warnings for system headers. As
soon as we start using a non-system installed mesa, we would start
having issues. The test for both wasn't setting any flags, so it would
work but then fail at runtime.

This is being fixed by disabling in the code (where needed only) that
GCC warning. The test is also fixed to avoid the false positive we had.
2015-12-15 19:28:22 -05:00
Xavier Claessens
598ddaee72 bad: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 14:45:38 -05:00
Luis de Bethencourt
91eb51dda1 glviewconvert: check pointer before dereferencing
priv->primary_out could be NULL, check before dereferencing it in
GST_BUFFER_FLAG_SET ()

CID 1308945
2015-12-14 12:32:14 +00:00
Matthew Waters
41c3cb30d4 glbuffer: bind/unbind on map/unmap for GL mappings
Bind the handle to the GL target on map/unmap to save the caller from
handling this themselves.
2015-12-14 18:22:58 +11:00
Matthew Waters
5d0d2ec6ca glbuffer: remove buffer specific transfer flags
Instead rely on GstGLBaseMemory's transfer handling
2015-12-14 18:22:27 +11:00
Matthew Waters
b12f2be4b1 glmemorypbo: map/unmap pbo memory correctly for state tracking
Otherwise some downloads will fail to occur from the PBO.
2015-12-14 18:22:07 +11:00
Matthew Waters
359d0a31ee glformat: add compatibility definitions for OES/rectangle textures 2015-12-14 17:05:31 +11:00
Matthew Waters
4c8f264686 glbasebuffer: remove unsed memory subclass
The functionality has been split into GstGLBaseMemory and GstGLBuffer.
2015-12-14 16:35:34 +11: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
Matthew Waters
6cf8da132b gl: add a GL buffer based GstMemory
Heavily based on GstGLBaseBuffer that is a subclass of GstGLBaseMemory.
Provides GPU and CPU accessible GL buffer objects by GL handle or by
sysmem data pointer.
2015-12-14 16:34:54 +11:00
Matthew Waters
27e724df8f gl: add a base memory object
It handles the following
- GstAllocationParams -> gst_memory_init transformation
- Makes sure that map/unmap/create/destroy happen on the GL thread with
  a GL context current.
- Holds a possible sysmem accessible data pointer with alignment.
- Holds the need upload/download transfer state
2015-12-14 13:55:16 +11:00
Matthew Waters
51636b451c gl: add convenience function for the start of a video frame
Get's the start of the video frame based on a GstVideoInfo and
GstVideoAlignment.
2015-12-14 13:55:16 +11:00
Matthew Waters
3591c6bfa0 gluploadmeta; remove convenience helper API
It was not really useful as if one knows about libgstgl, one can just use
GLMemory objects directly.
2015-12-14 13:55:16 +11:00
Matthew Waters
50337e601e gldownload: remove helper api from the library
It was never used by anyone and is not needed anymore with the element
and GstGLMemory's transparent support for downloading textures.
2015-12-14 13:55:16 +11:00
Alessandro Decina
1d862db9c1 libgstgl: gstglcontext_cocoa: kCGLPFAStereo has been deprecated in 10.11
Also since the version scheme has changed (to include the micro number) since
10.10, use the MAC_OS_X_VERSION_* macro to avoid confusion.
2015-12-10 14:46:27 +11:00
Alessandro Decina
11ca761c5d glbufferpool: relax check for multiple texture targets
Only complain about multiple texture targets when _different_ texture targets
are configured.
2015-12-10 14:46:27 +11:00
Alessandro Decina
5cd0601dd5 glmemory: take subsampling into account for rectangle textures
Rectangle textures don't use normalized coordinates so subsampling needs to be
factored in explicitly.

Fixes YUV => RGB conversion for rectangle textures.
2015-12-10 14:46:27 +11:00
Thiago Santos
2fdd5dca14 adaptivedemux: avoid pushing events with manifest lock
It can be an easy source of deadlocks. Reproducible with very
fast connections (local server).
2015-12-08 16:12:37 -03:00
Matthew Waters
44c5985edd glproto: include function definitions for GL_APPLE_sync
Provides a performance improvement on iOS where we were falling back to glFinish
on settting sync points.
2015-12-08 18:08:28 +11:00
Nicolas Dufresne
d84d1708b7 glupload: Only offer custom allocator with caps features
To use GLMemory and EGLImage allocators, one need to know the
libgstgl API. This is only expected if the associated caps features
have been negotiated. Generic element that otherwise receive those
allocators may fail, resulting in broken pieline. We don't want to
force all generic element to check if the allocator is a custom
allocator or a normal allocator (which implement the _alloc method).

https://bugzilla.gnome.org/show_bug.cgi?id=758877
2015-12-04 17:08:46 -05:00
Sebastian Dröge
280de75d89 adaptivedemux: Log PTS of buffers that are pushed downstream 2015-12-03 10:08:53 +02:00
Matthew Waters
c8099e6e71 glcolorconvert: improve the YUY2/UYVY->RGBA conversion shader
Don't offset the y-axis.  We only need to offset on the x-axis.

Removes a sawtooth pattern on horizontal and vertical edges.

https://bugzilla.gnome.org/show_bug.cgi?id=755486
2015-12-02 22:52:20 +11:00
Matthew Waters
0b11eba96a glcolorconvert: improve RGBA->YUY2/UYVY conversion shader
We should only average the chroma samples not the luma sample.

https://bugzilla.gnome.org/show_bug.cgi?id=758904
2015-12-02 22:52:20 +11:00
Jan Schmidt
08544a459b adaptivedemux: Send the bitrate of the stream as a tag
If we know or can measure the nominal bitrate of a stream,
send that info as a tag downstream
2015-12-02 22:29:38 +11:00
Reynaldo H. Verdejo Pinochet
c564a043d1 Drop usage of deprecated g-ir-scanner --strip-prefix flag 2015-12-02 00:20:01 -08:00
Tim-Philipp Müller
64adb1998d hlsdemux: fix crash when decryption key can't be downloaded
Happened with
http://sslhls.m6tv.cdn.sfr.net/hls-live/livepkgr/_definst_/m6_hls_aes/m6_hls_aes_856.m3u8
if glib-networking was not installed (since key has https uri).
2015-12-01 18:01:36 +00:00
Reynaldo H. Verdejo Pinochet
86ec812429 Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
2015-11-18 16:05:42 -08:00
Sebastian Dröge
74ab40470c glviewconvert: String literals are const
gstglviewconvert.c: In function '_mangle_extensions':
gstglviewconvert.c:1511:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     ext_str = "#extension GL_OES_EGL_image_external : require\n";
             ^
2015-11-17 17:09:51 +02:00
Sebastian Dröge
e2ea7843f9 glsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()
gstglsyncmeta.c  -fPIC -DPIC -o .libs/libgstgl_1.0_la-gstglsyncmeta.o
gstglsyncmeta.c: In function 'gst_buffer_add_gl_sync_meta':
gstglsyncmeta.c:131:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
2015-11-17 17:08:14 +02:00
Matthew Waters
67327615df glsyncmeta: add vfuncs for all operations
there could be other ways/requirements for synchronising two GPU command
streams (whether GL or platform specific).

e.g. glfencesync/eglwaitnative/cond/etc
2015-11-17 15:27:26 +11:00
Matthew Waters
79f4efb02a glviewconvert: add support rectangle/external-oes textures
https://bugzilla.gnome.org/show_bug.cgi?id=757285
2015-11-17 15:27:26 +11:00
Tim-Philipp Müller
1491d02c4e adaptivedemux: remove now-defunct "num-lookback-fragments" property
This no longer does anything, and it was marked as CONSTRUCT_ONLY
which means someone would really have to go out of their way to
be able to set this, which would only be done in very custom
scenarios, if ever, and those will likely target a specific
version of GStreamer then, so probably not much point keeping
it deprecated for a while before removing it.
2015-11-14 20:28:34 +00:00
Vineeth TM
6eae0c7e18 glsl: fix possible string overrun in gst_glsl_version_profile_from_string
given a NULL-terminated string, s.
s[i] = '\0';
i++;
does not guarentee that s[i] is NULL terminated and thus string operations
could read off the end of the array.

https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Matthew Waters
babd066b89 glshader: don't read invalid list pointers (use after free)
gst_gl_shader_detach_unlocked already removes the list entry so attempting to
use the element to iterate to the next stage could read invalid data.

Based on patch by Vineeth TM <vineeth.tm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Vineeth TM
4c9ac5e474 glsl: free str while returning error
https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Vineeth TM
550ecade4d glslstage: Fix vertex_sources memory leak
vertex_sources is being allocated but not freed resulting in leak

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
591401f9e8 glcolorconvert: remove unnecessary free
version_str is already being freed. So no need to call again

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
ba4802e1e5 glcolorconvert: Fix string leak
String got using gst_glsl_version_profile_to_string, is allocated
memory and should be freed

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
b8adc98ddc glcolorconvert: Fix frag_prog and frag_body memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Florin Apostol
4994f068d5 adaptivedemux: fixed handling errors emitted by uri handler
https://bugzilla.gnome.org/show_bug.cgi?id=757947
2015-11-11 17:56:19 +01:00
Matthew Waters
aada44cc09 glcolorconvert: mangle gl_FragColor for GL3
Some drivers don't provide the compatibility definition and we need to provide
our own 'out vec4' variable to put the results of the fragment shader into.

https://bugzilla.gnome.org/show_bug.cgi?id=757938
2015-11-11 23:42:02 +11:00
Matthew Waters
50b59150fd glviewconvert: remove set_format
We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output
2015-11-11 15:16:37 +11:00
Matthew Waters
f24e768cc3 glshader: properly unref the stages on failure
When failing in the varargs functions, all the stage objects not handled need to
be unreffed to prevent a leak.
2015-11-11 14:41:38 +11:00
Matthew Waters
8d8063060e glslstage: properly return an error when we could not create the shader stage
While it was erroring out correctly later, there were GLib warnings about
setting a GError over the top of another GError.
2015-11-11 11:29:35 +11:00
Matthew Waters
21bd8ee536 glshaderstrings: fixup the external-oes fragment shader
The wrong sampler type was used
s/sampler2DExternalOES/samplerExternalOES/
2015-11-11 01:27:21 +11:00
Matthew Waters
87137e3353 glcolorconvert: try to keep the same texture-target if possible
Fixes issues attempting to passthrough external-oes textures
2015-11-10 23:41:24 +11:00
Matthew Waters
6c97be6dfa glcolorconvert: fix rendering rectangular textures with GL3
Rectangular textures are unavailable in unextended
GLES2 #version 100 shaders.

Fixes
texture-target=rectangle ! glcolorconvert ! texture-target=2D

There's a couple of differences between GL3 and GLES2/GL

- varying -> in or out depending on the stage (vertex/fragment)
- attribute -> in
- filtered texture access is a single function, texture()
2015-11-10 22:47:42 +11:00
Matthew Waters
149a92f250 glcolorconvert: properly use the other texture-target on fixation 2015-11-10 22:47:42 +11:00
Matthew Waters
3d5ed23a72 glslstage: add debug as to why _set_strings() failed 2015-11-10 22:47:42 +11:00
Matthew Waters
776ccf87b5 glsl: fix check for glsl version against GL context inversion
Any GLSL version that was less than the provided GL version would fail
2015-11-10 22:47:42 +11:00
Vineeth TM
d624ba0c61 adaptivedemux: Fix pad memory leak.
The static pads got from queue and uri_handler are not being freed
resulting in memory leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=757859
2015-11-10 07:06:17 -03:00
Matthew Waters
ec318cf36d gl: forward declare some enums
Specifically the GstGLTextureTarget enum
2015-11-10 15:42:35 +11:00
Matthew Waters
8acafe6f9f glslstage: expose the default shader strings as public
Add some other simple strings for external-oes textures or transforming
the texture coordinates with a transformation matrix
2015-11-10 15:42:35 +11:00
Matthew Waters
8ae7cc4ee6 glcolorconvert: wait on the sync meta for input buffers 2015-11-10 15:42:35 +11:00
Matthew Waters
df69943726 glcolorconvert: use the correct oes target string in the template caps 2015-11-10 15:42:35 +11:00
Philippe Normand
ccff3be3ab adaptivedemux: improved bitrate estimations
Bitrate estimation is now handled through a queue2 element added after
the source element used to download fragments.

Original hlsdemux patch by Duncan Palmer <dpalmer@digisoft.tv>
https://bugzilla.gnome.org/show_bug.cgi?id=733959
2015-11-06 12:34:36 -03:00
Tim-Philipp Müller
edab4deb3a glshader, tsdemux: simplify code
Jus use _delete_link() instead of _remove_link() + _free1()
2015-11-06 13:00:55 +00:00
Luis de Bethencourt
ba8b8e4677 aggregator: use GST_STIME_FORMAT for GstClockTimeDiff
No need to manually handle negative value of deadline, GST_STIME_FORMAT does
exactly this.
2015-11-05 12:36:55 +00:00
Stefan Sauer
c1fa51953c aggregator: don't compare templ instance pointers
One can pass the PadTemplate from the element_class or the one from the factory.
While they have the same content, the addresses are different.
2015-11-03 19:11:28 -08:00
Olivier Crête
41344e0315 aggregator: Set to running in a single place
Only set to running when the thread is actually started.
2015-11-03 14:42:52 -05:00
Olivier Crête
cb29839580 aggregator: Document more locking 2015-11-03 14:37:59 -05:00
Sebastian Dröge
ce61a754d8 mpegtsdescriptor: Add API for creating extended descriptors and fix writing them
https://bugzilla.gnome.org/show_bug.cgi?id=757049
2015-11-03 20:35:41 +02:00
Olivier Crête
86c33cbb6e aggregator: Hold object lock while manipulating the segment
Make sure the object lock is held when aggregator->segment is
modified.
2015-11-02 20:10:35 -05:00
Olivier Crête
9deb334251 aggregator: Remove dead code
This code will never be called as max>=min in all cases. If the upstream
latency query returned min>max, the function already returned and all
values that are added to those have max>= min.
2015-11-02 19:05:01 -05:00
Luis de Bethencourt
2288b5e9ec videoaggregator: use GST_STIME_ARGS for GstClockTimeDiff
No need to manually handle negative values of diff, GST_STIME_ARGS does
exactly this.
2015-11-02 17:00:22 +00:00
Alessandro Decina
614ea95690 gstglutils: fix shader compilation on Mountain Lion
Make gst_gl_context_gen_shader/_compile_shader assume GST_GLSL_PROFILE_ES |
GST_GLSL_PROFILE_COMPATIBILITY as the profile. Without this, the shader compiler
doesn't inject the #version tag resulting in a compilation error on Mountain
Lion.

This is a workaround for old code using gst_gl_context_gen_shader. New code
should use the gst_glsl_stage_* API directly which allows the caller to
explicitly specify version/profile.
2015-11-02 12:10:44 +11:00
Matthew Waters
dd738842e4 glbufferpool: explicitly initialize a possibly uninitialized variable
The ret variable may be uninitialized and so its contents were undefined and
the results were erratic (failing with glvideomixer, succeeding in other cases)

P.S. No idea why gcc/clang et al never picked up on this like they normally do
(probably due to some optimisation pass figuring out it's only set once...)
2015-10-31 23:32:55 +11:00
Florin Apostol
a2ffe7e979 adaptivedemux: stop task on multiple download errors
On multiple download errors, we stop the download task and change the src
element state to NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=756240
2015-10-30 12:50:10 +00:00
Vincent Penquerc'h
7d909966e5 adaptivedemux: fix a missing lock in write to stream->last_ret
https://bugzilla.gnome.org/show_bug.cgi?id=757359
2015-10-30 12:24:22 +00:00
Florin Apostol
ef466b46d3 adaptivedemux: return error if src element cannot start
https://bugzilla.gnome.org/show_bug.cgi?id=756209
2015-10-30 12:17:40 +00:00
Florin Apostol
519165e461 adaptivedemux: fixed waiting for fragment updates
https://bugzilla.gnome.org/show_bug.cgi?id=756237
2015-10-30 11:52:18 +00:00
Florin Apostol
a85b64bb6d adaptivedemux: fix header redownload in case of errors
https://bugzilla.gnome.org/show_bug.cgi?id=756239
2015-10-30 11:47:17 +00:00
Florin Apostol
e0ef335426 adaptivedemux: release manifest lock before sending flush stop event
https://bugzilla.gnome.org/show_bug.cgi?id=757337
2015-10-30 09:46:41 +00:00
Florin Apostol
e29514ea3d adaptivedemux: reset download_finished before starting the src element
https://bugzilla.gnome.org/show_bug.cgi?id=757336
2015-10-30 09:46:41 +00:00
Florin Apostol
ac58216f05 adaptivedemux: release manifest lock before changing element state
https://bugzilla.gnome.org/show_bug.cgi?id=757335
2015-10-30 09:46:41 +00:00
Matthew Waters
d07c59170a glslstage: remove typedefs from the header
They are already defined in the forward decleration header and defining them
more than once will give an error with OSX's clang about typedef redefinition
being a C11 feature.
2015-10-30 14:40:35 +11:00
Matthew Waters
8106a0931a glcolorconvert: follow the correct texture target names 2015-10-30 14:38:05 +11:00
Matthew Waters
d707038101 glupload: explicitly configure the texture target on the gl buffer pool
If we don't, then the pool could end up allocating 2D textures when the
caps explictly state they should be rectangle textures.
2015-10-30 14:24:54 +11:00
Matthew Waters
b429654a37 glbufferpool: add bufferpool options for the various texture targets
This was chosen over relying solely on the caps as glupload needs to propose an
allocation and set the texture target based on the output caps.  Setting the
caps in the config is currently pointless as they are overwritten in a lot of
element's decide_allocation functions.

This provides a mechanism for the buffer pool to be configured for a certain
texture target when none has been configured.
2015-10-30 14:24:54 +11:00
Matthew Waters
ccce217502 glcolorconvert: add support for converting texture targets
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.
2015-10-30 14:24:53 +11:00
Matthew Waters
e61d504556 glmemory: add support for rectangle 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.
2015-10-30 14:24:53 +11:00
Matthew Waters
ff87ffe6e6 glcolorconvert: order the caps template so that RGBA is first
glcolorconvert ! glcolorconvert would sometimes negotiated RGB
(the first list entry) otherwise.
2015-10-30 14:24:53 +11:00
Matthew Waters
e96f454b30 glbufferpool: move typedef's into the forward decleration file
Otherwise, for example, clang will warn about typedef redefinitions
being a C11 feature.
2015-10-30 14:24:53 +11:00
Florin Apostol
60f3eb15eb dahsdemux: task is signaled to stop without stop condition being set
The gst_adaptive_demux_stream_free function is trying to stop the stream's
download task. For this, it signals the task. But it fails to also set the
stream->download_finished = TRUE, so the task will go back to sleep and
only exit when the download is finished.

https://bugzilla.gnome.org/show_bug.cgi?id=755121
2015-10-29 11:17:48 +00:00
Florin Apostol
eab158a669 adaptivedemux: fixed multithread support
https://bugzilla.gnome.org/show_bug.cgi?id=755169
2015-10-29 10:20:45 +00:00
Víctor Manuel Jáquez Leal
d054a6918c codecparser: h264: initialize parsing structures
Initialize to 0 these parse structures before filling them: GstH264SEIMessage,
GstH264NalUnit, GstH264PPS, GstH264SPS and GstH264SliceHdr.

When calling the functions which fill those structures, they may fail, leaving
unitialized those structures. This situation may lead to future problems, such
as a segmentation fault when freeing, for example.

This patch initializes to zero these structures, before filling them.

https://bugzilla.gnome.org/show_bug.cgi?id=755161
2015-10-29 11:26:37 +02:00
Víctor Manuel Jáquez Leal
c8b3d84757 codecparser: h265: initialize parsing structures
Initialize to 0 these parse structures before filling them: GstH265SEIMessage,
GstH265NalUnit, GstH265VPS, GstH265PPS, GstH265SPS and GstH265SliceHdr.

When calling the functions which fill those structures, they may fail, leaving
unitialized those structures. This situation may lead to future problems, such
as a segmentation fault when freeing, for example.

This patch initializes to zero these structures, before filling them.

https://bugzilla.gnome.org/show_bug.cgi?id=755161
2015-10-29 11:26:36 +02:00
Julien Isorce
704d49b9c7 glslstage: initialize output params to 0 before calling gl functions
The client side API of the Chromium's GPU Process has asserts
in debug mode that check that output params are initialized to 0.
2015-10-28 14:41:54 +00:00
Matthew Waters
8b0b68c4e8 glcolorconvert: allow outputting multiple textures for gles3 contexts
the USING_GLES2 includes all GLES3 contexts as well which does support
drawing to multiple buffers.  Instead make or decision solely based on
whether glDrawBuffers is available or not.
2015-10-26 18:26:18 +11:00
Matthew Waters
09976e021b glviewconvert: expose the element on gles2 platforms
We can do everything with gles3 however gles2 restricts us not allowing
separated or frame-by-frame multiview modes due to multiple draw buffers.
2015-10-26 18:24:59 +11:00
Sebastian Dröge
4eef8424b9 aggregator: Add create_new_pad() vfunc to allow subclasses to override the default behaviour
Not all aggregator subclasses will have a single pad template called sink_%u
and might do something special depending on what the application requests.

https://bugzilla.gnome.org/show_bug.cgi?id=757018
2015-10-23 16:31:47 +03:00
Matthew Waters
0af0237c4a gl: fix usage of string.h and stdio.h functions without including the headers
e.g:
gstglcontext_egl.c:613:7: error: implicit declaration of function 'strcmp'
[-Werror=implicit-function-declaration]
   if (strcmp (G_MODULE_SUFFIX, "so") == 0)
2015-10-21 04:53:08 +11:00
Matthew Waters
80c5e60f9a gl: remove unneeded shader variable parsing code 2015-10-21 04:05:00 +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
9d92326fe5 glslstage: add brackets around pointer dereference referencing an array
While technically, i is always 0 and *vertex_sources[i++] is equivalant
to (*vertex_sources)[i++].  Be future-proof in the case of code
moves/changes/etc.

CID 1327406
2015-10-16 02:57:19 +11:00
Matthew Waters
b25807c382 glshader: port to using GstGLSLStage objects for string management
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.
2015-10-15 21:27:57 +11:00
Matthew Waters
cc7d1098ab glsl: add a shader stage object GstGLSLStage
Represents a stage (vertex, geometry, fragment, etc) in the shader
pipeline.
2015-10-15 21:27:57 +11:00
Matthew Waters
c79cbbdcc1 gl/shader/variables: include generic gl.h header
Otherwise we may miss some forward declarations

Fixes build error: undefined reference to GstGLSLStage
2015-10-15 21:27:57 +11:00
Matthew Waters
2e8642cc4c gl: add some GLSL utility functions
Specifically parsing/setting GLSL versions and the shader related
function table.
2015-10-15 21:27:57 +11:00
Sebastian Dröge
e523bd2a33 adaptivedemux: HTTP ranges are inclusive, GStreamer segment.stop is exclusive
Translate the values accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=748316
2015-10-14 16:57:56 +03:00
Guillaume Desmottes
5b30a8e9b2 gl: fix leak in gst_gl_insert_debug_marker()
The string allocated by g_vasprintf() was leaked.

Reproduced using the
validate.file.compositor.simple.play_15s.synchronized validate scenario.

https://bugzilla.gnome.org/show_bug.cgi?id=756492
2015-10-14 09:55:47 +11:00
Sebastian Dröge
f5dd41d710 Update GLib dependency to 2.40.0 2015-10-02 22:24:19 +03:00