Commit graph

5425 commits

Author SHA1 Message Date
Nicolas Dufresne
71c9cdeff4 webrtcdsp: Rewrite echo data synchronization
The previous code would run out of sync if there was packet lost
or clock skews. When that happened, the echo cancellation feature would
completely stop working. As this is crucial for audio calls, this patch
re-implement synchronization completely.

Instead of letting it drift until next discont, we now synchronize
against the record data at every iteration. This way we simply never
let the stream drift for longer then 10ms period. We also shorter the
delay by using the latency up the probe (basically excluding the sink
latency. This is a decent delay to avoid starving in the probe queue.

https://bugzilla.gnome.org/show_bug.cgi?id=768009
2016-06-30 09:27:03 -04:00
Nicolas Dufresne
e35e23b734 webrtcdsp: We now fail if there is no echo probe
When echo cancel is enabled, we now fail the pipeline if there is
not echo probe. For this reason there is no need to check if probe
pointer is set anymore.
2016-06-30 09:27:03 -04:00
Sebastian Dröge
e7f8c62d42 openh264enc: Remove broken byte-stream to avc conversion and just output byte-stream as generated by the encoder
The byte-stream to avc conversion did not consider NAL sizes bigger than 2^16,
multiple layers, multiple NALs per layer, and various other things. This
caused corrupted streams in higher bitrates and other circumstances.

Let's just forward byte-stream as generated by the encoder and let h264parse
handle conversion to avc if needed. That way we only have to keep around one
version of the conversion and don't have to fix it in multiple places.
2016-06-30 10:37:08 +02:00
Matthew Waters
989200820d glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2016-06-29 18:04:28 +10:00
Haihua Hu
d60b071474 qmlglsink: Fix build error when don't have QPA installed.
Check header file existance and wrap the header file include
in the necessary #ifdef to avoid build error.

https://bugzilla.gnome.org/show_bug.cgi?id=767553
2016-06-27 22:44:56 +10:00
Tim-Philipp Müller
ab2281be0f openjpeg: fix more broken includes 2016-06-24 09:41:18 +01:00
Aaron Boxer
e7e6a3579d jpeg2000parse: use enums for colorspace and sampling, rather than strings
Also, move gstjpeg2000sampling to codecparsers project

https://bugzilla.gnome.org/show_bug.cgi?id=767908
2016-06-24 11:23:31 +03:00
Nicolas Dufresne
c551a853b3 webrtcdsp: Offset timestamp with duration
The saved timestamp is used to compute the delay of the probe data.
As it's used at the following incoming buffer, it needs to be offset
with the duration of the buffer to represent the end position. Also,
properly initialize the saved timestamp and protect against TIME_NONE.
2016-06-23 08:04:18 -04:00
Nicolas Dufresne
86aa3b5f9c webrtcdsp: Synchronize with delays
Until now, we were synchronizing both DSP and Probe adapter by
waiting and clipping the probe adapter data. This increases the CPU
usage, can cause copies if the audio is not 10ms aligned and the worst
is that it prevents the processing from compensating for inaccurate
latency. This is also a step forward toward supporting playback
filters.
2016-06-22 22:34:25 -04:00
Nicolas Dufresne
fb8662eb5c webrtdsp: Remove restriction on channels number
Unlike 0.1, in 0.2 the reverse stream can have different number of
channels. Remove the check that restrict it.
2016-06-22 22:34:25 -04:00
Nicolas Dufresne
89b193c0a9 webrtcdsp: Style fix 2016-06-22 22:34:25 -04:00
Matthew Waters
ba69afdc47 qmlglsink: add win32 support
The current state of c++ ABI's on Window's and Gst's/Qt's conflicting
mingw builds means that we cannot use mingw for building the qt plugin.

Instead, a qmake .pro file is provided that is expected to be used with the
msvc binaries provided by Qt like so:

(with the PATH environment variable containing the path to the qt biniaries
and PKG_CONFIG_PATH containing the path to GStreamer modules)
cd /path/to/sources/gst-plugins-bad/ext/qt
qmake -tp vc

Then open the resulting VS project and build the library.  Then

cp debug/libgstqtsink.dll /path/to/prefix/lib/gstreamer-1.0/libgstqtsink.cll

https://bugzilla.gnome.org/show_bug.cgi?id=761260
2016-06-22 14:26:05 +10:00
Nicolas Dufresne
398f7059fc webrtcdsp: Add WebRTC Audio Processing support
This DSP library can be used to enhance voice signal for real time
communication call. In implements multiple filters like noise reduction,
high pass filter, echo cancellation, automatic gain control, etc.

The webrtcdsp element can be used along, or with the help of the
webrtcechoprobe if echo cancellation is enabled. The echo probe should
be placed as close as possible to the audio sink, while the DSP is
generally place close to the audio capture. For local testing, one can
use an echo loop pipeline like the following:

  autoaudiosrc ! webrtcdsp ! webrtcechoprobe ! autoaudiosink

This pipeline should produce a single echo rather then repeated echo.
Those elements works if they are placed in the same top level pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=767800
2016-06-21 13:46:00 -04:00
Aaron Boxer
74dcb59025 openjpegdec: use sampling field to determine RGB channel
https://bugzilla.gnome.org/show_bug.cgi?id=767402
2016-06-21 11:43:04 +03:00
Joan Pau Beltran
dc762166f3 dc1394src: check for disabled transmission in _stop_cam
For symetry with _start_cam, check that the transmission
is effectively disabled in _stop_cam.

https://bugzilla.gnome.org/show_bug.cgi?id=763026
2016-06-20 21:46:23 +01:00
Sergey Borovkov
180405714c qml: Enable qmlglsink for eglfs
https://bugzilla.gnome.org/show_bug.cgi?id=763044
2016-06-16 01:49:16 +10:00
Matthew Waters
14c6fece09 qmlglsink: propagate GL context creation failure upwards
Otherwise an application cannot know if the qmlglsink will be displaying frames
incorrectly/at all.
2016-06-16 01:49:16 +10:00
Matthew Waters
ef508b8461 qmlglsink: also allow wayland-egl as a platform name 2016-06-16 01:49:16 +10:00
Haihua Hu
3903406304 qmlglsink: Add Wayland support
Don't use gstgldisplay to get wayland display. Should use QPA on wayland
to get wayland display for QT.

https://bugzilla.gnome.org/show_bug.cgi?id=767553
2016-06-16 01:49:16 +10:00
Stefan Sauer
976cb234bc ladspa: simplify registry cache structure creation
Create and fill structure in one go.
2016-06-15 12:14:30 +02:00
Haihua Hu
5e8a650130 gleffects: fix little rectangle that appears at the center of squeeze and tunnel effects
These two shader will calculate the vector length and use it as denominator.
But length could be zero which will cause undefine behaviour. Add protection for
this condition

https://bugzilla.gnome.org/show_bug.cgi?id=767635
2016-06-15 19:18:15 +10:00
Matthew Waters
4010faf4a1 gldeinterlace: remove dead code accessing filter->in_tex_id
It's not set by anyone or anything and gldeinterlace is the only user of it now.
2016-06-15 15:08:39 +10:00
Aleix Conchillo Flaqué
15a3b0f6ce srtpenc: remove get-rollover-counter signal and add stats property
We remove get-rollover-counter signal in favor of the "stats"
property. The "stats" property is a GstStructure with caps
application/x-srtp-encoder-stats that contains an array of
structures with caps application/x-srtp-stream.
Each stream structure contains "ssrc" and "roc" fields.

https://bugzilla.gnome.org/show_bug.cgi?id=733265
2016-06-13 14:55:25 +02:00
Sebastian Rasmussen
c7e4217121 curlsmtpsink: Lock and don't send final boundary upon error
Previously GstCurlSmtpSink could cause the pipeline thread to end up
waiting for a stopped thread to perform work.

The scenario was that the sink could be rendering a buffer and waiting
for the curl transfer thread to have sent the data. As soon as the
transfer thread has copied all data to curl's data buffer in
gst_curl_base_sink_transfer_read_cb() then the render call would stop
waiting and return GST_FLOW_OK. While this takes place the transfer
thread may suffer from an error e.g. due gst_poll_wait() timing out.
This causes the transfer thread to record the error, claim (it is not
really true since there was an error) that the data has been sent and
that a response has been received by trying to signal the pipeline
thread (but this has already stopped waiting). Finally the transfer
thread stops itself. A short while later the pipeline thread may attempt
to push an EOS event into GstCurlSmtpSink. Since there is no check in
gst_curl_smtp_sink_event() to check if the sink has suffered from any
error it may attempt to add a final boundary and ask the, now deceased,
transfer thread to transfer the new data. Next the sink element would
have waited for the transfer to complete (using a different mechanism
than normal transfers through GstCurlBaseSink). In this case there was
an error check to avoid waiting if an error had already been seen.
Finally GstCurlSmtpSink would chain up to GstCurlBaseSink which would
then block waiting for a response (normally this would be prevented by
the transfer thread suffering the error claiming that it had been
received, but GstCurlSmtpSink clobbered this flag after the fact).

Now GstCurlSmtpSink avoids this by locking over the entire event handing
(preventing simultaneous changes to flags by the two threads) and also
by avoiding to initiate transfer of final boundary if an error has
already been seen.

Also add GST_FIXME() for remaining similar issue where the pipeline
thread may block indefinitely waiting for transfer thread to transfer
data but the transfer thread errors out and fails to notify the pipeline
thread that the transfer failed.

https://bugzilla.gnome.org/show_bug.cgi?id=767501
2016-06-11 11:25:13 +01:00
Heinrich Fink
3107f5df76 facedetect: Fix compiler warning with clang 3.8
Use namespace only after it was actually defined by a header.

gstfacedetect.cpp:79:17: error: using directive refers to implicitly-defined namespace 'std' [-Werror]
using namespace std;
                ^
2016-06-10 11:33:52 +03:00
Tim-Philipp Müller
faf6e5a1eb dc1394src: minor clean-up
We always call _parse_caps() with non-NULL out vars.
2016-06-09 22:01:45 +01:00
Tim-Philipp Müller
09737d1874 dc1394src: fix some more c99-isms 2016-06-09 22:01:13 +01:00
Joan Pau Beltran
3355f5b3ab dc1394src: prefix and file names according to Gstreamer conventions
Replace the type and function prefix to follow the conventions:

  - Use `GST_TYPE_DC1394_SRC` instead of `GST_TYPE_DC1394`.

  - Use `GstDC1394Src` and `GstDC1394SrcClass` instead of
    `GstDc1394` and `GstDc1394Class`.

  - Use `gst_dc1394_src` instead of `gst_dc1394`.

https://bugzilla.gnome.org/show_bug.cgi?id=763026
2016-06-09 21:47:58 +01:00
Joan Pau Beltran
e28b123608 dc1394src: port to 1.X
The dc1394src is a PushSrc element for IIDC cameras based on libdc1394.
The implementation from the 0.x series is deffective:
caps negotiation does not work, and some video formats
provided by the camera are not supported.

Refactor the code to port it to 1.X and enhance the support
for the full set of video options of IIDC cameras:

  - The IIDC specification includes a set of camera video modes
    (video format, frame size, and frame rates).
    They do not map perfectly to Gstreamer formats, but those that
    do not match are very rare (if used at all by any camera).
    In addition, although the specification includes a raw format,
    some cameras use mono video formats to capture in Bayer format.
    Map corresponding video modes to Gstreamer formats in capabilities,
    allowing both gray raw and Bayer video formats for mono video modes.

  - The specification includes scalable video modes (Format7),
    where the frame size and rate can be set to arbitrary values
    (within the limits of the camera and the bus transport).
    Allow the use of such mode, using the frame size and rate
    from the negotiatied caps, and set the camera frame rate
    adjusting the packet size as in:
    <http://damien.douxchamps.net/ieee1394/libdc1394/faq/#How_do_I_set_the_frame_rate>

    The scalable modes also allow for a custom ROI offset.
    Support for it can be easily added later using properties.

  - Camera operation using libdc1394 is as follows:

      1. Enumerate cameras on the system and open the camera
         identified the enumeration index or by a GUID (64bit hex code).

      2. Query the video formats supported by the camera.

      3. Configure the camera for the desired video format.

      4. Setup the capture resources for the configured video format
         and start the camera transmission.

      5. Capture frames from the camera and release them when not used.

      6. Stop the camera transmission and clear the capture resources.

      7. Close the camera freeing its resources.

    Do steps 2 and 3 when getting and setting the caps respectively.
    Ideally 4 and 6 would be done when going from PAUSED to PLAYING
    and viceversa, but since caps might not be set yet, the video mode
    is not properly configured leaving the camera in a broken state.
    Hence, setup capture and start transmission in the set caps method,
    and consequently clear the capture and stop the transmission
    when going from PAUSED to READY (instead of PLAYING to PAUSED).
    Symmetrycally, open the camera when going from READY to PAUSED,
    allowing to probe the camera caps in the negotiation stage.
    Implement that using the `start` and `stop` methods of `GstBaseSrc`,
    instead of the `change-state` method of `GstElement`.
    Stop the camera before setting new caps and restarting it again
    to handle caps reconfiguration while in PLAYING (it has no effect
    if the camera is not started).

  - Create buffers copying the bytes of the captured frames.
    Alternatively, the buffers could just wrap the bytes of the frames,
    releasing the frame in the buffer's destroy notify function,
    if all buffers were destroyed before going from PLAYING to PAUSED.

  - No timestamp nor offset is set when creating buffers.
    Timestamping is delegated to the parent class BaseSrc,
    setting `gst_base_src_set_live` TRUE, `gst_base_src_set_format`
    with GST_FORMAT_TIME and `gst_base_src_set_do_timestamp`.
    Captured frames have a timestamp field with the system time
    at the completion of the transmission of the frame,
    but it is not sure that this comes from a monotonic clock,
    and it seems to be left NULL in Windows.

  - Use GUID and unit properties to select the camera to operate on.
    The camera number used in version 0.X does not uniquely identify
    the device (it depends on the set of cameras currently detected).
    Since the GUID is 64bit identifier (same as MAC address),
    handle it with a string property with its hexadecimal representation.
    For practicality, operate on the first camera available if the GUID
    is null (default) and match any camera unit number if unit is -1.
    Alternatively, the GUID could be handed with an unsigned 64 bit
    integer type property, using `0xffffffffffffffff` as default value
    to select the first camera available (it is not a valid GUID value).

  - Keep name `GstDc1394` and prefix `gst_dc1394` as in version 0.X,
    although `GstDC1394Src` and `gst_dc1394_src` are more descriptive.

  - Adjust build files to reenable the compilation of the plugin.

    Remove dc1394 from the list of unported plugins in configure.ac.

    Add the missing flags and libraries to Makefile.
    Use `$()` for variable substitution, as many plugins do,
    although other plugins use `@@` instead.

https://bugzilla.gnome.org/show_bug.cgi?id=763026
2016-06-09 21:47:58 +01:00
Nicolas Dufresne
d33352edb5 webpdec: Wait for segment event before checking it
The heuristic to choose between packetise or not was changed to use the
segment format. The problem is that this change is reading the segment
during the caps event handling. The segment event will only be sent
after. That prevented the decoder to go in packetize mode, and avoid
useless parsing.

https://bugzilla.gnome.org/show_bug.cgi?id=736252
2016-06-07 21:10:04 -04:00
Tim-Philipp Müller
4c874797b2 openjpeg: fix builddir != srcdir build, and distcheck 2016-06-07 14:15:41 +01:00
Aaron Boxer
eebb65e934 openjpeg: set sampling in the caps
https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-07 15:24:32 +03:00
Havard Graff
7ecfd7e24d gltestsrc: gltestsrc.h already defines GstGLTestSrc
And redefinition is not allowed.

https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-05-28 22:20:51 +01:00
Tim-Philipp Müller
7d46d67c59 smoothstreaming: update fps calculation for h264 codec parser API changes
Use new gst_h264_video_calculate_framerate() API instead of fps_n/fps_d
fields in SPS struct which are to be removed.

Apparently H264 content in MSS is always non-interlaced/progressive,
so we can just pass 0 for field_pic_flag and don't need to parse any
slice headers first if there's no external signalling. But even if
that's not the case the new code is not worse than the existing code.

https://msdn.microsoft.com/en-us/library/cc189080%28VS.95%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=723352
2016-05-28 10:29:20 +01:00
Nicolas Dufresne
203e893e10 caopengllayersink: Don't cache buffer pool
Pools cannot be used by the two elements at the same time.

https://bugzilla.gnome.org/show_bug.cgi?id=766611
2016-05-25 13:35:59 -04:00
Haihua Hu
a5cb746983 glimagesink: support video rotation using transform matrix
Add "rotate-method" to glimagesink and apply transform matrix
to vertex coordinate to control rotation.

https://bugzilla.gnome.org/show_bug.cgi?id=765795
2016-05-25 18:28:20 +10:00
Matthew Waters
061a157ef5 glvideomixer: fix race retrieving the GL context from the display
_get_gl_context() can be called concurrently from either propose_allocation() or
decide_allocation().  If it so happens that this happens at the same time,
the check for whether we already had a GL context was outside the lock.  Inside
the lock and loop, the first thing that happens is that we unref the current GL
context (if valid) as if there was a conflict adding it to the display.  If the
timing was unlucky, subsequent use of the GL context would be referencing an
already unreffed GL context object resulting in a critical:

g_object_ref: assertion 'object->ref_count > 0' failed

https://bugzilla.gnome.org/show_bug.cgi?id=766703
2016-05-25 18:28:20 +10:00
Arjen Veenhuizen
113d5c143c gltransformation: make the pivot-z property READWRITE
Instead of just being READABLE.

https://bugzilla.gnome.org/show_bug.cgi?id=766818
2016-05-24 23:30:09 +10:00
Guillaume Desmottes
dff46e3239 gltestsrc: fix src_impl leak
https://bugzilla.gnome.org/show_bug.cgi?id=766661
2016-05-24 21:30:19 +10:00
Aaron Boxer
e76705dbde openjpegenc: enable MCT for RGB video
https://bugzilla.gnome.org/show_bug.cgi?id=766732
2016-05-21 09:44:22 +03:00
Guillaume Desmottes
fe7dd131f5 gltestsrc: fix shaders ref counting
The gltestsrc element uses two shaders: color_shader and snow_shader.
Those are alternatively assigned to the SrcShader->shader pointer and
their reference was transferred to it. Only the SrcShader->shader was
unreffed (in _src_shader_deinit()) so only one shader was properly
freed, the other one was leaked.

Fixed this by giving an extra ref to SrcShader->shader and unreffing the
2 shaders in _src_smpte_free().

https://bugzilla.gnome.org/show_bug.cgi?id=766661
2016-05-20 17:09:33 +02:00
Guillaume Desmottes
2572e3d25c glmosaic: fix shader leak
gst_gl_mosaic_init_shader() is called twice with test_glmosaic so the
first shader was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=766661
2016-05-20 17:09:25 +02:00
Stefan Sauer
a1bf2e17cc lv2: support CVPorts
CVPorts are ports that take a buffer. For now we just fill the buffers with
the control value.
2016-05-18 21:33:43 -07:00
Stefan Sauer
c66d3906a4 lv2: use _OBJECT log variants and lower log level when processing 2016-05-18 21:33:43 -07:00
Stefan Sauer
b483717322 lv2: cleanup the predicates
Use the defines from the headers and get rid of our own namespace defines.
Replace the 'role' prop with 'designation'.
2016-05-15 23:31:33 -07:00
Stefan Sauer
63afc05c7f lv2: tweak enum logging
Log more details when we find a bad scalepoint and downgrade the logging of the
good enum valzes.
2016-05-15 23:27:22 -07:00
Stefan Sauer
04a957c9b8 lv2: generate enums from scalepoints
Plugins can provide a set of named values for a control port. Ideally only those
values are set for the property. Check if all scalepoints are integers and if so
generate an enum type.
2016-05-15 22:05:43 -07:00
Stefan Sauer
5aee046876 lv2: reduce log spam for property bounds
Only complain about bad bounds, if the plugin actually set those. Otherwise
silently adjust our defaults.
2016-05-15 19:45:26 -07:00
Stefan Sauer
e2184b2fc4 lv2: remove lv2_symbol_pred
We're not actually using it.
2016-05-15 17:58:51 -07:00
Stefan Sauer
78572e276d lv2: remove leftover FIME 2016-05-15 17:54:38 -07:00