Commit graph

21319 commits

Author SHA1 Message Date
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
Aaron Boxer
3dc3a915ea jpeg2000parse: Require either colorspace or sampling field in sink caps
And always set the sampling field on the src caps, if necessary guessing a
correct value for it from the colorspace field.

Also, did some cleanup: removed sampling enum - redundant.

https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-10 16:25:50 +03: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
Reynaldo H. Verdejo Pinochet
ea7c0981ec dvbsrc: unify exit paths on _start() 2016-06-09 14:45:59 -07:00
Reynaldo H. Verdejo Pinochet
33893c5242 dvbsrc: use proper acronym for PID (Packet Identifier)
Drop formatting tab from message while at it.
2016-06-09 14:45:59 -07:00
Reynaldo H. Verdejo Pinochet
c66f5080aa dvbsrc: set common PES filter params once and reuse
Avoid setting the same harcoded values over and over again.
2016-06-09 14:45:59 -07: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
Tim-Philipp Müller
c8b7585dce docs: fix for renamed dc1394 source file
https://bugzilla.gnome.org/show_bug.cgi?id=763026
2016-06-09 21:47:58 +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
Edward Hervey
deb686cfe1 adaptivedemux: Move SEEK handling to a separate function
Just for code readability. Doesn't change behaviour
2016-06-09 19:25:26 +03: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
Nicolas Dufresne
50537e2c08 vmncdec: 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:05:41 -04:00
Tim-Philipp Müller
4c874797b2 openjpeg: fix builddir != srcdir build, and distcheck 2016-06-07 14:15:41 +01:00
Aaron Boxer
fffee978c2 jpeg2000parse: Add JPEG2000 parser element
https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-07 15:29:41 +03: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
Jan Alexander Steffens (heftig)
851c89ded9 mpegtsmux: Set PTS on aligned buffers
This was broken in 09c05df (make "alignment" property more useful for
packetisation).

https://bugzilla.gnome.org/show_bug.cgi?id=765926
2016-06-07 15:11:00 +03:00
Alessandro Decina
a037f13271 vtdec: always drain in ::negotiate
Move calling gst_vtdec_push_frames_if_needed from ::set_format to ::negotiate so
that we always drain even when renegotiation is triggered by downstream.
2016-06-07 17:22:01 +10:00
Alessandro Decina
7fea17a476 vtdec: try to preserve downstream caps order
vtdec specifies sysmem; GLMemory as template caps. When negotiating, we used to
call gst_pad_peer_query_caps (..., filter) with our template caps as filter. The
query does gst_caps_intersect (filter, peercaps) internally which gives
precedence to the order of the filter caps. While we want to output sysmem by
default, when negotiating with glimagesink which returns GLMemory; sysmem; we
do want to do GL, so we now query using a NULL filter and intersect the result
with our template caps giving precedence to downstream's caps.

tl;dr: make sure we end up negotiating GLMemory with glimagesink
2016-06-07 17:13:12 +10:00
Xavier Claessens
26b66a1db5 ahcsrc: Avoid a div by 0 warning
https://bugzilla.gnome.org/show_bug.cgi?id=767302
2016-06-06 21:19:33 +03:00
Xavier Claessens
1ee15d1385 amcvideoenc: Do not call gst_object_unref on GstCaps
https://bugzilla.gnome.org/show_bug.cgi?id=767298
2016-06-06 17:53:01 +01:00
Edward Hervey
9296b26095 adaptivedemux: Set DISCONT on startup, resume and after seeks
Initial buffers after STREAM_START and seeks should always have the
DISCONT flag set.

https://bugzilla.gnome.org/show_bug.cgi?id=766650
2016-06-06 13:07:30 +03:00
Jan Schmidt
e3f5ccb333 tsdemux: Change the pad naming scheme to include a generation ID
A simple fix for the problem of creating new pads with duplicate
names when switching program, easier than the alternative of
trying to work out which pads might persist and manage that.

See https://bugzilla.gnome.org/show_bug.cgi?id=758454
2016-06-06 13:05:34 +03:00
Sebastian Dröge
a40ecc1168 player: pause() should not inhibit signals but work exactly like play()
https://bugzilla.gnome.org/show_bug.cgi?id=766607#c23
2016-06-06 11:13:00 +03:00
Reynaldo H. Verdejo Pinochet
bac5c4c5d2 dvbsrc: improve description of PIDs property 2016-06-03 16:28:47 -07:00
Edward Hervey
09e3bd0fb3 applemedia: Only use the OpenGL framework on OSX
It's not available on ios (uses OpenGLES already)

https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-06-03 07:11:55 +02:00
Guillaume Desmottes
991d9a6f5f gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2016-06-03 00:59:12 +01:00
Guillaume Desmottes
007c7f9b78 a2dpsink: unref avdtpsink if state transition failed
If for some reason the avdtpsink element can't go READY then the
gsta2dpsink can't either and so should release the ressources it
allocates when trying to do so.

Fix a leak with the generic/states test.

https://bugzilla.gnome.org/show_bug.cgi?id=767161
2016-06-03 00:51:32 +01:00
Havard Graff
f615a84646 applemedia: CGLTexImageIOSurface2D needs the OpenGL framework on OSX
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-06-02 22:42:22 +01:00
Havard Graff
ba06fc96b7 avsamplevideosink: check we are compiling for 10.1 up to 10.4
This API was deprecated in 10.4, so don't use it for 10.5 and onwards.

https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-06-02 22:41:54 +01:00
Heinrich Fink
ab70d79c43 applemedia: vtenc: Register a hardware-only vtenc_h264_hw element on OSX
Similar to vtdec_hw, this commit adds a vtenc_h264_hw element that fails
caps negotiation unless a hardware encoder could actually be acquired.
This is useful in situations where a fallback to a software encoder
other than the vtenc_h264 software encoder is desired (e.g. to x264enc).

https://bugzilla.gnome.org/show_bug.cgi?id=767104
2016-06-02 11:22:09 +03:00
Alessandro Decina
3d8d60baa8 vtdec: make vtdec_hw fallback to software on renegotiation
When renegotiating mid stream - for example with variable bitrate
streams - and therefore destroying and recreating VTSessions, the
hw decoder might become temporarily unavailable.

To deal with this and avoid erroring out on bitrate changes,
vtdec_hw now falls back to using the software decoder if the hw
one was available at some point but isn't anymore. At
renegotiation/bitrate change time, it will still retry to open
the hardware one.
2016-06-02 16:30:02 +10:00
Alessandro Decina
4a83686a57 vtdec: fix switching from GLMemory to Sysmem
When renegotiating from GLMemory to Sysmem do teardown the texture_cache.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=766190
2016-06-02 13:15:05 +10:00
Alessandro Decina
bf444301f9 vtdec: optimize renegotiation
::negotiate can be called several times before the CAPS event is sent downstream
so use the currently configured output state caps instead of the pad current
caps when deciding whether to recreate the VTSession or not.

This leads to creating/destroying less VTSessions which makes renegotiation more
reliable especially when using hw decoding.
2016-06-02 13:15:05 +10:00
Reynaldo H. Verdejo Pinochet
9e442d5cc0 dvbsrc: remove comment on self-explanatory code 2016-06-01 13:52:48 -07:00
Reynaldo H. Verdejo Pinochet
46de31d0f8 dvbsrc: avoid out-bound write on PID filter array
There's no need for an end-of-list marker in the filter
PIDs array if full, as the absolute maximum number of
elements (MAX_FILTERS) is known.

CID #1362441
2016-06-01 13:23:53 -07:00
Tim-Philipp Müller
889a1a9b90 androidmedia: fix error debug message when camera doesn't exist
Makes no sense to include the system error here since errno
will likely not be set and then it says 'system error: success'
which is confusing.

https://bugzilla.gnome.org/show_bug.cgi?id=767087
2016-05-31 20:41:14 +01:00
Justin Kim
fe62233b83 ahcsrc: release resources in 'finalize' function
In general, 'dispose' function is used for dropping all references
and 'finalize' is called for releasing instances.

https://bugzilla.gnome.org/show_bug.cgi?id=763309
2016-05-31 12:58:06 +01:00
Guillaume Desmottes
0467923415 player: inhibit signals after gst_player_stop() has been called
Also wait for the state change to STOP to have been announced before
destroying the player so it won't appear as leaked by leak detector
tools.

https://bugzilla.gnome.org/show_bug.cgi?id=766607
2016-05-30 12:43:22 +03:00
Guillaume Desmottes
b00f0d0180 player: handle uri-loaded in test
Had to adapt the existing tests because of this new callback.

https://bugzilla.gnome.org/show_bug.cgi?id=766607
2016-05-30 12:43:22 +03:00
Scott D Phillips
3edd641667 h265parse: Don't assume contiguous id's in make_codec_data
vps/sps/pps id's are not required to be used contiguously.

https://bugzilla.gnome.org/show_bug.cgi?id=766891
2016-05-30 12:42:24 +03:00
Reynaldo H. Verdejo Pinochet
1d8673af62 dvbsrc: add sample ATSC launch line 2016-05-29 23:31:05 -07:00
Havard Graff
63a05aff6a gl: glquery: cast to silence compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-05-28 22:28:06 +01: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
Havard Graff
45a832686b player: use correct _NONE enum
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2016-05-28 21:16:27 +01:00
Tim-Philipp Müller
1b58bbf3ad h264parser: maintain minimal ABI compat
Because we can.

https://bugzilla.gnome.org/show_bug.cgi?id=723352
2016-05-28 10:54:13 +01:00
Sebastian Dröge
b5f8b556e9 h264parser: Remove unused fps_num/fps_den fields
Instead the newly added function should be used to calculate
the framerate properly.

https://bugzilla.gnome.org/show_bug.cgi?id=723352
2016-05-28 10:54:01 +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
Reynaldo H. Verdejo Pinochet
e35bc2c2b4 dvbsrc: use single marker at end of filtering PID list
Avoids at least ~100 unneeded assignment operations at runtime
2016-05-26 16:18:56 -07:00