Commit graph

2497 commits

Author SHA1 Message Date
Nirbheek Chauhan
802a29eb48 videoaggregator: Check if there's a previous buffer to 'keep'
If we want to keep a previous buffer but there's no previous buffer, we actually
need more data instead.
2015-03-24 14:54:33 +01:00
Philippe Normand
14ac40f106 gl/dispmanx: surfaceless EGL context support
Show the DispmanX window only if there's no shared external GL context
set up. When a window is required by the context a transparent
DispmanX element is created and later on made visible by the ::show
method.

https://bugzilla.gnome.org/show_bug.cgi?id=746632
2015-03-24 11:12:05 +00:00
Julien Isorce
e1e17dcadb glwindow: remove unused gl_thread field 2015-03-22 19:12:15 +01:00
Julien Isorce
d35e3b8481 gldisplay: fix GThread leak
https://bugzilla.gnome.org/show_bug.cgi?id=746541
2015-03-22 19:03:19 +01:00
Matthew Waters
0ee027b6ee gl/docs: update some doc comments 2015-03-18 10:13:25 -07:00
Olivier Crête
0656c2fc67 aggregator: Be more aggressive with invalid replies to our latency query
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-03-16 14:31:50 -04:00
Matthew Waters
78c82328ee gldisplay: tentative proper context collision detection
Fixes
tee name=t ! queue ! gliamgesink t. ! queue ! glimagesink
2015-03-15 14:43:10 +00:00
Víctor Manuel Jáquez Leal
d925e7fd19 glupload: move meta-data copy into gst-gl library
In some upload implementations the out buffer has more than one references,
turning the buffer not writable, so it won't be possible to modify its
meta-data.

This patch moves the meta-data copy before increasing the reference of the out
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=746173
2015-03-14 19:53:02 +00:00
Matthew Waters
48f8b5b46b glmemory: fix the slight difference between EXT_rg and ARB_rg
GL_EXT_texture_rg doesn't take sized formats for the internalformat
parameter of TexImage* but GL_ARB_texture_rg and GL(ES)3 do.

https://bugzilla.gnome.org/show_bug.cgi?id=732507
2015-03-14 18:59:27 +00:00
Matthew Waters
fa61e8e4ce glsyncmeta: make context to wait and set sync explicit
otherwise we may wait on a sync object in same context by accident
2015-03-14 16:53:46 +00:00
Julien Isorce
802bf79998 gl: add GstGLDisplayCocoa
https://bugzilla.gnome.org/show_bug.cgi?id=746012
2015-03-14 08:38:03 +00:00
Julien Isorce
90f0cfceb7 gl/cocoa: do not terminate loop in gst_gl_window_cocoa_close
It is now done in _finalize.

Fix regression introduced by
"gl/window: create the main loop/context on init/finalize"
bc7a7259f3
2015-03-14 07:49:14 +00:00
Julien Isorce
2d593b4c26 gl: avoid overwriting display and context to NULL
It happens when the application provides display
and/or context.
2015-03-13 18:30:30 +00:00
Matthew Waters
a29a18cc3a glshader: attribute locations are -1 on error 2015-03-13 17:41:17 +00:00
Neos3452
40a4530c5d glshader: prevent from getting attributes without vertex shader
It doesn't make sense to query for vertex attributes without a vertex
shader. Moreover this is causing a crash on OSX.

https://bugzilla.gnome.org/show_bug.cgi?id=746168
2015-03-13 17:35:18 +00:00
Matthew Waters
773f9fa6ff glupload: unref the bufferpool 2015-03-13 12:40:04 +00:00
Matthew Waters
34485c9976 gl: get the context from basemixer/basefilter 2015-03-13 12:30:20 +00:00
Matthew Waters
91b7642c48 gl: retreive the gldisplay/app gl context as soon as possible
fixes the usage of gst_gl_display_filter_gl_api
2015-03-13 12:30:20 +00:00
Julien Isorce
daef98e3e6 glcolorconvert: cache indices in a buffer object 2015-03-12 18:19:57 +00:00
Matthew Waters
66ccdab09a gl/cocoa: avoid deadlock when creating context on the main thread.
Make window/view creation async so that it is possible to
gst_gl_context_create from the main thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
ef0bd30c87 gl: store the list of contexts within gldisplay
Removes the reliance on the allocation query to propogate GL contexts.

Allows thread safely getting a context for the a specific thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
cebdf84c81 glcontext: store the thread current context 2015-03-12 16:45:51 +00:00
Matthew Waters
5a867ddc47 glfilter: don't use the library upload/convert objects 2015-03-12 16:45:50 +00:00
Matthew Waters
0c800027ba glupload: implement propose_allocation pool handling for glmemory upload 2015-03-12 16:45:50 +00:00
Matthew Waters
ecdc5568c4 gl: add a new glbasefilter class below glfilter
It deals with propagating the gl display/contexts throughout the
application/pipeline
2015-03-12 16:45:50 +00:00
Matthew Waters
41e3b32866 glutils: expose running a query on a set of src/sink pads 2015-03-12 16:45:50 +00:00
Matthew Waters
56253d8dce glfilter: advertise resize in the caps negotiation properly 2015-03-12 10:16:15 +00:00
Matthew Waters
e3723cbde8 glcolorconvert: we don't do resizing of the video frames
As we cannot do accurate texel sampling then due to the texture
coordinates being interpolated based on the output frame size.
2015-03-12 09:47:31 +00:00
Nirbheek Chauhan
74a9cd58cd videoaggregator: While aggregating, sync values for all pads before converting frames 2015-03-12 09:47:50 +00:00
Matthew Waters
49b00e44ed gl/x11: don't XGetWindowAttributes every XEvent
fixes a deadlock in xcb where the X window may not exist.

https://bugzilla.gnome.org/show_bug.cgi?id=745633
2015-03-11 18:56:06 +00:00
Matthew Waters
efe0564f22 gl/window: hopefully fixup compile warnings on android/ios 2015-03-11 14:51:15 +00:00
Jan Schmidt
13ed5ab3c8 glfilter: Remove redundant check for clearing context on reset.
The context is already cleared a few lines above.
2015-03-12 01:33:03 +11:00
Jan Schmidt
f150cf2d2e Remove a bunch of silly ';;' typos at the end of lines 2015-03-12 01:33:03 +11:00
Matthew Waters
bc7a7259f3 gl/window: create the main loop/context on init/finalize
Avoids races setting the window handle from the main thread.

https://bugzilla.gnome.org/show_bug.cgi?id=745633
2015-03-11 13:52:15 +00:00
Matthew Waters
ee637bef1e aggregatory: don't redefine GST_FLOW_CUSTOM_SUCCESS 2015-03-11 13:52:15 +00:00
Mathieu Duponchelle
a8604bc4f8 adaptivedemux: fix get_presentation_offset check.
And return 0 isntead of FALSE.

https://bugzilla.gnome.org/show_bug.cgi?id=745455
2015-03-10 15:31:21 +01:00
Mathieu Duponchelle
b4d8c04f08 adaptivedemux: [API]: get_presentation_offset virtual method.
Asks the subclass for a potential time offset to apply to each
separate stream, in dash streams can have "presentation time offsets",
which can be different for each stream.

https://bugzilla.gnome.org/show_bug.cgi?id=745455
2015-03-10 15:17:37 +01:00
Nicolas Dufresne
7a3b34de79 glfilter: Don't chain downstream pool
Chaining a downstream pool would lead to two owner of the same
pool. In dynamic pipeline, if one owner is removed from the pipeline
the pool will be stopped, and the rest of the pipeline will fail
since the pool will now be flushing. Also fix proposed pool caching,
filter->pool was never set, never unrefed.

https://bugzilla.gnome.org/show_bug.cgi?id=745705
2015-03-06 19:25:16 -05:00
Sebastian Dröge
938d172fc2 gldownload: Simplify caps feature setting code 2015-03-06 18:54:24 +01:00
Sebastian Dröge
b81823e7db gl: Remove format info in glcolorconvert's transform_caps function instead of on every caller
... and let glmixer actually transform the caps it is supposed to transform
instead of inventing new caps.
2015-03-06 18:53:13 +01:00
Sebastian Dröge
50d2d9ac08 Revert "videoaggregator: Create new caps from the video-info"
This reverts commit 78215be0df.

because it broke glvideomixer with custom caps features.
2015-03-06 18:53:13 +01:00
Sebastian Dröge
90967b3d45 glupload: Simplify caps feature setting code 2015-03-06 18:53:13 +01:00
Sebastian Dröge
78215be0df videoaggregator: Create new caps from the video-info
In case the original caps were missing some optional fields like
interlace-mode. We assume default values for those everywhere,
but they can still cause negotiation to fail if a downstream element
expects the field to be there and at a specific value.
2015-03-06 14:36:26 +01:00
Edward Hervey
1172e2875d gldisplay: Only use debugging if we have valid values
The debug category won't have been created/activated if it's not a
valid display
2015-03-05 19:09:49 +01:00
Nicolas Dufresne
34402920d2 glfilter: Get rid of uploader if caps have changed
We need to update the uploader format if that caps have changed.

https://bugzilla.gnome.org/show_bug.cgi?id=745549
2015-03-03 14:05:21 -05:00
Edward Hervey
4220fe41be gl: Fix context leaks
Introduced by a12ca13750
2015-03-03 17:36:06 +01:00
Julien Isorce
74c294892d gl/cocoa: register only one custom nsapp loop
Otherwise the pipeline stalls when running
more than one glimagesink with gst-launch.

Also only register the custom nsapp loop
when setting up the nsapp from gstgl.
2015-03-02 07:49:26 +00:00
Julien Isorce
4801db552d gl/cocoa: instead of class_init use g_once to setup nsapp 2015-03-02 07:44:52 +00:00
Julien Isorce
8a0a71ff03 gl/cocoa: check for deprecated constants prior to OSX 10.10 2015-03-02 07:44:25 +00:00
Nicolas Dufresne
283aca3b51 glbufferpool: Fix offset for odd height
We also need to recalculate the offset, since otherwise the frame
mapping will be forward two lines in the U and V planes (I420) due
to gst_video_info_align() round up the Y plane to a even number of
lines.

https://bugzilla.gnome.org/show_bug.cgi?id=745054
2015-03-01 09:43:32 -05:00
Nicolas Dufresne
04377cfc5e glmemory: Support offset when downloading
Make sure we support offset and video alignment when downloading too.
This is currently not used (plane_start is always 0), but it makes
the code correct if we want to use that later.
2015-02-28 15:01:59 -05:00
Nicolas Dufresne
8c0fcef818 glmemory: Provide correct size on upload
Provide the right size to GL when uploading. Using maxsize is wrong
since we offset the data point with the memory offset and video
alignement offset.

https://bugzilla.gnome.org/show_bug.cgi?id=744246
2015-02-28 14:32:40 -05:00
Nicolas Dufresne
e9bec9ec0e glmemory: Provide correct size on download
Provide the right size to GL when downloading. This fixes downloading
from GLMemory that where created for libav.

https://bugzilla.gnome.org/show_bug.cgi?id=744246
2015-02-28 14:32:40 -05:00
Nicolas Dufresne
4db0ef5789 glmemory: Use fallback for partial copy
When the memory is partial copy, the texture size and videoinfo no
longer make sense. As we cannot guess what the application wants, we
safely copy into a sysmem memory.

https://bugzilla.gnome.org/show_bug.cgi?id=744246
2015-02-28 14:32:40 -05:00
Nicolas Dufresne
b8f168cd65 glmemory: Add GstAllocationParams and alignment support
This implements support for GstAllocationParams and memory alignments.
The parameters where simply ignored which could lead to crash on
certain platform when used with libav and no luck.

https://bugzilla.gnome.org/show_bug.cgi?id=744246
2015-02-28 14:32:39 -05:00
Matthew Waters
03b5288f64 glupload: perform egl upload on the gl thread
Fixes EGLImage usage on raspberry pi

https://bugzilla.gnome.org/show_bug.cgi?id=743914
2015-02-28 18:29:52 +11:00
Arun Raghavan
2e5d6c3a3e aggregator: Use standard upstream latency querying logic
The same functionality is duplicated in the default latency querying
now.
2015-02-27 01:05:51 +05:30
Víctor Manuel Jáquez Leal
75e875b022 glupload: Set freed method implementation to NULL
When trying to render buffers with meta:GLTextureUpload the glimagesink crashes
with a segmentation fault.

This patch workarounds this crash setting to NULL the method implementation
after free.

https://bugzilla.gnome.org/show_bug.cgi?id=745206
2015-02-26 14:39:32 +02:00
Edward Hervey
a12ca13750 glwindow: Deactivate window before changing handle
When setting a new window handle, we need to ensure all implementations
will detect the change.

For that we deactivate the context before setting the window handle, then
reactivate the context

https://bugzilla.gnome.org/show_bug.cgi?id=745090
2015-02-24 17:42:13 +01:00
Edward Hervey
7075b25288 gl/egl: Detect window handle changes
When (re)activating the context, the backing window handle might have changed.
If that happened, destroy the previous surface and create a new one

https://bugzilla.gnome.org/show_bug.cgi?id=745090
2015-02-24 17:42:13 +01:00
Luis de Bethencourt
0b1d11b2b6 gl: remove docbook related warnings 2015-02-24 14:30:44 +00:00
Arun Raghavan
70ed4fd438 mpegts: Fix a compiler warning
Causes the following warning on clang:

gst-dvb-section.c:567:36: error: format specifies type 'unsigned long' but the argument has type 'int' [-Werror,-Wformat]
          descriptors_loop_length, end - 4 - data);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
2015-02-24 19:06:30 +05:30
Matthew Waters
08b1d27e14 glmemory: allow sharing between buffers
There was no real reason why the flag was set.  We should be able
to handle it.  Fixes last-sample handling on gl sinks
2015-02-25 00:00:48 +11:00
Matthew Waters
21e95ef9fd glsyncmeta: add compat definition for gles2 2015-02-24 20:35:32 +11:00
Matthew Waters
beac141057 gl/calayer: don't use the async callback to render
not until we can provide equivalent functionality for other window
implementations.
2015-02-24 19:12:10 +11:00
Matthew Waters
7691d2c4e7 glsyncmeta: also supported with gles3 2015-02-24 19:12:10 +11:00
Alessandro Decina
2a430872ed libgstgl: eagl: handle CALayer resize 2015-02-24 14:23:49 +11:00
Vasilis Liaskovitis
c55689ad16 glmemory: Fix transfer_pbo memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=744977
2015-02-23 18:44:39 +02:00
Julien Isorce
4c4eec61e6 gl/cocoa: reduce custom main loop latency
This fix a very slow rendering rate regression that only
happens when using gst-launch, i.e. in the case where
the main thread does not run any NSApp loop.

Git bisect reported it has been introduced by the commit
e10d2417e2:
"move to CGL and CAOpenGLLayer for rendering".

Then the commit 7d46357627:
"gstglwindow_cocoa: fix slow render rate" attempted to fix
the slow rendering rate problem when using gst-launch.

At least for me it does not work. I tried several
combinations, for example to flush CA transactions in the
custom app loop, as mentioned in the doc, but the only solution
that fixes the slow rendering is by reducing the loop latency.
From what I tested, no need to put less than 60ms, even if the
framerate has an interval much lower (16.6ms for 60 fps).
2015-02-22 10:37:39 +00:00
Mathieu Duponchelle
3baa710638 gstglmemory: Remove now unused transfer_upload function. 2015-02-21 14:42:05 +01:00
Matthew Waters
c6f548326d glmemory: disable automatic pbo upload
until we can track where the data is/or is going to be.
2015-02-21 23:32:41 +11:00
Matthew Waters
a4040f2ee9 glememory: only store and act on the map flags on first/last map/unmap
Anytime else, we have no idea how to match up map and unmaps.
We also don't know exactly how the calling code is using us.
Also fixes the case where we're trying to transfer while someone else
is accessing our data pointer or texture resulting in mismatched video
frames.

https://bugzilla.gnome.org/show_bug.cgi?id=744839
2015-02-20 18:48:15 +11:00
Olivier Crete
880dcd8039 aggregator: Use src_lock to protect latency related members
One has to use the src_lock anyway to protect the min/max/live so they
can be notified atomically to the src thread to wake it up on changes,
such as property changes. So no point in having a second lock.

Also, the object lock was being held across a call to
GST_ELEMENT_WARNING, guaranteeing a deadlock.
2015-02-19 21:22:53 -05:00
Olivier Crête
083df6412f aggregator: Remove untrue comment 2015-02-19 19:05:42 -05:00
Olivier Crête
97f6b7a8aa aggregator: Don't try to push tags while flush seeking
The downstream segment could have been flushed already, so
need to re-send the segment event before re-sending the tags.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-02-19 19:05:27 -05:00
Sebastian Dröge
2516e8111c aggregator: Use the sinkpads iterator directly to query upstream latencies
While gst_aggregator_iterate_sinkpads() makes sure that every pad is only
visited once, even when the iterator has to resync, this is not all we have
to do for querying the latency. When the iterator resyncs we actually have
to query all pads for the latency again and forget our previous results. It
might have happened that a pad was removed, which influenced the result of
the latency query.
2015-02-19 11:04:28 +02:00
Sebastian Dröge
d3205e1363 aggregator: Move gst_aggregator_get_latency_unlocked() a bit
It was between another function and its helper function before, which was
confusing when reading the code as it had nothing to do with the other
functions.
2015-02-19 10:57:09 +02:00
Sebastian Dröge
44ffb87f8a aggregator: Fail the latency query if one of the upstream queries fails 2015-02-19 01:28:06 +02:00
Olivier Crête
c37e82587c aggregator: Document locking order
https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-02-18 17:20:03 -05:00
Olivier Crête
17df37d8cb aggregator: Rename confusinly named SRC_STREAM_LOCK macros to SRC_LOCK
This will match the name of the lock itself. It is also not a stream
lock as it not recursive and not held while pushing.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-02-18 17:20:03 -05:00
Olivier Crête
3a3f2b5343 aggregator: Rename confusingly named stream lock to flush lock
This lock is not what is commonly known as a "stream lock" in GStremer,
it's not recursive and it's taken from the non-serialized FLUSH_START event.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-02-18 17:20:03 -05:00
Olivier Crête
36ef8f0bd4 aggregator: Fix macro indendation
Changes no code

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-02-18 17:20:03 -05:00
Thiago Santos
f7a1649c77 adaptivedemux: add bitrate-limit property
Move the property from subclasses to adaptivedemux, it allows
selecing the percentage of the measured bitrate to be used when
selecting stream bitrates
2015-02-17 11:12:42 -03:00
Thiago Santos
e9ab79dc36 adaptivedemux: add connection-speed property
Allows to set a bitrate directly instead of measuring it internally
based on the received chunks. The connection-speed was removed from
mssdemux and hlsdemux as it is now in the base class
2015-02-17 11:12:41 -03:00
Tim-Philipp Müller
34c9c86ab7 basecamerabinsrc: don't use private GMutex implementation details
Don't use private GMutex implementation details to check
whether it has been freed already or not. Just clear mutex
and GCond unconditionally in free function, they are always
inited anyway, and the free function can't be called multiple
times either.
2015-02-17 09:56:55 +00:00
Matthew Waters
0fd6872f7d gl/cocoa: don't deadlock if the dispatch_sync is called from the main thread
Provide a helper function to check whether we are being called from
the main thread and act appropriately.
2015-02-17 19:45:35 +11:00
Matthew Waters
96398e5bac gl/calayer: only start drawing if the parent gl context is ready
otherwise we may try to use GstGLFuncs * that hasn't been set yet
2015-02-17 19:45:35 +11:00
Matthew Waters
ccf8b69a67 gl/cocoa: small refactor of layer/view creation into the window 2015-02-17 19:45:35 +11:00
Sebastian Dröge
475dfaedc1 glwindow: Remove assertion in gst_gl_window_show() for subclasses not implementing it
On Android and iOS we can't create a window ourselves, so also can't just show
one. That's not a problem and an assertion is not really needed here.
2015-02-17 01:04:38 +02:00
Tim-Philipp Müller
282dbcee0b aggregator: drop GAP events until we handle them properly 2015-02-13 23:45:20 +00:00
Tim-Philipp Müller
54d288fc19 videoaggregator: use new gst_aggregator_pad_drop_buffer() 2015-02-13 16:25:52 +00:00
Tim-Philipp Müller
3c2ee8ece5 aggregator: use new gst_aggregator_pad_drop_buffer() 2015-02-13 16:25:45 +00:00
Tim-Philipp Müller
592c2c8105 aggregator: add gst_aggregator_pad_drop_buffer()
steal_buffer() + unref seems to be a wide-spread idiom
(which perhaps indicates that something is not quite
right with the way aggregator pad works currently).
2015-02-13 16:25:45 +00:00
Tim-Philipp Müller
55abf436a0 aggregator: only post latency message if anything changed
Perhaps we should check for element state as well and
only post it if in PLAYING state.
2015-02-13 16:25:14 +00:00
Mathieu Duponchelle
b6f2a962b5 adaptivedemux: Fix logic in fragment_download_finish.
This was preventing us from surfacing a meaningful error.

https://bugzilla.gnome.org/show_bug.cgi?id=743703
2015-02-12 23:07:36 +01:00
Mathieu Duponchelle
6b864813cc adaptivedemux: Set first segment time to segment start.
Otherwise as long as a seek wasn't executed, the position was
reported incorrectly:

gst-validate-1.0 playbin \
uri=http://dev-iplatforms.kw.bbc.co.uk/dash/news24-avc3/news24.php

https://bugzilla.gnome.org/show_bug.cgi?id=744362
2015-02-12 22:47:26 +01:00
Edward Hervey
f09272f434 gl: Add/Update more debug statements
Where possible, use the _OBJECT variants in order to track better from
which object the debug statement is coming from

Define (and use) GST_CAT_DEFAULT where applicable

Use GST_PTR_FORMAT where applicable
2015-02-12 15:57:55 +01:00
Edward Hervey
929a6a75d2 gl: Make glcontext debug category used in more places
As a bonus it makes the egl context debug messages visible now :)
2015-02-12 15:57:55 +01:00
Mathieu Duponchelle
c98348c141 adaptivedemux: track per-fragment bitrates.
And use the average to go up in resolution, and the last fragment
bitrate to go down.

This allows the demuxer to react rapidly to bitrate loss, and
be conservative for bitrate improvements.

+ Add a construct only property to define the number of fragments
  to consider when calculating the average moving bitrate.

https://bugzilla.gnome.org/show_bug.cgi?id=742979
2015-02-12 00:07:15 +01:00
Sebastian Dröge
037928dcf6 Improve and fix LATENCY query handling
This now follows the design docs everywhere, especially the maximum latency
handling.

https://bugzilla.gnome.org/show_bug.cgi?id=744106
2015-02-11 14:16:21 +01:00