Commit graph

2636 commits

Author SHA1 Message Date
Matthew Waters
ed7d7418c2 glcolorconvert: use the correct caps feature for supported caps
glcolorconvert currently only supports converting between GLMemory
targets.
2015-02-02 21:07:48 +11:00
Matthew Waters
abb55f2453 glsyncmeta: don't use the gst debug object variants
We are not a GObject or any inferable GstMiniObject supported by
the gst debug system.  Also fixes a segfault.
2015-02-02 20:51:31 +11:00
Alessandro Decina
b1aae5cb70 Revert "libgstgl: gstglcaopengllayer: set the layer as opaque"
This reverts commit 6f152d381c.

The layer shouldn't be always opaque, it should be made a property.
2015-01-30 12:32:17 +11:00
Alessandro Decina
6f152d381c libgstgl: gstglcaopengllayer: set the layer as opaque 2015-01-30 12:22:25 +11:00
Sebastian Dröge
c2492b3a6b glcolorconvert: Add FIXME comment about possibility of non-Apple YCbCr422 rectangular textures 2015-01-29 16:30:34 +01:00
Sebastian Dröge
4b6a968203 glcolorconvert: Only use GL_TEXTURE_RECTANGLE with OpenGL
It's not defined for GLES.
2015-01-29 16:26:26 +01:00
Alessandro Decina
3655e8b8bc libgstgl: run a custom shader to convert YUV to RGB on mac and ios
When GL_APPLE_ycbcr_422 is available, run a custom shader to convert
GL_TEXTURE_RECTANGLE textures from YUV to RGB.

See https://www.opengl.org/registry/specs/APPLE/ycbcr_422.txt
2015-01-30 00:34:08 +11:00
Alessandro Decina
5f547c5600 gl: initial support for texture targets other than GL_TEXTURE_2D
Make GstGLMemory hold the texture target (tex_target) the texture it represents
(tex_id) is bound to. Modify gst_gl_memory_wrapped_texture and
gst_gl_download_perform_with_data to take the texture target as an argument.

This change is needed to support wrapping textures created outside libgstgl,
which might be bound to a target other than GL_TEXTURE_2D. For example on OSX
textures coming from VideoToolbox have target GL_TEXTURE_RECTANGLE.

With this change we still keep (and sometimes imply) GL_TEXTURE_2D as the
target of textures created with libgstgl.

API: modify GstGLMemory
API: modify gst_gl_memory_wrapped_texture
API: gst_gl_download_perform_with_data
2015-01-30 00:34:08 +11:00
Alessandro Decina
12e8bb4a66 gstglcolorconvert: micro optimization
Don't call glClear && glClearColor at each draw since we're going to draw the
whole viewport anyway. Gets rid of a glFlush triggered by glClear on OSX.
2015-01-30 00:34:08 +11:00
Alessandro Decina
c7284a6390 gstglcolorconvert: relax caps features check
Require caps to have the GST_CAPS_FEATURE_MEMORY_GL_MEMORY feature but allow
them to have more features.
2015-01-30 00:34:08 +11:00
Matthew Waters
1e6011bcdf gl/win32: fixup compilation 2015-01-29 23:46:57 +11:00
Matthew Waters
6cf97eb221 glwindow: make showing a window explicit
Also fixes the cgl context always displaying a window to render to for
every GstGLContextCocoa created
2015-01-29 22:26:37 +11:00
Thibault Saunier
71e4c485f0 aggregator: Cleanup locking around AggregatorPad flush related fields
And document the locking

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Mathieu Duponchelle
b27fb0dbac aggregator: keep chain functions as dumb as possible.
+ A pad chain function has no business checking other pads,
  that's what the aggregate thread is for.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
ccf329d527 aggregator: More fixes around locking when accessing protected private fields
In some more places we were accessing GstAggregator->segment
and GstAggregator->seqnum without holding the GST_OBJECT_LOCK

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
1a07467d5f aggregator: Make the PAD_LOCK private
Instead of using the GST_OBJECT_LOCK we should have
a dedicated mutex for the pad as it is also associated
with the mutex on the EVENT_MUTEX on which we wait
in the _chain function of the pad.

The GstAggregatorPad.segment is still protected with the
GST_OBJECT_LOCK.

Remove the gst_aggregator_pad_peak_unlocked method as it does not make
sense anymore with a private lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
d8eef43123 aggregator: Hide GstAggregatorPad buffer and EOS fileds
And add a getter for the EOS.

The user should always use the various getters to access
those fields

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
93d0b51dba aggregator: Document locking of GstAggregatorPrivate members
Most of them are protected by the object lock, specify
which ones use a different lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
ea76d39738 aggregator: Document how the segment is protected
Document that it can only be accessed with the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
9df8ac0a98 aggregator: Protect all latency related members with the object lock
The locking was not consistent, now consistently use the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
41d26673d6 aggregator: Document locking for gst_aggregator_get_latency_unlocked()
Renamed it to _unlocked() to make it clear.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
f7070dcfdc aggregator: Protect the srcpad caps negotiation with the stream lock
Instead of adding another lock, use the srcpad stream lock, which is already
taken anyway to push out the new caps if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
4a5882ee08 aggregator: Protect the tags with the object lock
The tags related variables were sometimes protected, sometimes not and
sometimes atomic. Put them all under the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
eddd5fd259 aggregator: Consistenly lock the flow_return state
Use the object's lock to protect it.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
cc605f4560 aggregator: Consistently lock some members
Some members sometimes used atomic access, sometimes where not locked at
all. Instead consistently use a mutex to protect them, also document
that.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
ee04b09233 videoaggregator: Lock access to members of GstAggregatorPad
Take the pad's object lock before accessing members of the
GstAggregatorPad structure.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
68ac6438f0 aggregator: Protect exported pad members with the pad's object lock
https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
cc3f418516 aggregator: Replace event lock with pad's object lock
Reduce the number of locks simplify code, what is protects
is exposed, but the lock was not.

Also means adding an _unlocked version of gst_aggregator_pad_steal_buffer().

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
0a2dc1185c aggregator: Protect data with the same mutex as GCond
Whenever a GCond is used, the safest paradigm is to protect
the variable which change is signalled by the GCond with the same
mutex that the GCond depends on.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:17 +01:00
Nirbheek Chauhan
878b53f8fc videoaggregator: If getting a timeout before having caps, just advance our position
This can happen if this is a live pipeline and no source produced any buffer
and sent no caps until an output buffer should've been produced according to the
latency.

This fix is similar in spirit to commit be7034d1 by Sebastian for audiomixer.
2015-01-29 09:47:32 +01:00
Matthew Waters
6d9dc9c81c gl/calayer: add resize callback based on the bounds rectangle 2015-01-29 18:32:04 +11:00
Matthew Waters
2ab0e1517f gl/caopengllayer: draw asynchronously
This essentially makes the CAOpenGLLayer draw every refresh cycle.
2015-01-29 18:32:04 +11:00
Matthew Waters
f3273cafc4 gl/cocoa: don't segfault if we have a NULL draw/resize/close callback 2015-01-29 18:32:04 +11:00
Matthew Waters
8d5ba8d96a cgl/calayer: use a callback instead of hardcoding the draw functionality 2015-01-29 18:32:04 +11:00
Matthew Waters
693cdb47cd cgl: install the gl context and gl layer headers 2015-01-29 18:32:04 +11:00
Matthew Waters
9caf706185 cgl: add a header for the CAOpenGLLayer support 2015-01-29 18:32:04 +11:00
Philippe Normand
cfc0230e04 gl/dispmanx: fix build
Commit ab48bb6f0f changed the API of
GstGLWindow.
2015-01-27 21:31:21 +11:00
Matthew Waters
08dbd8bbd7 glmemory: more compatibility defines for gles2 systems 2015-01-27 14:52:47 +11:00
Matthew Waters
eea03967e4 glmemory: add some thread safety for gl operations 2015-01-27 12:26:05 +11:00
Matthew Waters
9a55a3f98c glmemory: use pbo's for download
In order to use pbo's efficiently, the transfer operation has to
be separated from the use of the downloaded data which requires some
rearchitecturing around glcolorconvert/gldownload and elements
2015-01-27 12:26:04 +11:00
Matthew Waters
f2667ebc7b glprototypes: add some (un)map buffer variants for GL/GLES 2015-01-27 12:26:04 +11:00
Tim-Philipp Müller
21168dd199 videoaggregator: fix crash when receiving buffer without timestamps
Unset out buffer in clip function when we unref the buffer to be
clipped, otherwise aggregator will continue to use the already-
freed buffer. Fixes crash when buffers without timestamps are
being fed to aggregator. Partly because aggregator ignores the
error flow return.

https://bugzilla.gnome.org/show_bug.cgi?id=743334
2015-01-26 09:24:40 +00:00
Edward Hervey
aebec9bd24 codecparsers: Indent file
Someone's been commiting without using gst-indent :)
2015-01-23 12:26:16 +01:00
Edward Hervey
3da1c9c8d5 codecparsers: Add READ_UE_MAX macro
READ_UE_ALLOWED was almost exclusively used with min == 0, which doesn't
make much point for unsigned integers.

Add a READ_UE_MAX variant and use that instead. Also replaced two usages
of CHECK_ALLOWED (a,0,something) by CHECK_ALLOWED_MAX (a, something)
2015-01-23 12:24:52 +01:00
Matthew Waters
27e5e0c2df gl/window/eagl: fix a couple of typos 2015-01-23 16:52:25 +11:00
Matthew Waters
06fdbd44b9 glwindow: cleanup/reorganize functions/members into logical groups 2015-01-23 16:39:44 +11:00
Matthew Waters
ab48bb6f0f glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2015-01-23 16:11:31 +11:00
Matthew Waters
4fc554054c glcontext/cocoa: avoid destroying a possibly 0 GSource id 2015-01-22 21:43:51 +11:00
Matthew Waters
e10d2417e2 gl/cocoa: move to CGL and CAOpenGLLayer for rendering
Removes the use of NSOpenGL* variety and functions.  Any Cocoa
specific functions that took/returned a NSOpenGL* object now
take/return the CGL equivalents.
2015-01-22 21:29:52 +11:00
Matthew Waters
fe8fdbdc7c glcontext/cocoa: add debug category 2015-01-22 21:27:44 +11:00
Sebastian Dröge
80e02cbdf9 Constify some static arrays everywhere 2015-01-21 10:18:50 +01:00
Thiago Santos
9ebbce381a adaptivedemux: do not skip the first fragment
Avoid advancing fragment right after downloading the header. If it
is the header, by default, don't advance to the next fragment.
2015-01-20 14:55:05 -03:00
Thiago Santos
919b93ae35 adaptivedemux: add explicit cast to make clang happy
Fixes compilation
2015-01-20 09:23:02 -03:00
Thiago Santos
229a15b393 adaptivedemux: refactor chunk downloading flow
Add more power to the chunk_received function (renamed to data_received)
and also to the fragment_finish function.

The data_received function must parse/decrypt the data if necessary and
also push it using the new push_buffer function that is exposed now. The
default implementation gets data from the stream adapter (all available)
and pushes it.

The fragment_finish function must also advance the fragment. The default
implementation only advances the fragment.

This allows the subsegment handling in dashdemux to continuously download
the same file from the server instead of stopping at every subsegment
boundary and starting a new request
2015-01-19 15:30:04 -03:00
Thiago Santos
9336077057 adaptivedemux: fix multi-period playback
If we say it is the first segment after a new period it will resync
the segment.start value and all buffers will be late for the new period
we are trying to play. Otherwise we want to keep the segment.start with
the previous value to allow the running time to smoothly increase
2015-01-19 08:36:42 -03:00
Lasse Laursen
174ea7af7b glapi: fix compilation with latest MSVC
https://bugzilla.gnome.org/show_bug.cgi?id=743041
2015-01-17 10:56:20 +11:00
Matthew Waters
989af902fe glmemory: use the correct size for the pbo
It was missing the GstVideoAlignment padding which could cause GL
errors related to overrunning the size of the pbo.
2015-01-17 10:56:20 +11:00
Thiago Santos
3a79bd91c7 adaptivedemux: prevent early EOS when switching at last fragment
Check if there is a next fragment before advancing to avoid causing
a bitrate switch (and maybe exposing new pads) only to push EOS.
This causes playback to stop with an error instead of properly
finishing with EOS message.
2015-01-16 17:07:22 -03:00
Thiago Santos
516f1ae0f4 adaptivedemux: add a special return to signal subsegment boundary
The subsegment boundary return tells the adaptivedemux that it can
try to switch to another representation as the stream is at a suitable
position for starting from another bitrate.
2015-01-16 15:00:11 -03:00
Thiago Santos
9b260d1ba5 adaptivedemux: Actually use the byte range for the fragment url
Otherwise we would always download the full fragment. This would
make handling subsegments in DASH impossible.
2015-01-16 15:00:11 -03:00
Thiago Santos
5c3a87c117 adaptivedemux: allow downloads of headers only
In order to get some subsegment information, subclasses might want
to download only the headers to have enough data (the index)
to decide where to start downloading from the subsegment.
2015-01-16 15:00:11 -03:00
Thiago Santos
f7e9a58c58 adaptivedemux: refactor common code to function
Reuse the same function when finishing downloading and signaling to
the download loop thread to get the next fragment or abort
2015-01-16 15:00:11 -03:00
Thiago Santos
5823f8b408 adaptivedemux: inform subclass when headers/index are being downloaded
This allows the subclasses to know if the chunks that are downloaded are
part of the header or of the index and will parse the parts that are
of their interest.
2015-01-16 15:00:11 -03:00
Vincent Penquerc'h
0b499484b4 uridownloader: a few leak fixes 2015-01-16 11:43:22 +00:00
Vincent Penquerc'h
59bd35aed1 fragment: fix caps and buffer leaks in get_property 2015-01-16 11:43:22 +00:00
Matthew Waters
8fef381417 glmemory: remove spurious gst_video_info_align
That will be taken care of by the calling code (typically a bufferpool).
The GstVideoAlignment is purely informational to compute plane data sizes.
2015-01-15 09:50:02 +11:00
Nirbheek Chauhan
4b9924557a aggregator: Nitpick spacing/punctuation in debug logging 2015-01-14 19:21:31 +01:00
Vincent Penquerc'h
c73a5e0c54 h264parser: fix stack smashing
Ensure that we do not trust the bitstream when filling a table
with a fixed max size.
Additionally, the code was not quite matching what the spec says:
- a value of 3 broke from the loop before adding an entry
- an unhandled value did not add an entry
The reference algorithm does these things differently (7.3.3.1
in ITU-T Rec. H.264 (05/2003)).

This plays (apparently correctly) the original repro file, with
no stack smashing.

Based on a patch and bug report by André Draszik <git@andred.net>
2015-01-14 11:39:55 +00:00
Matthew Waters
d5c3693791 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2015-01-14 22:22:13 +11:00
Matthew Waters
4ccf45823e glmemory: offset the data pointer for upload for GstVideoAlignment
otherwise we attempt to read from the padding data
2015-01-14 22:22:13 +11:00
Matthew Waters
d1e923765b glmemory: use pbo's for upload 2015-01-14 22:22:13 +11:00
Matthew Waters
8c2d5dac72 glupload: relax the GLMemory uploader check for input caps features
As there may be a sysmem caps features with GLMemory filled buffers.
e.g.

videotestsrc ! glimagesink
2015-01-14 22:22:13 +11:00
Nicola Murino
442451a30d glcolorconvert: fix memleak
https://bugzilla.gnome.org/show_bug.cgi?id=741943
2015-01-13 15:20:34 +11:00
Nicola Murino
3c6d775766 glupload: fix some memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=741943
2015-01-13 15:19:39 +11:00
Matthew Waters
4c73e20553 glcontext: allow wrapped contexts to be utilised like non-wrapped contexts
Fill in the missing pieces like get_proc_address, the gl function vtable
2015-01-13 15:18:41 +11:00
Stefan Sauer
4732962c85 gitignore: ignore more files 2015-01-12 22:52:36 +01:00
Sebastian Dröge
fa5c433e7e gl/cocoa: Disable hack for NSApp iteration with a special #define
The hack causes deadlocks and other interesting problems and it really
can only be fixed properly inside GLib. We will include a patch for
GLib in our builds for now that handles this, and hopefully at some
point GLib will also merge a proper solution.

A proper solution would first require to refactor the polling in
GMainContext to only provide a single fd, e.g. via epoll/kqueue
or a thread like the one added by our patch. Then this single
fd could be retrieved from the GMainContext and directly integrated
into a NSRunLoop.

https://bugzilla.gnome.org/show_bug.cgi?id=741450
https://bugzilla.gnome.org/show_bug.cgi?id=704374
2015-01-10 15:54:30 +01:00
Olivier Crête
9ba9873b1f aggregator: Remove pointless atomic
It is only modified from the streaming thread
2015-01-09 22:08:08 -05:00
Olivier Crête
22ea83e7fa aggregator: Fix query leak 2015-01-09 22:02:53 -05:00
Sebastian Dröge
713205fbe6 aggregator: Print jitter from clock waiting in the debug logs 2015-01-09 16:43:58 +01:00
Sebastian Dröge
1b2de14000 gl/cocoa: Don't init and clear static GMutex / GCond
We would potentially use it from the main loop later in
gst_gl_window_cocoa_init_nsapp() if it timed out before.
2015-01-08 09:36:24 +01:00
Luis de Bethencourt
75cc750efc glfilter: remove logically dead code
Soon after setting two variables to 1, the code checks if their values are
different from each other. This would never be true. Removing this.

CID 1226443
2015-01-07 16:53:41 +00:00
Thiago Santos
c1251ab861 adaptivedemux: only update segment if we have a valid PTS
Otherwise we set the position to GST_CLOCK_TIME_NONE and it disrupts
bitrate switching
2015-01-07 09:30:40 -03:00
Thiago Santos
af78e2501c adaptivedemux: prepare for supporting seeks in live streams
Add function to allow subclasses to specify seeking range for
live streams

https://bugzilla.gnome.org/show_bug.cgi?id=725435
2015-01-05 17:58:54 -03:00
Tim-Philipp Müller
fbd4cf9810 aggregator: don't use iterator when setting flush pending on pads 2015-01-04 17:25:45 +00:00
Tim-Philipp Müller
4da01dadcc aggregator: check if pads are ready more efficiently
No need to use an iterator for this which creates a temporary
structure every time and also involves taking and releasing the
object lock many times in the course of iterating. Not to mention
all that GList handling in gst_aggregator_iterate_sinkpads().
2015-01-04 17:07:43 +00:00
Tim-Philipp Müller
3e38003218 aggregator: name vfunc arguments consistently 2015-01-04 12:59:19 +00:00
Tim-Philipp Müller
10d5e878d8 aggregator: add g-i transfer and scope annotations 2015-01-01 15:48:08 +00:00
Tim-Philipp Müller
82f74cd9e0 aggregator: register names of iterate_sinkpads functions with debug system 2015-01-01 14:10:05 +00:00
Tim-Philipp Müller
22d4c7a5c5 aggregator: reduce debug messages for taking/releasing logs to TRACE level
Don't spam debug log with this stuff.
2015-01-01 14:04:24 +00:00
Tim-Philipp Müller
6e30a98fd5 aggregator: move property member into private structure
Our locking (or lack thereof) while accessing this also
looks generally quite dodgy.
2014-12-31 18:18:03 +00:00
Tim-Philipp Müller
b00ea0cc08 aggregator: remove empty dispose function 2014-12-31 14:50:58 +00:00
Tim-Philipp Müller
ad40a65a01 aggregator: give private functions namespace prefix
Especially the GST_DEBUG_FUNCPTR ones.
2014-12-31 12:36:08 +00:00
Tim-Philipp Müller
d0068899bf aggregator: fix up some docs comments in header 2014-12-31 12:35:06 +00:00
Tim-Philipp Müller
7b282513f3 aggregator: remove now-unused system clock member 2014-12-30 23:44:46 +00:00
Tim-Philipp Müller
c1f6ef5f53 aggregator: make GstAggregatorPadForeachFunc take an GstAggregatorPad 2014-12-30 19:22:01 +00:00
Tim-Philipp Müller
6fc474c30a videoaggregator: update for aggregator start/stop vfunc change 2014-12-30 17:56:35 +00:00
Tim-Philipp Müller
b4d2deb6d6 aggregator: bring start/stop vfunc semantics in line with other baseclasses
Sub-class should not have to chain up to GstAggregator's start/stop
vfuncs, same as in GstBaseSrc, GstBaseSink, GstBaseTransform etc.
2014-12-30 17:55:05 +00:00
Tim-Philipp Müller
45ae4d7f9c aggregator: remove pointless GST_DEBUG_FUNCPTR
Not useful for GObject vfuncs.
2014-12-28 18:26:49 +00:00
Tim-Philipp Müller
773e426616 aggregator: remove duplicate pad parent_class variable
G_DEFINE_TYPE already provides one, just need to use it.
2014-12-28 18:25:00 +00:00
Tim-Philipp Müller
813ada29ad aggregator: add _CAST() variants for cast macros 2014-12-28 18:22:57 +00:00
Tim-Philipp Müller
83de85a2f3 aggregator: make padding larger
Esp. the class structures, can't have enough
spare space for virtual functions.
2014-12-28 01:13:33 +00:00
Nirbheek Chauhan
2a6446e519 aggregator: Log to the pad instead of the element
More correct way of doing the same thing as before
2014-12-27 11:06:09 +00:00
Sebastian Dröge
ba1b53113a aggregator: Make sure that the minimum latencies are never GST_CLOCK_TIME_NONE 2014-12-27 09:49:43 +01:00
Sebastian Dröge
6449e3d897 aggregator: Wait for the minimum latency, not the maximum
The minimum latency is the latency we have to wait at least
to guarantee that all upstreams have produced data. The maximum
latency has no meaning like that and shouldn't be used for waiting.
2014-12-27 09:45:08 +01:00
Nirbheek Chauhan
46f857b314 aggregator: Clamp the min latency at the max if it's greater 2014-12-27 09:45:08 +01:00
Nirbheek Chauhan
3193094cbc aggregator: Print the sinkpad name while logging latency queries
Very useful while debugging.
2014-12-27 09:45:08 +01:00
Nirbheek Chauhan
f3efb9e7d6 aggregator: Take the stream lock when iterating sink pads
When iterating sink pads to collect some data, we should take the stream lock so
we don't get stale data and possibly deadlock because of that. This fixes
a definitive deadlock in _wait_and_check() that manifests with high max
latencies in a live pipeline, and fixes other possible race conditions.
2014-12-27 09:45:08 +01:00
Thiago Santos
c65aeedb6f adaptivedemux: check if element exists before setting it to null
Under certain error conditions it might happen that the element
has been freed already and trying to set it to NULL causes an
assertion
2014-12-23 10:08:57 -03:00
Thiago Santos
3dfab51b92 adaptivedemux: make sure task has stopped before freeing it
Otherwise the thread will be running and its memory will get freed.
This leads to memory corruption
2014-12-23 10:08:56 -03:00
Thiago Santos
0bef1974e2 adaptivedemux: fix segment start when exposing new streams
Segment start needs only to be updated when starting the streams
or after a seek, doing it during bitrate changes will cause the
running time to go discontinuous (jump back to a previous ts)
and QOS will drop buffers
2014-12-23 10:08:56 -03:00
Thiago Santos
73fb0850c9 adaptivedemux: allow subclass to use new pads group when switching bitrate
Fix pad groups switching when bitrate changes to allow HLS to use this feature
2014-12-23 10:08:51 -03:00
Sebastian Dröge
6771db209d aggregator: Don't leak flush-start events 2014-12-23 11:45:05 +01:00
Sebastian Dröge
e7867a3586 aggregator: Also change the default latency to 0, not just the minimum 2014-12-23 10:24:27 +01:00
Sebastian Dröge
c04bb6983e aggregator: Fix docs and default value of the latency property 2014-12-23 09:52:20 +01:00
Sebastian Dröge
800f0ac49b aggregator: Also include the subclass latency in the result of the latency query 2014-12-22 22:19:52 +01:00
Sebastian Dröge
ad9fe1fe7b videoaggregator: Use the src query implementation of aggregator as the default case 2014-12-22 22:12:02 +01:00
Sebastian Dröge
5dd1dfdadc aggregator: Post a latency message if the value of the latency property changes 2014-12-22 15:27:25 +01:00
Sebastian Dröge
a27ff89d42 aggregator: Wake up the src thread after handling a latency query
Due to changed latencies or changed live-ness we might have to
adjust if we wait on a deadline at all and how long.
2014-12-22 15:03:59 +01:00
Sebastian Dröge
341e5291c3 aggregator: Don't count the number of times we need to wake up but instead check all conditions for waiting again
This simplifies the code and also makes sure that we don't forget to check all
conditions for waiting.

Also fix a potential deadlock caused by not checking if we're actually still
running before starting to wait.
2014-12-22 15:00:36 +01:00
Nicolas Dufresne
207308446b glbufferpool: Always recalculate buffer size
Actually we should always recalculate buffer size since our buffer size
even when not-padded is smaller for many sub-sampled formats. This is
because we don't add padding between the planes.

https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 12:25:41 -05:00
Nicolas Dufresne
170a49f901 glmemory: No need for padding
A memory object cannot be put on stack, so no need for padding.
2014-12-19 12:12:08 -05:00
Nicolas Dufresne
9954de1ccd gl: Add support for GstVideoAlignment
This allow saving a copy with libav video decoders or decoders with
similar padding requirement.

https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 12:11:08 -05:00
Nicolas Dufresne
da3ae06cd1 glmemory: Handle upload/download flags from map
Problem was that if buffer was mapped READWRITE (state of buffers from
libav right now), mapping it READ/GL will not upload. This is because the
flag is only set when the buffer is unmapped. We can fix this by setting
the flags in map. This result in already mapped buffer that get mapped
to be read in GL will be uploaded. The problem is that if the write
mapper makes modification afterward, the modification will never get
uploaded.

https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 11:45:35 -05:00
Nicolas Dufresne
4f3c33af3a glmemory: Handle custom stride with OPENGL3
https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 11:45:35 -05:00
Sebastian Dröge
30ce523d59 videoaggregator: Don't try to map NULL buffers 2014-12-18 22:04:38 +01:00
Sebastian Dröge
af46a58cae videoaggregator: Make sure to always update the pad's videoinfo together with buffers
Otherwise the videoinfo and the buffer content can go out of sync.
2014-12-18 22:03:04 +01:00
Sebastian Dröge
06a4e80be9 aggregator: Add function to allow subclasses to set their own latency
For audiomixer this is one blocksize, for videoaggregator this should
be the duration of one output frame.
2014-12-17 19:51:32 +01:00
Sebastian Dröge
d4c4af699e aggregator: Add a timeout parameter to ::aggregate()
When this is TRUE, we really have to produce output. This happens
in live mixing mode when we have to output something for the current
time, no matter if we have enough input or not.
2014-12-17 18:41:41 +01:00
Sebastian Dröge
852b08340e aggregator: Some minor cleanup 2014-12-16 17:33:01 +01:00
Matthew Waters
8bf53a1226 aggregator: make the src pad task drive the pipeline for live pipelines
This removes the uses of GAsyncQueue and replaces it with explicit
GMutex, GCond and wakeup count which is used for the non-live case.

For live pipelines, the aggregator waits on the clock until either
data arrives on all sink pads or the expected output buffer time
arrives plus the timeout/latency at which time, the subclass
produces a buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=741146
2014-12-16 16:58:57 +01:00
Matthew Waters
a7e86751bf videoaggregator: always try to use newer buffers
instead of dropping them for being too old.  This ensures that
the newest buffer is always used for rendering
2014-12-16 16:49:49 +01:00
Thibault Saunier
aa25d0ab4c videoaggregator: Hide some more fields from the API
+ Add some documentation
2014-12-12 11:49:42 +01:00
Thiago Santos
75b0bac7f8 adaptivedemux: fix seek event handling
Properly do seeking and avoid only seeking when the segment was updated.
It would cause seeks after the stream was EOS to fail, for example.

https://bugzilla.gnome.org/show_bug.cgi?id=738920
2014-12-11 21:09:26 -03:00
Wang Xin-yu (王昕宇)
15eab1ed01 glfilter: fix position/texcoord attrib index usage
https://bugzilla.gnome.org/show_bug.cgi?id=741231
2014-12-11 19:41:23 +11:00
Matthew Waters
f021549294 gl: fixup vao and vbo usage for legacy GL 2014-12-11 19:41:23 +11:00
Thiago Santos
c8fa688d26 adaptivedemux: check the return from update_manifest correctly
It is a GstFlowReturn and not a boolean
2014-12-10 18:23:02 -03:00
Thiago Santos
d30ec9f9f7 adaptivedemux: do not try to unlock not locked mutex
A misplaced unlock was causing an assertion for playback with a
set stop time
2014-12-08 08:53:00 -03:00
Thiago Santos
aba9d86d08 gst-libs: build order: uridownloader before adaptivedemux
Otherwise make install fails
2014-12-08 08:24:17 -03:00
Thiago Santos
66f40b798d adaptivedemux: release threads waiting for manifest update on shutdown
For live streams, also unblock threads that might be waiting for a manifest
update when stopping the pipeline.

Also add some more debug messages
2014-12-04 01:48:07 -03:00
Thiago Santos
a7712c2983 adaptivedemux: use gst_task_stop instead of gst_task_pause
To avoid race conditions with gst_task_stop(); gst_task_join() with
another thread doing gst_task_pause(), the joining thread would be
waiting for the task to stop but it would never happen. So just
use gst_task_stop() everywhere to prevent more mutexes
2014-12-04 01:48:07 -03:00
Thiago Santos
87df15a214 adaptivedemux: fix deadlock when stopping streams
Remember to unlock the manifest's lock when leaving the download task.
2014-12-04 01:48:07 -03:00
Philippe Normand
c4ba73e39b glsyncmeta: add G_END_DECLS 2014-12-04 01:36:38 +11:00
Thiago Santos
92fd73ab5f adaptivedemux: remove unused error variable
CID #1256556
2014-12-03 10:06:09 -03:00
Thiago Santos
d9944506c8 adaptivedemux: remove more get_duration checks
Subclasses must implement get_duration function. If they do not know
the duration they can return GST_CLOCK_TIME_NONE
2014-12-03 09:45:58 -03:00
Thiago Santos
9afed503ed adaptivedemux: all subclasses must implement get_duration
CID #1256557
2014-12-03 09:42:39 -03:00
Thiago Santos
e11c311c31 adaptivedemux: make sure to always stop the stream on EOS
For On-Demand streams, always stop the tasks for streams that reached
EOS
2014-12-03 09:42:39 -03:00
Julien Isorce
230022fe62 glcontext: try cgl before glx
It was already done by commit
f506e80686
but it has been broken by commit
45ec777cea
2014-12-03 08:02:58 +00:00
Edward Hervey
87694c2232 gst-libs: Fix dependency build
adaptivedemux depends on uridownloader and video depends on base
2014-12-01 10:32:30 +01:00
Thiago Santos
df66909129 adaptivedemux: reworking live manifest update wait
Check if the stream is live before checking if it is EOS as a live
stream might be considered EOS when it just needs to wait for a manifest
update to proceed with the next fragments
2014-11-30 21:56:25 -03:00
Thiago Santos
66202d4c1b adaptivedemux: fix manifest update locking
To avoid unlocking a not locked mutex
2014-11-30 21:56:25 -03:00
Thiago Santos
5f3cce2e58 adaptivedemux: Fix segment for manifests that won't start at 0
For live streams, the manifest might start at an advanced position. Avoid
using segment start=0 to have playback start immediately
2014-11-30 21:56:25 -03:00
Thiago Santos
023b284c2d adaptivedemux: also clear flushing state on pads before restarting
During flushing seeks the flushing flow return will propagate up to the
source element and all pads are going to have the flushing flag set.

So before restarting also remove that flag together with the EOS one.

We don't do that when pushing the flush stop event because our event
handler for the proxypad will drop all events.
2014-11-30 21:56:03 -03:00
Thiago Santos
9ec9f3f119 adaptivedemux: add adaptivedemux base class
https://bugzilla.gnome.org/show_bug.cgi?id=735848
2014-11-30 21:56:01 -03:00
Matthew Waters
90a2477b9e glcontext: require GL_ARB_ES2_compatibility for opengl3
until we generate gl3 compliant shaders

https://bugzilla.gnome.org/show_bug.cgi?id=740012
2014-11-30 00:44:46 +11:00
Sebastian Dröge
8a8444ebe7 videoaggregator: Failure to map a video frame is not just a warning 2014-11-28 10:22:44 +01:00
Matthew Waters
e653ae9fc2 gl: fixup compat definition for GLuint64 for OS X 2014-11-28 13:04:21 +11:00
Matthew Waters
b0faa2dd77 gl: add compat definition for GLuint64 for android
../../../../gst-libs/gst/gl/glprototypes/sync.h:41:23: error: unknown type name 'GLuint64'
                       GLuint64 timeout))
2014-11-28 11:57:25 +11:00
Danny Song
d6489ee96c basecamerasrc: fix typo in docs
https://bugzilla.gnome.org/show_bug.cgi?id=740815
2014-11-28 00:13:22 +00:00
Matthew Waters
3e92a8ef53 glsync: fix build with desktop gl 2014-11-28 11:11:43 +11:00
Matthew Waters
57898fec2a gl: fix various build errors without desktop gl 2014-11-28 10:59:46 +11:00
Matthew Waters
f67190d3ca gldisplay: fix build error
gstgldisplay.c:234:541: error: 'return' with no value, in function returning non-void [-Werror]
   g_return_if_fail (GST_IS_GL_DISPLAY (display));
2014-11-28 10:03:18 +11:00
Matthew Waters
3c1e77eb31 gldisplay: implement runtime GL api filtering
Needed so that the pipeline/application can limit the choice of GL api
to what it supports
2014-11-28 09:14:26 +11:00
Matthew Waters
6bd1150ca8 gl: remove the use of glu 2014-11-28 09:14:26 +11:00
Matthew Waters
f2af65ee2d gl: add a sync meta for synchronizing across GL contexts
A context can create a GLsync object that can be waited on in order
to ensure that GL resources created in one context are able to be
used in another shared context without any chance of reading invalid
data.

This meta would be placed on buffers that are known to cross from
one context to another.  The receiving element would then wait
on the sync object to ensure that the data to be used is complete.
2014-11-28 09:14:25 +11:00
Matthew Waters
480d3f97eb glprototypes: add sync function definitions 2014-11-28 09:14:25 +11:00
Matthew Waters
6d39e04992 glfilter: add a gl3 code path using vao's and vbo's 2014-11-28 09:14:25 +11:00
Matthew Waters
5ff5f8c1ee glframebuffer: add support for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
a32f29f2ce glcolorconvert: add support for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
fca0bc97a4 glshader add support for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
2c24b97cf0 glx: ask for a GL3 core context 2014-11-28 09:14:25 +11:00
Sebastian Dröge
1200f2f94b videoaggregator: Minor cleanup 2014-11-27 21:23:36 +01:00
Sebastian Dröge
fbf7595ca8 videoaggregator: Copy over more fields from the relevant video-info
gst_video_info_set_format() will reset the complete video-info, but
we want to keep values like the PAR, colorimetry and chroma site.
Otherwise we risk setting different values on the srcpad caps than
what is actually inside the buffers.
2014-11-27 20:34:25 +01:00
Sebastian Dröge
b301cb1fc9 videoaggregator: Directly use the converters video-info instead of recalculating it 2014-11-27 20:25:29 +01:00
Sebastian Dröge
11740d78b1 videoaggregator: Do source pad negotiation only from the aggregated function
Otherwise we might negotiate from the sinkpad streaming threads at
the same time as on the srcpad streaming thread, and then all kinds
of crazy bugs happen that don't make any sense at all.
2014-11-27 19:54:10 +01:00
Thibault Saunier
a61d2e4e07 videoconvert: Hide all conversion related fields
And do not delay the setting of the conversion_info

https://bugzilla.gnome.org/show_bug.cgi?id=740768
2014-11-27 19:10:58 +01:00
Thibault Saunier
9d8055186d videoaggregator: Expose vmethods to set converters and prepare/clean frames
This gives more flexibility to the subclasses and permits to remove the
GstVideoAggregatorClass->disable_frame_conversion ugly API.

WARNING: This breaks the API as it removes the disable_frame_conversion
field

API:
  + GstVideoAggregatorClass->find_best_format
  + GstVideoAggregatorPadClass->set_format
  + GstVideoAggregatorPadClass->prepare_frame
  + GstVideoAggregatorPadClass->clean_frame

  - GstVideoAggregatorClass->disable_frame_conversion

https://bugzilla.gnome.org/show_bug.cgi?id=740768
2014-11-27 19:10:58 +01:00
Thibault Saunier
c7b7f98df2 videoaggregator: Let a full renegotiation happen after removing the last pad
With the current code, we will end up setting the preferred downstream
format as the srcpad format, and it might not be accepted by the next
sinkpad to be added. We should instead let the next sinkpad reconfigure
everything.
2014-11-27 19:10:58 +01:00
Sebastian Dröge
082c12b8e2 glcolorconvert: Unref buffer with the correct function 2014-11-27 18:09:58 +01:00
Sebastian Dröge
b6ba579fa0 glmemory: Handle failure of memory allocation gracefully 2014-11-27 18:09:14 +01:00
Sebastian Dröge
f2dc9b2b8f glmemory: Use g_try_malloc() in the appropriate places
g_malloc() aborts if allocation fails, it's pointless to check against NULL
afterwards. That's why g_try_malloc() exists.
2014-11-27 18:06:26 +01:00
Wang Xin-yu (王昕宇)
15c0d5c21b glcolorconvert: support RGB16/BGR16 video format download
https://bugzilla.gnome.org/show_bug.cgi?id=740801
2014-11-27 10:08:11 +01:00
Matthew Waters
2d97e03c54 gl/wayland: implement resizing the window using the right mouse button 2014-11-27 13:03:21 +11:00
Matthew Waters
1d7c4f4344 glfilter: support fixed dimensions on both sides of the element
Fixes:

  width=320,height=240 ! glfilter ! width=800,height=600
  width=230,height=240 ! glfilter ! width=600
  ... ! glfilter ! width=800
2014-11-27 01:32:21 +11:00
Sebastian Dröge
3d38dff076 videoaggregator: Also sync pad properties to the controller if conversion is disabled 2014-11-26 13:06:21 +01:00
Julien Isorce
3fb3758e7d codecparsers: fix some compiler warnings
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1

"warning: comparison is always true due to limited
range of data type"

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=740673
2014-11-25 23:05:15 +00:00
Julien Isorce
857456b7ba mpegts: fix some compiler warnings
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1

"warning: comparison is always true due to limited
range of data type"

https://bugzilla.gnome.org/show_bug.cgi?id=740674
2014-11-25 10:23:43 +01:00
Ramprakash Jelari
aea08e86a5 glcontext: Fix unused variable warning by moving declaration where it is actually used 2014-11-24 14:16:58 +01:00
Ramprakash Jelari
f0e418b629 dvbsection: Fix format string compiler warning 2014-11-24 12:51:34 +01:00
Ramprakash Jelari
cbe46c0373 mpegtsdescriptor: Fix format string compiler warning
gstmpegtsdescriptor.c:778:16: warning: format specifies type 'unsigned long' but the argument has type 'int' [-Wformat]
2014-11-24 12:32:37 +01:00
Sebastian Dröge
0f753b7099 glupload: Fix valid compiler warning
gstglupload.c:442:32: error: if statement has empty body [-Werror,-Wempty-body]
    if (upload->texture_ids[i]);
                               ^
2014-11-24 11:32:33 +01:00
Philippe Normand
c08a461fa4 gl: ship the gstglcontext_egl.h header
It is required by gsteglimagememory.h.

https://bugzilla.gnome.org/show_bug.cgi?id=740611
2014-11-24 21:24:27 +11:00
Tim-Philipp Müller
1a613c5d4e gl: shadervariables: make parsing of floats locale-independent
Floating point numbers are written differently in different
locales, e.g. in many countries 1/2 = 0,5 instead of 0.5, and
strtod will not be able to parse "0.5" correctly in such a
locale.
2014-11-24 10:02:33 +00:00
Matthew Waters
59085936b8 glshadervariables: also trim \r as well as \n 2014-11-24 02:52:24 +11:00
Matthew Waters
810d38c29f glupload: rearchitecture for non GLMemory inputs/outputs
Allows other memory types to be implemented/returned/used by the caller.
2014-11-23 17:13:36 +11:00
Sebastian Dröge
4ad6984662 aggregator: Unblock events/queries immediately if the pad is flushing
https://bugzilla.gnome.org/show_bug.cgi?id=740376
2014-11-19 17:17:44 +01:00
Sebastian Dröge
ce69180862 aggregator: Drop serialized events/queries if the pad is flushing
https://bugzilla.gnome.org/show_bug.cgi?id=740376
2014-11-19 17:17:44 +01:00
Sebastian Dröge
a31faecb8b aggregator: Block serialized events/queries until the pad has consumed all buffers
Otherwise the caps of the pad might change while the subclass still works with
a buffer of the old caps, assuming the the current pad caps apply to that
buffer. Which then leads to crashes and other nice effects.

https://bugzilla.gnome.org/show_bug.cgi?id=740376
2014-11-19 17:06:52 +01:00
Sebastian Dröge
6c0d01ce17 videoaggregator: Don't output 0-duration buffers at the segment end
https://bugzilla.gnome.org/show_bug.cgi?id=740376
2014-11-19 17:06:52 +01:00
Sebastian Dröge
3e27c5592f aggregator: Fix typo in debug output 2014-11-19 17:04:45 +01:00
Matthew Waters
f4a10c64c8 videoaggregator: fix up QoS handling for live sources
Only attempt adaptive drop when we are not live

https://bugzilla.gnome.org/show_bug.cgi?id=739996
2014-11-17 22:39:07 +11:00
Matthew Waters
051955e5fa aggregator: add _get_latency() for subclass usage
API: gst_aggregator_get_latency

https://bugzilla.gnome.org/show_bug.cgi?id=739996
2014-11-17 22:39:07 +11:00
Vineeth T M
aafc0d509c glcontext: build errors when GST_GL_HAVE_OPENGL is 0
Moving variables within #if GST_GL_HAVE_OPENGL, which are not going to be used otherwise.
and which are needed only when OpenGl is present

https://bugzilla.gnome.org/show_bug.cgi?id=740235
2014-11-17 22:39:07 +11:00
Matthew Waters
4afad4ecd3 glfilter: add read-only context property 2014-11-17 18:50:28 +11:00
Sebastian Dröge
236ffa69be gl/cocoa: Only use convertRectToBacking on OSX >= 10.7
It does not exist before and older versions also don't have
support for HiDPI displays anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=740201
2014-11-16 11:00:57 +01:00
Sebastian Dröge
9492db96d1 gl: Use numeric OSX version instead of the macro
The macro is not defined on older OSX versions and evaluates to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=740201
2014-11-16 11:00:57 +01:00
Gwenole Beauchesne
8c76b5897a codecparsers: h264: fix derivation of MaxPicNum variable.
The logic to compute the MaxPicNum variable was reversed. In paricular,
MaxPicNum is double MaxFrameNum only if field_pic_flag is set to 1.

https://bugzilla.gnome.org/show_bug.cgi?id=739291
2014-11-14 09:36:27 +01:00
Sebastian Dröge
402e1a067a gl/cocoa: Don't override the application delegate
Otherwise interesting things will happen in Cocoa applications, like
infinite event loops that block the NSApplication loop forever.

This was only needed for GNUStep and thus can safely be removed now.
2014-11-13 12:01:25 +01:00
Sebastian Dröge
13c8517570 gl/cocoa: Remove GNUStep support
Until gcc and GNUStep properly support Objective-C blocks and other
"new" features of Objective-C we can't properly support them without
making the code much more ugly.

https://bugzilla.gnome.org/show_bug.cgi?id=739152
2014-11-13 12:01:19 +01:00
Hyunjun Ko
a2e2507dbe gl: Correct invalid comment text 2014-11-12 11:29:41 +11:00
Julien Isorce
7d0de0577a gl: do not raise a critical msg if the backend does not handle window events
Fix "assertion 'window_class->handle_events != NULL' failed"
if not using a X11 window.
2014-11-12 00:07:06 +00:00
Matthew Waters
36ade75f4a gl: remove the width/height fields from the caps to support frame resizing
It was previously only occuring with sysmem caps features

https://bugzilla.gnome.org/show_bug.cgi?id=739334
2014-11-11 14:23:55 +11:00
Aurélien Zanelli
6511a7282b h264parser: fix GstH264ParserResult documentation typo
https://bugzilla.gnome.org/show_bug.cgi?id=739906
2014-11-10 23:37:37 +00:00
Sebastian Dröge
da0369c66c gstglconfig: Put gstglconfig.h into $(libdir)/gstreamer-1.0/include
It's architecture dependent and should not be placed into the include
directory as the assumption is that all those headers are architecture
independent.

https://bugzilla.gnome.org/show_bug.cgi?id=739767
2014-11-07 12:00:29 +01:00
Matthew Waters
775ba4ff0b glutils: only attempt getting the app context when we don't already have a display
avoids querying/messaging the world on each frame
2014-11-06 18:47:34 +11:00
Matthew Waters
1800ffb34a glcontext: fail context creation if glGetString returns NULL 2014-11-06 18:46:48 +11:00
Lubosz Sarnecki
6702811e14 glimagesink: implement gst_video_overlay_handle_events
https://bugzilla.gnome.org/show_bug.cgi?id=736035
2014-11-06 16:04:11 +11:00
Olivier Crête
484f0a0cd3 insertbin: Add doc for the ignored user-data in action signals 2014-11-03 20:45:03 -05:00
Julien Isorce
0a207c95dc gl/cocoa: use NSAutoreleasePool to free resize data
Otherwise when resizing the window you will also get messages like:
class NSConcreteMapTable autoreleased with no pool in place - just leaking
class NSConcreteValue autoreleased with no pool in place - just leaking
class NSConcreteValue autoreleased with no pool in place - just leaking
class __NSCFDictionary autoreleased with no pool in place - just leaking
2014-11-03 23:24:33 +00:00
Julien Isorce
4307449449 gl/cocoa: include gl3.h to have GL_CONTEXT_PROFILE_MASK 2014-11-03 23:08:09 +00:00
Julien Isorce
2b487ef62b gl/cocoa: make sure to turn on frame rectangle changes notifications
Default value of property postsFrameChangedNotifications is YES
but it is worth to explicitly enable it.
2014-11-03 23:07:34 +00:00
Julien Isorce
a259391c10 gl/cocoa: fix uncaught exception 'unrecognized selector sent to instance'
Need to set the ':' as the reshape method now takes one parameter.
For the story, the GstGLNSView was previously inheriting from
NSOpenGLView which has a reshape function without any parameter.
Now the GstGLNSView inherits from NSView and we re-use the reshape
function manually.
2014-11-03 23:02:17 +00:00
Julien Isorce
11661ceca9 gl/cocoa: fix compiler warning
Use the reshape function after being defined. The other way
would have been to declare the reshape function in the header.

gstglwindow_cocoa.m: In function '-[GstGLNSView drawRect:]':
gstglwindow_cocoa.m:555: warning: 'GstGLNSView' may not respond to '-reshape'
gstglwindow_cocoa.m:555: warning: (Messages without a matching method signature
gstglwindow_cocoa.m:555: warning: will be assumed to return 'id' and accept
gstglwindow_cocoa.m:555: warning: '...' as arguments.)
2014-11-03 22:59:41 +00:00
Sebastian Dröge
9f09b6ff0b videoaggregator: Swap source/destination parameters of gst_video_converter_frame() 2014-11-03 16:13:23 +01:00
Tim-Philipp Müller
ebcee78fab gl: fix Since marker for gst_gl_window_run_navigation() 2014-11-03 00:17:41 +00:00
Luis de Bethencourt
658f403a26 glshader: Fix memory leak
Memory is only freed in the TRUE clause of the if conditional. Free in the else
clause as well.
Also, consolidate g_malloc + sprintf into a g_strdup_printf().

CID #1212171

https://bugzilla.gnome.org/show_bug.cgi?id=739368
2014-11-01 15:42:21 +00:00
Luis de Bethencourt
50f2a803f6 glcolorconvert: fix comments that confuse gtk-doc
GTK-Doc uses a special syntax for code documentation. A multiline comment that
starts with an additional '*' marks a documentation block that will be processed
by the GTK-Doc tools. So GTK-Doc is confused if a comment block starts with that
additional '*' but isn't meant to be processed. Removing this additional '*'.

https://bugzilla.gnome.org/show_bug.cgi?id=739444
2014-10-31 11:20:29 +00:00
Matthew Waters
f36d6daf51 gl: sprinkle some Since markers 2014-10-31 21:29:25 +11:00
Luis de Bethencourt
f76d1a2514 mpegts: remove storage of never used values
Both _parse_atsc_mgt() and  _parse_atsc_vct () change the value of the variable
data just before returning. The new value is never used since data is a pointer
declared at the beginning of the function and going out of scope just after the
new value is stored.

https://bugzilla.gnome.org/show_bug.cgi?id=739404
2014-10-30 23:19:59 +00:00
Luis de Bethencourt
0df9279026 videoaggregator: remove storage of never used values
These two values are stored just before the function returns and they go out of
scope.
2014-10-30 14:52:13 +00:00
Matthew Waters
c1f3cc9f1c gl/examples: update for other-context property removal 2014-10-30 18:58:50 +11:00
Matthew Waters
567185a277 glcontext: add more functionality to wrapped contexts
Implements get_current_context() and get_proc_address() for wrapped
contexts.
2014-10-30 18:58:50 +11:00
Matthew Waters
d2cbc7cc16 glshader: advertise the default vertex and fragment shaders on desktop GL 2014-10-30 18:58:49 +11:00
Gwenole Beauchesne
65fc58da4d codecparsers: h264: recognize SVC NAL units.
Identify SVC NAL units and tag them as such. This is necessary for
gst_h264_parser_parse_slice_hdr() to fail gracefully, if the user
did not perform the check himself.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 15:00:56 +01:00
Gwenole Beauchesne
b50c3e2127 codecparsers: h264: fix number of list0 {,non-}anchor refs.
Fix copy-paste error in gst_h264_sps_mvc_copy() where num_anchor_refs_l0
and num_non_anchor_refs_l0 were incorrectly initialized from list1.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 15:00:56 +01:00
Tim-Philipp Müller
3e62612259 codecparsers: sprinkle some gtk-doc Since: markers for new API 2014-10-29 13:15:51 +00:00
Jan Schmidt
86b948587e codecparsers: Initialise nalu extension type to NONE
Always set a default NALU extension type, and override it
when we find a supported extension, to avoid having it unset/random
for unsupported NALU extensions
2014-10-29 23:23:02 +11:00
Jan Schmidt
cc71119539 h264parser: Fix frame packing SEI parsing 2014-10-29 23:21:47 +11:00
Sreerenj Balachandran
3776e78ae6 codecparsers: h264: add support for Frame Packing Arrangement SEI message.
This parses the frame_packing_arragement() payload in SEI message.
This information can be used by decoders to appropriately rearrange the
samples which belong to Stereoscopic and Multiview High profiles.

https://bugzilla.gnome.org/show_bug.cgi?id=685215

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 23:09:41 +11:00
Sreerenj Balachandran
51f003e469 codecparsers: h264: add support for Stereo Video Information SEI message.
Add the necessary payload parsing support for stereo_video_info.

https://bugzilla.gnome.org/show_bug.cgi?id=685215

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2014-10-29 23:09:41 +11:00
Gwenole Beauchesne
8911a80662 codecparsers: h264: parse seq_parameter_set_mvc_extension().
https://bugzilla.gnome.org/show_bug.cgi?id=685215

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 23:09:41 +11:00
Gwenole Beauchesne
c1deab84e6 codecparsers: h264: parse MVC syntax elements.
https://bugzilla.gnome.org/show_bug.cgi?id=685215

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 23:09:41 +11:00
Luis de Bethencourt
916b954315 codecparsers: remove ignored increment of return
'return val++;' returns the value before it is incremented because the post
increment happens after the statement. Removing the unused increment.

https://bugzilla.gnome.org/show_bug.cgi?id=739345
2014-10-29 10:37:38 +00:00
Tim-Philipp Müller
95c211dc49 Add some missing G_END_DECLS 2014-10-28 21:42:31 +00:00
Matthew Waters
5e2e6f3326 glfilter: get the config from the correct pool 2014-10-28 18:27:11 +11:00
Matthew Waters
28105a6e7d glfilter: avoid uninitialized variable size when chaining multiple glfilters
https://bugzilla.gnome.org/show_bug.cgi?id=739277
2014-10-28 18:01:27 +11:00
Matthew Waters
0289fbe2cd glfilter: gst-indent file 2014-10-28 18:01:01 +11:00
Matthew Waters
81ceca1aea glcontext: add api for retreiving the current context and api
that is current in the calling thread.
2014-10-28 17:33:20 +11:00
Matthew Waters
ce14777919 glprototypes: add vertex attribute array definitions 2014-10-28 17:33:20 +11:00
Matthew Waters
e40d70c69a gl: propogate other-context using GstContext 2014-10-23 23:58:33 +11:00
Sebastian Dröge
af6e2228b2 gl/cocoa: Fix compiler warning
gstglwindow_cocoa.m: In function '-[GstGLNSView drawRect:]':
gstglwindow_cocoa.m:555: warning: 'GstGLNSView' may not respond to '-reshape'
gstglwindow_cocoa.m:555: warning: (Messages without a matching method signature
gstglwindow_cocoa.m:555: warning: will be assumed to return 'id' and accept
gstglwindow_cocoa.m:555: warning: '...' as arguments.)
2014-10-21 16:22:06 +02:00
Vineeth T M
aec1f2a001 audiomixer: critical error for blocksize, timeout min/max values
Audiomixer blocksize, cant be 0, hence adjusting the minimum value to 1
timeout value of aggregator is defined with MAX of MAXINT64,
but it cannot cross G_MAXLONG * GST_SECOND - 1
Hence changed the max value of the same

https://bugzilla.gnome.org/show_bug.cgi?id=738845
2014-10-21 10:58:48 +02:00
Matthew Waters
75413ae9aa videoaggregator: fixate the parts of the caps we don't know how to deal with
fixes glvideomixer with video/x-raw,width=foo i.e. no format field.
2014-10-21 02:53:02 +11:00
Matthew Waters
2e49c99db3 glbufferpool: add the GstVideoGLTextureUploadMeta buffer pool option 2014-10-21 02:00:09 +11:00
Matthew Waters
f0caf04ad6 videoaggregator: operate on caps rather than video info
Otherwise the CapsFeatures will be lost along with the possibility
of multiple output types and formats.

https://bugzilla.gnome.org/show_bug.cgi?id=738129
2014-10-21 01:14:36 +11:00
Wang Xin-yu (王昕宇)
5eb538f9e2 glcolorconvert: support RGB16/BGR16 video format upload
https://bugzilla.gnome.org/show_bug.cgi?id=738842
2014-10-20 12:55:39 +02:00
Aurélien Zanelli
de327bf45b vc1parser: fix level values for simple/main profile
In simple profile, level set to 0 or 2 indicate low and medium level
respectively. In main profile, level set to 0, 2 or 4 indicate low,
medium and high level respectively.

Level values are defined in Annex J.1.2 of the SMPTE 421M.

https://bugzilla.gnome.org/show_bug.cgi?id=738230
2014-10-20 12:40:54 +02:00
Brion Vibber
88b19bcf99 gl/cocoa: Fix for building on Mac OS X 10.10
Using NSApp directly seems to confuse something, as the compiler
was expecting an id<NSFileManagerDelegate>. Switched to using
[NSApplication sharedApplication], and specified the delegate
protocol on the window class as well.

https://bugzilla.gnome.org/show_bug.cgi?id=738740
2014-10-19 20:01:55 +02:00
Matthew Waters
4b019ba268 glfilter: add uploaded_buffer field 2014-10-14 16:54:01 +02:00
Matthew Waters
b9db635f48 aggregator: add latency query handling 2014-10-09 23:52:11 +11:00
Matthew Waters
8a3993913f videoaggregator: support unresponsive pads
Render unresponsive pads with the last video frame received.
2014-10-09 23:52:11 +11:00
Matthew Waters
a41bc98b6e aggregator: add a timeout property determining buffer wait time
Determines the amount of time that a pad will wait for a buffer before
being marked unresponsive.

Network sources may fail to produce buffers for an extended period of time,
currently causing the pipeline to stall possibly indefinitely, waiting for
these buffers to appear.

Subclasses should render unresponsive pads with either silence (audio), the
last (video) frame or what makes the most sense in the given context.
2014-10-09 23:52:11 +11:00
Matthew Waters
c23cd9c3be videoaggregator: remove the use of the queued buffer on sink pads
That data is now held by the aggregator class
2014-10-09 23:52:11 +11:00
Sebastian Dröge
014cbbbb33 gl/cocoa: Add support for HiDPI displays
Without this our GL surface would be upscaled after rendering
by Cocoa, which would reduce image quality.
2014-10-09 10:56:06 +03:00
Matthew Waters
ccdd88eb5a glcolorconvert: output why we cannot convert a buffer 2014-10-09 12:29:57 +11:00
Matthew Waters
9108c52a22 glcolorconvert: fix planar YUV download
- sample the u and v planes properly
- output the correctly scaled u and v planes for different chroma block sizes
2014-10-09 12:29:57 +11:00
Felix Schwarz
a2b82ba541 mpegts: fix typos in comments
https://bugzilla.gnome.org/show_bug.cgi?id=738072
2014-10-07 13:11:13 +01:00
Matthew Waters
9dc1f9be36 glcolorconvert: fix UYVY download green screen 2014-10-07 23:04:30 +11:00
Matthew Waters
2fb0b28f74 glcolrconvert: fix YUY2 download
- The shader was outputing the wrong values compared with raw
  videotestsrc.
- deal with the texture edge properly.
- properly sample the 2x1 rectangle for the u and v values
- don't double sample the y value
2014-10-07 22:55:32 +11:00
Jan Alexander Steffens (heftig)
dce92c75b1 aggregator: Replace GMainContext with GAsyncQueue (v2)
The previous implementation kept accumulating GSources,
slowing down the iteration and leaking memory.

Instead of trying to fix the main context flushing, replace
it with a GAsyncQueue which is simple to flush and has
less overhead.

https://bugzilla.gnome.org/show_bug.cgi?id=736782
2014-10-06 18:57:28 +02:00
Thibault Saunier
7091b0418d videoaggregator: Do not wrongly set the aggregator.segment
The aggregator.segment is not to be initialized by the subclasses but
by the aggregator itself. Moreover, initializing it on start would make
us loose the information coming from the initial seek.
2014-10-06 18:57:28 +02:00
Thibault Saunier
b812bd454d videoaggregator: Make sure not to unref a NULL pointer 2014-10-06 18:57:28 +02:00
Mathieu Duponchelle
1d94b3f66a aggregator: Set seqnum only when segments are received. 2014-10-06 18:57:28 +02:00
Thibault Saunier
982b9dc3ea aggregator: Add a streaming lock so to secure flush start action
Without a lock that is taken in FLUSH_START we had a rare race where we
end up aggregating a buffer that was before the whole FLUSH_START/STOP
dance. That could lead to very wrong behaviour in subclasses.
2014-10-06 18:57:28 +02:00
Thibault Saunier
65d20d1028 aggregator: Query seeking when a seek failed to see if it was expected
And do not worry if seeking failed on a stream that is not seekable
2014-10-06 18:57:28 +02:00
Mathieu Duponchelle
59b15e6659 aggregator: set future seqnum before propagating the seek event.
So the seqnum is properly set for the following events.
2014-10-06 18:57:28 +02:00
Thibault Saunier
d82dddc3e5 aggregator: Store segment when seeked in READY for later use 2014-10-06 18:57:28 +02:00
Sebastian Dröge
58e186fe2b videoaggregator: Unmap and free GstVideoFrames as needed after conversion and errors 2014-10-06 10:11:47 +03:00
Sebastian Dröge
b3cd526347 aggregator: Unref the taglist in GstAggregator::stop() 2014-10-06 10:11:23 +03:00
Reynaldo H. Verdejo Pinochet
8059cf6567 mpegts: fix typo in GstMpegtsExtendedEventDescriptor doc 2014-10-03 23:27:03 -03:00
Thibault Saunier
3637296ee9 videoaggregator: Do not to release VIDEO_AGGREGATOR_LOCK while setting format info
We should be able to always keep the VIDEO_AGGREGATOR_LOCK while
negotiating caps, this patch introduce that change.

That also implies that we do not need the SETCAPS_LOCK anymore because
now VIDEO_AGGREGATOR_LOCK guarantees that setcaps is not called from
several threads and the gst_aggregator_set_caps method is now
protected.

https://bugzilla.gnome.org/show_bug.cgi?id=735042
2014-10-03 13:18:05 +02:00
Thibault Saunier
1b4547ff93 aggregator: Take lock to ensure set_caps is not called concurently
Avoiding to be in an inconsistent state where we do not have
actual negotiate caps set as srccaps and leading to point where we
try to unref ->srccaps when they have already been set to NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=735042
2014-10-03 13:18:05 +02:00
Sebastian Dröge
03a5bc82db videoaggregator: Also copy over the chroma siting and colorimetry when deciding on a conversion 2014-10-01 17:22:59 +03:00
Sebastian Dröge
f2af838837 videoaggregator: Revert the last commit and handle resolutions differences properly
This is about converting the format, not about converting any widths and
heights. Subclasses are expected to handler different resolutions themselves,
like the videomixers already do properly.
2014-10-01 17:18:05 +03:00
Sebastian Dröge
154eb9b508 videoaggregator: GstVideoConverter currently can't rescale and will assert
Leads to ugly assertions instead of properly erroring out:
CRITICAL **: gst_video_converter_new: assertion 'in_info->width == out_info->width' failed
2014-10-01 17:11:16 +03:00
Sebastian Dröge
c4cc2dfabf gl/cocoa: Always update our viewport if Cocoa tells us something has changed
The visible rect and bounds might be the same as before, but Cocoa
might've changed our viewport without us nothing. This happens if
you hide the view and show it again.
2014-10-01 16:04:36 +03:00
Sebastian Dröge
061d55f535 gl/cocoa: Handle NSView::renewGState() properly
Don't update the screen until we redraw, this prevents flickering during
scrolling, clipping, resizing, etc
2014-10-01 11:55:51 +03:00
Matthew Waters
dc4b4832d4 glcolorconvert: convert xRGB into ARGB properly
The alpha channel might not be the last component so check which one
it is in and clobber that one instead.
2014-09-30 14:46:14 +10:00
Matthew Waters
7b0a30343a glmemory: unset the opposite corresponding transfer flags when mapped with write
fixes consistency with consecutive gst_memory_map()'s with
flags & GST_MAP_WRITE
2014-09-30 01:49:05 +10:00
Sebastian Dröge
d4ed76e4da gl/cocoa: Update viewport according to the current clipping
We have to update the GL viewport if the NSView is only partially
visible. Otherwise the content of the frame will be visibly offset.
2014-09-29 14:34:42 +03:00
Sebastian Dröge
8d92b6a364 gl/cocoa: Improve the NSApplication initialization
This is only for non-Cocoa apps but previously caused a 2 second
waiting during startup for Cocoa apps. This is unacceptable.

Instead we now check a bit more extensive if something actually
runs on the GLib default main context, and if not don't even
bother waiting for something to happen from there.
2014-09-29 10:57:18 +03:00
Sebastian Dröge
0cd19cbda3 gl/cocoa: NSView::drawRect() should call into reshape too
We a) need to render again because part of the window was
obscured and b) might need to reshape because of clipping
changes.
2014-09-29 10:57:18 +03:00
Sebastian Dröge
66cb4166d3 gl/cocoa: Call UI related API from the application main thread 2014-09-29 10:57:18 +03:00
Sebastian Dröge
2173d34462 gl/cocoa: Switch to a plain NSView subclass instead of NSOpenGLView
We don't and can't use NSOpenGLView as it's supposed to be used and
it gets into our way by being to clever in various situations.
2014-09-29 10:57:18 +03:00
Edward Hervey
e064d280ea glcontext: Initialize variable
Avoids the following warning:

gstglcontext.c:647:58: error: 'prev' may be used uninitialized in
 this function [-Werror=maybe-uninitialized]
2014-09-29 08:54:29 +02:00
Josep Torra
5b79423416 video: fix build in gst-uninstalled setup
Include the base video lib appropriately and resort all of them as
thaytan suggested.
2014-09-28 18:03:09 +02:00
Matthew Waters
fc2471eb54 glcontext: fixup error in sharegroup comment 2014-09-29 00:32:05 +10:00
Matthew Waters
3b9893192c glcontext: detect the sharegroup case where the context are in different chains
In the end they will lead to the same root context in the tree so check that
for equality.
2014-09-29 00:24:28 +10:00
Matthew Waters
81c38c1d2b glfilter: silence a warning with empty input caps
discovered with the doublecube example

gst_caps_get_features: assertion 'index < GST_CAPS_LEN (caps)' failed
2014-09-28 21:18:32 +10:00
Matthew Waters
2043def155 videoaggregator: don't create converters when the subclass doesn't want them
fixes a critical with glvideomixer after
35bd1969f9

CRITICAL **: gst_video_converter_new: assertion 'in_info->width == out_info->width' failed
2014-09-28 16:58:42 +10:00