Commit graph

3151 commits

Author SHA1 Message Date
Matthew Waters
b42ccb0556 gldisplay: demote no platform display debug to info
Avoids confusing everyone with a warning that's not always fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=746933
2016-05-15 13:14:41 +03:00
Matthew Waters
799efcb133 gl: take the affine transformation in NDC
Provide a function to get the affine matrix in the meta in terms of NDC
coordinates and use as a standard opengl matrix.

Also advertise support for the affine transformation meta in the allocation
query.
2016-05-14 16:35:29 +03:00
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