platform/upstream/gstreamer.git
8 years agohls: m3u8: remove unused _get_current_fragment_duration() function
Tim-Philipp Müller [Sat, 28 Nov 2015 00:12:04 +0000 (00:12 +0000)]
hls: m3u8: remove unused _get_current_fragment_duration() function

8 years agohls: m3u8: remove unused m3u8 client update_failed_count field
Tim-Philipp Müller [Fri, 27 Nov 2015 19:21:22 +0000 (19:21 +0000)]
hls: m3u8: remove unused m3u8 client update_failed_count field

8 years agohls: m3u8: remove helper var that's only used during parsing from structure
Tim-Philipp Müller [Sun, 15 Nov 2015 17:31:05 +0000 (17:31 +0000)]
hls: m3u8: remove helper var that's only used during parsing from structure

Just keep that local to the parsing function.

8 years agohls: rename plugin from fragmented to hls
Tim-Philipp Müller [Sun, 1 Nov 2015 13:21:45 +0000 (13:21 +0000)]
hls: rename plugin from fragmented to hls

8 years agohlsdemux: Always give timestamps if we're discont and don't mark stream discont if...
Sebastian Dröge [Tue, 1 Dec 2015 17:44:36 +0000 (19:44 +0200)]
hlsdemux: Always give timestamps if we're discont and don't mark stream discont if a playlist change was not successful

If the stream is discont, we must provide a timestamp in any case. Elements
like tsdemux are not going to output anything if we give a NONE timestamp
after a discont.

Also marking a stream as discont if a playlist change was not successful would
lead to the above situation, but in that case we are not required at all to
mark the stream discont as we're still at the old playlist.

8 years agotsmux: fix wrong log message level
Tim-Philipp Müller [Tue, 1 Dec 2015 17:06:33 +0000 (17:06 +0000)]
tsmux: fix wrong log message level

ERROR level is debugging left-over.

8 years agotests:aggregator: fix tc failure and correct check value
Hyunjun Ko [Mon, 9 Nov 2015 07:08:30 +0000 (16:08 +0900)]
tests:aggregator: fix tc failure and correct check value

Failure by this commit 2dfa548f3645844082c3db65d96d87255701b3ad, which is
to append hooks instead of prepend.
Because of this change, aggretated_cb is not called and leads to failure.

And correct to check flush stop value instead of flush start value

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

8 years agod3dvideosink: Don't try to recreate swapchain while the window is minimized
Sebastian Dröge [Mon, 30 Nov 2015 17:53:28 +0000 (19:53 +0200)]
d3dvideosink: Don't try to recreate swapchain while the window is minimized

It will fail and cause the sink to crash. Instead wait until the window is
visible again before checking if the swapchain really has to be recreated.

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

8 years agoopusparse: remove unneeded statement
Luis de Bethencourt [Fri, 27 Nov 2015 18:46:56 +0000 (18:46 +0000)]
opusparse: remove unneeded statement

commit da5c41930c4083979b1745f4d8848d97fe03d8eb removed the two uses of the
new value of data:
  channels = opus_packet_get_nb_channels (data);
  bandwidth = opus_packet_get_bandwidth (data);

Since then, data isn't being used between incrementing it by packet_offset
and going out of scope. Removing this uneeded statement.

8 years agotests: id3mux: add unit test for GST_TAG_PRIVATE_DATA writing
Tim-Philipp Müller [Fri, 27 Nov 2015 12:44:57 +0000 (12:44 +0000)]
tests: id3mux: add unit test for GST_TAG_PRIVATE_DATA writing

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

8 years agoid3mux: write private data tag
Ravi Kiran K N [Fri, 27 Nov 2015 06:03:07 +0000 (11:33 +0530)]
id3mux: write private data tag

Handle "PRIV" tag in id3mux. Write owner
identifier and private data and add to the
id3v2 frame.

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

8 years agoandroidmedia: Don't add metadata to locked buffer
Mathias Hasselmann [Thu, 26 Nov 2015 09:15:36 +0000 (10:15 +0100)]
androidmedia: Don't add metadata to locked buffer

The video decoders tried calling gst_buffer_add_*meta() on non-writable
buffer resulting in warnings of this kind:

  gstamcvideodec.c:921 (_gl_sync_render_unlocked): WARNING: amcvideodec
  Failed to create the transformation meta for the gl_sync 0xabc03848
  buffer 0xabb01b40 (0)

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

8 years agoadaptivedemux: tests: disabled testFragmentDownloadError test
Florin Apostol [Mon, 9 Nov 2015 18:07:30 +0000 (18:07 +0000)]
adaptivedemux: tests: disabled testFragmentDownloadError test

Until we will have support to control the generating thread from
fakeHTTPsrc element, the test testFragmentDownloadError is disabled.

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

8 years agoadaptivedemux: tests: corrected access to fakeHTTPsrc element
Florin Apostol [Mon, 9 Nov 2015 14:14:34 +0000 (14:14 +0000)]
adaptivedemux: tests: corrected access to fakeHTTPsrc element

The src element for adaptivedemux is now a bin. Updated the tests to
correctly reach into the bin and get the fakeHTTPsrc element

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

8 years agoadaptivedemux: tests: made fakeHTTPsrc element MT safe
Florin Apostol [Mon, 9 Nov 2015 14:13:04 +0000 (14:13 +0000)]
adaptivedemux: tests: made fakeHTTPsrc element MT safe

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

8 years agospu-pgs: Fix array memory leak
Vineeth T M [Mon, 23 Nov 2015 02:32:13 +0000 (11:32 +0900)]
spu-pgs: Fix array memory leak

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

8 years agoaudiomixer: register function name for debugging just once
Tim-Philipp Müller [Tue, 24 Nov 2015 00:20:36 +0000 (00:20 +0000)]
audiomixer: register function name for debugging just once

Not every time aggregate is called...

8 years agompdparser: remove gst_mpd_client_check_time_position
Florin Apostol [Tue, 24 Nov 2015 12:42:45 +0000 (12:42 +0000)]
mpdparser: remove gst_mpd_client_check_time_position

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

8 years agomssdemux: add depth field to audio caps if available
Maroš Ondrášek [Tue, 24 Nov 2015 10:50:51 +0000 (11:50 +0100)]
mssdemux: add depth field to audio caps if available

depth field can be retrieved from "BitsPerSample" or
from "WaveFormatEx" structure, if provided in Manifest

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

8 years agompdparser: tests: added test for fraction of seconds in availabilityStartTime
Florin Apostol [Fri, 20 Nov 2015 16:35:43 +0000 (16:35 +0000)]
mpdparser: tests: added test for fraction of seconds in availabilityStartTime

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

8 years agompdparser: added support for parsing fraction of seconds in dateTime fields
Florin Apostol [Fri, 20 Nov 2015 16:36:00 +0000 (16:36 +0000)]
mpdparser: added support for parsing fraction of seconds in dateTime fields

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

8 years agotests: put the waylandsink example window.ui file in EXTRA_DIST
George Kiagiadakis [Sun, 22 Nov 2015 12:11:48 +0000 (13:11 +0100)]
tests: put the waylandsink example window.ui file in EXTRA_DIST

8 years agotests: fix linking waylandsink example with the gstwayland library
George Kiagiadakis [Sun, 22 Nov 2015 12:08:35 +0000 (13:08 +0100)]
tests: fix linking waylandsink example with the gstwayland library

First, use top_builddir, otherwise it fails in out-of-source builds.
Second, link to the libtool archive directly to let make understand
the dependency.

8 years agodashdemux: always set presentationTimeOffset
Thiago Santos [Fri, 20 Nov 2015 23:59:16 +0000 (20:59 -0300)]
dashdemux: always set presentationTimeOffset

Set it for all types of segment lists (templates / lists / base)
and not only for templates.

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

8 years agomxfmux: Error out if we get a timeout during live mixing
Sebastian Dröge [Fri, 20 Nov 2015 15:50:30 +0000 (17:50 +0200)]
mxfmux: Error out if we get a timeout during live mixing

We can't handle that but need complete streams without gaps.

8 years agomxfmpeg: Use the correct sound essence compression UL for MP3
Sebastian Dröge [Fri, 20 Nov 2015 15:46:53 +0000 (17:46 +0200)]
mxfmpeg: Use the correct sound essence compression UL for MP3

There's one for MPEG 1 Layer 1 and one for Layer 2 and 3. We previously
had the second for Layer 1 and 2 and nothing for Layer 3, which was wrong.

8 years agomxfmpeg: Set the essence container UL byte 13 to 0x10 for h264
Sebastian Dröge [Fri, 20 Nov 2015 15:34:22 +0000 (17:34 +0200)]
mxfmpeg: Set the essence container UL byte 13 to 0x10 for h264

0x04 signifies a MPEG elementary stream but according to RP2008, 0x10 should
be used for a h264 byte-stream. This also fixes compatibility of our files
with ffmpeg.

8 years agoqml: reuse existing GstQSGTexture
Roman Nowicki [Fri, 20 Nov 2015 00:18:43 +0000 (11:18 +1100)]
qml: reuse existing GstQSGTexture

Fixes a memory leak leaking the texture objects.

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

8 years agoqml: activate the wrapped context when binding
Matthew Waters [Fri, 20 Nov 2015 00:08:37 +0000 (11:08 +1100)]
qml: activate the wrapped context when binding

Mitigates the following critical

gst_gl_context_thread_add: assertion 'context->priv->active_thread == g_thread_self ()' failed

8 years agoqml: proper initialization if scene is already initialized
Roman Nowicki [Thu, 19 Nov 2015 10:55:19 +0000 (11:55 +0100)]
qml: proper initialization if scene is already initialized

The scene graph can be initialized when the we receive window handle change
notification and so we will not receive a scenegraph initialization
notification.  Initialize ourself in this case.

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

8 years agodashdemux: Add binary search for stream_sidx_seek
Jimmy Ohn [Wed, 29 Jul 2015 13:31:30 +0000 (22:31 +0900)]
dashdemux: Add binary search for stream_sidx_seek

Add binary search to optimize in stream_sidx_seek.

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

8 years agompdparser: remove unused functions gst_mpdparser_get_chunk_by_index and gst_mpdparser...
Florin Apostol [Thu, 19 Nov 2015 15:59:56 +0000 (15:59 +0000)]
mpdparser: remove unused functions gst_mpdparser_get_chunk_by_index and gst_mpdparser_find_segment_by_index

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

8 years agodocs: update gst-launch-0.10 lines
Luis de Bethencourt [Thu, 19 Nov 2015 17:24:53 +0000 (17:24 +0000)]
docs: update gst-launch-0.10 lines

Update references to gst-launch-0.10 to gst-launch-1.0

8 years agoamcvideodec: move release_output_buffer into the sync meta
Matthew Waters [Wed, 18 Nov 2015 23:32:03 +0000 (10:32 +1100)]
amcvideodec: move release_output_buffer into the sync meta

Some devices only ever keep one buffer available in the GL queue resulting in
multiple calls to release_output_buffer only causing one frame to be rendered.
If there is a queue after amcvideodec (even playsink's small one), then
multiple buffers are pushed but only a small fraction of them are actually
rendered on time.  The rest will either render some number of frames ahead of
where they are meant to be or timeout waiting for a frame that's already been
rendered.

Solved by moving the release_output_buffer into the sync_meta the is pushed
downstream.  When downstream renders, the custom sync implementation attempts
to release the current buffer (if not already released) and render. Once the
frame has been rendered to the screen, the next frame is released and is
hopefully available by the time the next frame is to be rendered.

This fixes a perceived frame jitter in the output.

8 years agoRemove unnecessary NULL checks before g_free()
Reynaldo H. Verdejo Pinochet [Tue, 17 Nov 2015 23:23:17 +0000 (15:23 -0800)]
Remove unnecessary NULL checks before g_free()

g_free() is NULL-safe

8 years agompdparser: Also allow '/' in RepresentationID
Sebastian Dröge [Wed, 11 Nov 2015 15:11:14 +0000 (16:11 +0100)]
mpdparser: Also allow '/' in RepresentationID

Used by http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd

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

8 years agotests/examples: add a waylandsink example
George Kiagiadakis [Mon, 26 Oct 2015 15:24:40 +0000 (16:24 +0100)]
tests/examples: add a waylandsink example

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

8 years agowaylandsink: call gst_video_sink_center_rect with a destination rectangle that starts...
George Kiagiadakis [Wed, 18 Nov 2015 11:56:06 +0000 (12:56 +0100)]
waylandsink: call gst_video_sink_center_rect with a destination rectangle that starts from (0,0)

The intention of this code is to find the center rectangle relative
to (0,0), since subsurface coordinates are relative to the parent
surface.

The old code used to work but was wrong and broken by
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/gst-libs/gst/video/gstvideosink.c?id=ff57f6913456ec1991e55517cf1f239e80eeddef

8 years agodashdemux: fixed illegal memory access in gst_mpd_client_get_last_fragment_timestamp_end
Florin Apostol [Mon, 16 Nov 2015 17:25:34 +0000 (17:25 +0000)]
dashdemux: fixed illegal memory access in gst_mpd_client_get_last_fragment_timestamp_end

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

8 years agompdparser: tests: added test for gst_mpd_client_get_last_fragment_timestamp_end
Florin Apostol [Mon, 16 Nov 2015 17:25:21 +0000 (17:25 +0000)]
mpdparser: tests: added test for gst_mpd_client_get_last_fragment_timestamp_end

The timestamp for last fragment is incorrectly retrieved if segment templates
are used.

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

8 years agoamcvideodec: Don't require a non-zero buffer size when doing decoding to a surface
Sebastian Dröge [Tue, 17 Nov 2015 14:21:44 +0000 (16:21 +0200)]
amcvideodec: Don't require a non-zero buffer size when doing decoding to a surface

At least on some devices/Android versions the buffer size will always be zero
in these cases.

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

8 years agoglimagesink: Remove unused variable
Sebastian Dröge [Tue, 17 Nov 2015 15:17:50 +0000 (17:17 +0200)]
glimagesink: Remove unused variable

gstglimagesink.c: In function 'gst_glimage_sink_on_draw':
gstglimagesink.c:1959:18: error: unused variable 'sync_meta' [-Werror=unused-variable]
   GstGLSyncMeta *sync_meta = NULL;
                  ^

8 years agoglviewconvert: String literals are const
Sebastian Dröge [Tue, 17 Nov 2015 15:09:51 +0000 (17:09 +0200)]
glviewconvert: String literals are const

gstglviewconvert.c: In function '_mangle_extensions':
gstglviewconvert.c:1511:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     ext_str = "#extension GL_OES_EGL_image_external : require\n";
             ^

8 years agoglsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()
Sebastian Dröge [Tue, 17 Nov 2015 15:08:14 +0000 (17:08 +0200)]
glsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()

gstglsyncmeta.c  -fPIC -DPIC -o .libs/libgstgl_1.0_la-gstglsyncmeta.o
gstglsyncmeta.c: In function 'gst_buffer_add_gl_sync_meta':
gstglsyncmeta.c:131:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^

8 years agoamcvideodec: Fix indentation
Sebastian Dröge [Tue, 17 Nov 2015 14:21:10 +0000 (16:21 +0200)]
amcvideodec: Fix indentation

8 years agoapplemedia: vtdec: fix negotiation more
Alessandro Decina [Tue, 17 Nov 2015 05:08:17 +0000 (16:08 +1100)]
applemedia: vtdec: fix negotiation more

Year 12: I still don't understand how negotiation works.

Apparently gst_pad_query_caps doesn't do what I thought it did. To get the
actual caps that can flow through vtdec:src we must call gst_pad_peer_query_caps
with the template caps as filter.

Fixes negotiation with stuff that doesn't understand GLMemory (hello videoscale).

8 years agoapplemedia: vtdec: minor texture cache fixes
Alessandro Decina [Tue, 17 Nov 2015 05:14:11 +0000 (16:14 +1100)]
applemedia: vtdec: minor texture cache fixes

Small fix on how the texture cache is cleaned up / setup in case of renegotiation

8 years agoapplemedia: corevideotexturecache: stop configuring cache->convert over and over
Alessandro Decina [Tue, 17 Nov 2015 05:13:00 +0000 (16:13 +1100)]
applemedia: corevideotexturecache: stop configuring cache->convert over and over

8 years agoglimagesink: wait on the correct sync meta when rendering
Matthew Waters [Mon, 16 Nov 2015 04:46:41 +0000 (15:46 +1100)]
glimagesink: wait on the correct sync meta when rendering

8 years agoamcviddec: output external-oes textures
Matthew Waters [Tue, 3 Nov 2015 02:19:41 +0000 (13:19 +1100)]
amcviddec: output external-oes textures

This provides a performance and power usage improvement by removing
the texture copy from an OES texture to 2D texture.

The flow is as follows
1. Generate the output buffer with the required sync meta with the incrementing
   push counter and OES GL memory
1.1 release_output_buffer (buf, render=true) and push downstream
2. Downstream waits for on the sync meta (timed wait) or drops the frame (no wait)
2.1 Timed wait for the frame number to reach the number of frame callbacks fired
2.2 Unconditionally update the image when the wait completes (success or fail).
    Sets the affine transformation matrix meta on the buffer.
3. Downstream renders as usual.

At *some* point through this the on_frame_callback may or may not fire.  If it
does fire, we can finish waiting early and render. Otherwise we have to
wait for a timeout to occur which may cause more buffers to be pused into the
internal GL queue which siginificantly decreases the chances of the
on_frame_callback to fire again.  This is because the frame callback only occurs
when the internal GL queue changes state from empty to non-empty.

Because there is no way to reliably correlate between the number of buffers
pushed and the number of frame callbacks received, there are a number of
workarounds in place.
1. We self-increment the ready counter when it falls behind the push counter
2. Time based waits as the frame callback may not be fired for a certain frame.
3. It is assumed that the device can render at speed or performs some QoS of
   the interal GL queue (which may not match the GStreamer QoS).

It holds that we call SurfaceTexture::updateTexImage for each buffer pushed
downstream however there's no guarentee that updateTexImage will result in
the exact next frame (it could skip or duplicate) so synchronization is not
guaranteed to be accurate although it seems to be close enough to be unable
to discern visually.  This has not changed from before this patch.  The current
requirement for synchronization is that updateTexImage is called at the point in
time when the buffers is to be rendered.

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

8 years agoglsyncmeta: add vfuncs for all operations
Matthew Waters [Mon, 2 Nov 2015 06:57:29 +0000 (17:57 +1100)]
glsyncmeta: add vfuncs for all operations

there could be other ways/requirements for synchronising two GPU command
streams (whether GL or platform specific).

e.g. glfencesync/eglwaitnative/cond/etc

8 years agoglimagesink: add support for rendering external-oes textures
Matthew Waters [Tue, 10 Nov 2015 04:37:05 +0000 (15:37 +1100)]
glimagesink: add support for rendering external-oes textures

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

8 years agoglviewconvert: add support rectangle/external-oes textures
Matthew Waters [Tue, 10 Nov 2015 03:54:02 +0000 (14:54 +1100)]
glviewconvert: add support rectangle/external-oes textures

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

8 years agoapplemedia: vtdec: fix setting internal SKIP / DROP flags
Alessandro Decina [Tue, 17 Nov 2015 04:18:28 +0000 (15:18 +1100)]
applemedia: vtdec: fix setting internal SKIP / DROP flags

8 years agoglimagesink: Fix structure memory leak
Vineeth TM [Tue, 17 Nov 2015 00:08:52 +0000 (09:08 +0900)]
glimagesink: Fix structure memory leak

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

8 years agoautoconvert: Add support for bufferlists
Olivier Crête [Tue, 17 Nov 2015 02:52:07 +0000 (21:52 -0500)]
autoconvert: Add support for bufferlists

8 years agoapplemedia: vtdec: improve negotiation
Alessandro Decina [Tue, 17 Nov 2015 00:21:27 +0000 (11:21 +1100)]
applemedia: vtdec: improve negotiation

Rework negotiation implementing GstVideoDecoder::negotiate. Make it possible to
switch texture sharing on and off at runtime. Useful to (eventually) turn
texture sharing on in pipelines where glimagesink is linked only after
decoding has already started (for example OWR).

8 years agoapplemedia: vtdec: improve handing of decode errors/frame drops
Alessandro Decina [Tue, 17 Nov 2015 00:19:57 +0000 (11:19 +1100)]
applemedia: vtdec: improve handing of decode errors/frame drops

Improve decode error handling by avoiding calling into GstVideoDecoder from the
VT decode callback. This removes contention on the GST_VIDEO_DECODER_STREAM_LOCK
which used to make the decode callback slow enough for VT to start dropping lots
of frames once the first frame was dropped.

8 years agoapplemedia: vtdec: fix uninitialized variable warning
Alessandro Decina [Tue, 17 Nov 2015 00:22:15 +0000 (11:22 +1100)]
applemedia: vtdec: fix uninitialized variable warning

8 years agoadaptivedemux: remove now-defunct "num-lookback-fragments" property
Tim-Philipp Müller [Sat, 14 Nov 2015 20:21:17 +0000 (20:21 +0000)]
adaptivedemux: remove now-defunct "num-lookback-fragments" property

This no longer does anything, and it was marked as CONSTRUCT_ONLY
which means someone would really have to go out of their way to
be able to set this, which would only be done in very custom
scenarios, if ever, and those will likely target a specific
version of GStreamer then, so probably not much point keeping
it deprecated for a while before removing it.

8 years agoautoconvert: Always give a valid reply to internal caps queries
Olivier Crête [Fri, 13 Nov 2015 22:14:14 +0000 (17:14 -0500)]
autoconvert: Always give a valid reply to internal caps queries

Caps queries can always have a valid reply, either the filter or ANY.
If the caps are ANY, then accept-caps always returns TRUE.

8 years agompegtsdemux: fix section_data leak
Nicolas Huet [Thu, 12 Nov 2015 15:35:12 +0000 (16:35 +0100)]
mpegtsdemux: fix section_data leak

If packet->payload_unit_start_indicator is true and pointer 0, there is no
discontinuity check. Therefore there could be a previous section not complete
that need to be cleared.

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

8 years agoglsl: fix possible string overrun in gst_glsl_version_profile_from_string
Vineeth TM [Fri, 13 Nov 2015 01:41:58 +0000 (10:41 +0900)]
glsl: fix possible string overrun in gst_glsl_version_profile_from_string

given a NULL-terminated string, s.
s[i] = '\0';
i++;
does not guarentee that s[i] is NULL terminated and thus string operations
could read off the end of the array.

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

8 years agoglshader: don't read invalid list pointers (use after free)
Matthew Waters [Fri, 13 Nov 2015 05:50:22 +0000 (16:50 +1100)]
glshader: don't read invalid list pointers (use after free)

gst_gl_shader_detach_unlocked already removes the list entry so attempting to
use the element to iterate to the next stage could read invalid data.

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

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

8 years agotests:glsl: version_profile_s string leak
Vineeth TM [Fri, 13 Nov 2015 01:44:26 +0000 (10:44 +0900)]
tests:glsl: version_profile_s string leak

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

8 years agoglsl: free str while returning error
Vineeth TM [Fri, 13 Nov 2015 01:56:10 +0000 (10:56 +0900)]
glsl: free str while returning error

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

8 years agotests:glupload: fix caps memory leak
Vineeth TM [Fri, 13 Nov 2015 02:04:34 +0000 (11:04 +0900)]
tests:glupload: fix caps memory leak

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

8 years agoopusenc: avoid potential overflow expression
Luis de Bethencourt [Thu, 12 Nov 2015 12:21:54 +0000 (12:21 +0000)]
opusenc: avoid potential overflow expression

The result of the two expressions will be promoted to guint64 anyway,
perform all the arithmetic in 64 bits to avoid potential overflows.

CID 1338690, CID 1338691

8 years agotsdemux: remove memory leak
Luis de Bethencourt [Thu, 12 Nov 2015 12:00:07 +0000 (12:00 +0000)]
tsdemux: remove memory leak

The values of channel_mapping are copied by gst_codec_utils_opus_create_caps ()
but it doesn't free or take ownership of the g_new0 allocated memory. This
needs to be freed before going out of scope.

CID 1338692

8 years agompegtsmux: remove unnecessary buffer check
Luis de Bethencourt [Thu, 12 Nov 2015 11:42:36 +0000 (11:42 +0000)]
mpegtsmux: remove unnecessary buffer check

buf surely isn't NULL inside the block conditional to a buffer size bigger
than (G_MAXUINT16 - 3). Plus gst_buffer_unref() checks if the buffer is
NULL and does nothing if it is.

CID 1338693

8 years agoopusparse: initialize sample rate to a default
Luis de Bethencourt [Thu, 12 Nov 2015 11:23:31 +0000 (11:23 +0000)]
opusparse: initialize sample rate to a default

sample_rate might be used uninitialized if !sink_caps is TRUE. Initialize
it to the default used in gst_codec_utils_opus_parse_caps () when there is
no rate defined in the caps.

CID 1338695

8 years agoglslstage: Fix vertex_sources memory leak
Vineeth TM [Thu, 12 Nov 2015 07:36:03 +0000 (16:36 +0900)]
glslstage: Fix vertex_sources memory leak

vertex_sources is being allocated but not freed resulting in leak

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

8 years agoglcolorconvert: remove unnecessary free
Vineeth TM [Thu, 12 Nov 2015 07:26:00 +0000 (16:26 +0900)]
glcolorconvert: remove unnecessary free

version_str is already being freed. So no need to call again

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

8 years agoglcolorconvert: Fix string leak
Vineeth TM [Thu, 12 Nov 2015 07:18:35 +0000 (16:18 +0900)]
glcolorconvert: Fix string leak

String got using gst_glsl_version_profile_to_string, is allocated
memory and should be freed

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

8 years agoglcolorconvert: Fix frag_prog and frag_body memory leak
Vineeth TM [Thu, 12 Nov 2015 07:02:45 +0000 (16:02 +0900)]
glcolorconvert: Fix frag_prog and frag_body memory leak

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

8 years agoadaptivedemux: fixed handling errors emitted by uri handler
Florin Apostol [Wed, 11 Nov 2015 16:51:23 +0000 (16:51 +0000)]
adaptivedemux: fixed handling errors emitted by uri handler

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

8 years agotsdemux: fix pending buffers leak when flushing
Nicolas Huet [Tue, 10 Nov 2015 15:32:37 +0000 (16:32 +0100)]
tsdemux: fix pending buffers leak when flushing

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

8 years agotsdemux: Fix pad leak when the pad is never exposed
Etienne Peron [Wed, 10 Jun 2015 12:18:00 +0000 (14:18 +0200)]
tsdemux: Fix pad leak when the pad is never exposed

If tsdemux never receives data for a stream, the corresponding pad will never
be added and stream->active will remain FALSE. When the stream is removed, the
pad will not be unreffed and will be leaked.

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

8 years agoivfparse: Fix the wrong width & height parsing of vp9 bitstream
Sreerenj Balachandran [Mon, 9 Nov 2015 15:45:29 +0000 (17:45 +0200)]
ivfparse: Fix the wrong width & height parsing of vp9 bitstream

The current implementation for detecting the resolution changes
on key frames is based on vp8 bitstream alignment. Avoid this
width and height parsing for vp9 bitstream, which requires proper
frame header parsing inorder to detect the resolution change (Fixme).

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

8 years agovtenc: Set profile_level to NULL after release
Heinrich Fink [Wed, 11 Nov 2015 10:40:52 +0000 (11:40 +0100)]
vtenc: Set profile_level to NULL after release

Otherwise, gst_vtenc_negotiate_profile_and_level will double-release as
it checks for profile_level != NULL. This caused crashes when the
vtenc instance is stopped and then restarted.

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

8 years agoglcolorconvert: mangle gl_FragColor for GL3
Matthew Waters [Wed, 11 Nov 2015 12:39:35 +0000 (23:39 +1100)]
glcolorconvert: mangle gl_FragColor for GL3

Some drivers don't provide the compatibility definition and we need to provide
our own 'out vec4' variable to put the results of the fragment shader into.

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

8 years agotests:glcolorconvert: Fix caps memory leak
Vineeth TM [Wed, 11 Nov 2015 07:06:25 +0000 (16:06 +0900)]
tests:glcolorconvert: Fix caps memory leak

Output caps being got from video info is not getting freed

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

8 years agotsdemux: provide our own definition of log2()
Matthew Waters [Tue, 10 Nov 2015 06:58:58 +0000 (17:58 +1100)]
tsdemux: provide our own definition of log2()

The log2 function/macro doesn't exist when targetting android API < 18 (or MSVC
< 2013) whereas our current baseline is API 9.

8 years agoglviewconvert: remove set_format
Matthew Waters [Tue, 10 Nov 2015 02:52:30 +0000 (13:52 +1100)]
glviewconvert: remove set_format

We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output

8 years agoglimagesink: fix a memory leak if the view conversion fails
Matthew Waters [Tue, 10 Nov 2015 23:31:07 +0000 (10:31 +1100)]
glimagesink: fix a memory leak if the view conversion fails

8 years agoglimagesink: balance the creation/destruction of the overlay compositor
Matthew Waters [Wed, 11 Nov 2015 02:37:59 +0000 (13:37 +1100)]
glimagesink: balance the creation/destruction of the overlay compositor

Fixes some leaks/possible segfault on when failing to create the compositor.

8 years agoglshader: properly unref the stages on failure
Matthew Waters [Wed, 11 Nov 2015 01:23:30 +0000 (12:23 +1100)]
glshader: properly unref the stages on failure

When failing in the varargs functions, all the stage objects not handled need to
be unreffed to prevent a leak.

8 years agoglslstage: properly return an error when we could not create the shader stage
Matthew Waters [Wed, 11 Nov 2015 00:29:35 +0000 (11:29 +1100)]
glslstage: properly return an error when we could not create the shader stage

While it was erroring out correctly later, there were GLib warnings about
setting a GError over the top of another GError.

8 years agoglshaderstrings: fixup the external-oes fragment shader
Matthew Waters [Tue, 10 Nov 2015 14:05:20 +0000 (01:05 +1100)]
glshaderstrings: fixup the external-oes fragment shader

The wrong sampler type was used
s/sampler2DExternalOES/samplerExternalOES/

8 years agoglcolorconvert: try to keep the same texture-target if possible
Matthew Waters [Tue, 10 Nov 2015 12:41:24 +0000 (23:41 +1100)]
glcolorconvert: try to keep the same texture-target if possible

Fixes issues attempting to passthrough external-oes textures

8 years agoglcolorconvert: fix rendering rectangular textures with GL3
Matthew Waters [Tue, 10 Nov 2015 11:41:57 +0000 (22:41 +1100)]
glcolorconvert: fix rendering rectangular textures with GL3

Rectangular textures are unavailable in unextended
GLES2 #version 100 shaders.

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

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

- varying -> in or out depending on the stage (vertex/fragment)
- attribute -> in
- filtered texture access is a single function, texture()

8 years agoglcolorconvert: properly use the other texture-target on fixation
Matthew Waters [Tue, 10 Nov 2015 09:20:29 +0000 (20:20 +1100)]
glcolorconvert: properly use the other texture-target on fixation

8 years agoglslstage: add debug as to why _set_strings() failed
Matthew Waters [Tue, 10 Nov 2015 09:15:56 +0000 (20:15 +1100)]
glslstage: add debug as to why _set_strings() failed

8 years agoglsl: fix check for glsl version against GL context inversion
Matthew Waters [Tue, 10 Nov 2015 09:13:53 +0000 (20:13 +1100)]
glsl: fix check for glsl version against GL context inversion

Any GLSL version that was less than the provided GL version would fail

8 years agoadaptivedemux: Fix pad memory leak.
Vineeth TM [Tue, 10 Nov 2015 01:02:38 +0000 (10:02 +0900)]
adaptivedemux: Fix pad memory leak.

The static pads got from queue and uri_handler are not being freed
resulting in memory leaks.

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

8 years agogl: forward declare some enums
Matthew Waters [Tue, 10 Nov 2015 02:13:50 +0000 (13:13 +1100)]
gl: forward declare some enums

Specifically the GstGLTextureTarget enum

8 years agoglslstage: expose the default shader strings as public
Matthew Waters [Tue, 10 Nov 2015 02:11:37 +0000 (13:11 +1100)]
glslstage: expose the default shader strings as public

Add some other simple strings for external-oes textures or transforming
the texture coordinates with a transformation matrix

8 years agoglcolorconvert: wait on the sync meta for input buffers
Matthew Waters [Thu, 5 Nov 2015 16:05:31 +0000 (03:05 +1100)]
glcolorconvert: wait on the sync meta for input buffers

8 years agoglimagesink: wait on the provided sync meta provided to glimagesink
Matthew Waters [Wed, 4 Nov 2015 13:13:01 +0000 (00:13 +1100)]
glimagesink: wait on the provided sync meta provided to glimagesink

8 years agoglcolorconvert: use the correct oes target string in the template caps
Matthew Waters [Sun, 8 Nov 2015 11:14:01 +0000 (22:14 +1100)]
glcolorconvert: use the correct oes target string in the template caps