platform/upstream/gst-plugins-good.git
5 years agomatroskademux: no need to search for keyframes for intra-only streams
Tim-Philipp Müller [Wed, 15 Aug 2018 10:25:21 +0000 (11:25 +0100)]
matroskademux: no need to search for keyframes for intra-only streams

If the video streams are all I-frame only then we don't need to look
for a cluster with a keyframe, we can just assume there will be one.

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

5 years agomatroskademux: figure out if we have prev_size when starting up
Tim-Philipp Müller [Wed, 15 Aug 2018 00:10:32 +0000 (01:10 +0100)]
matroskademux: figure out if we have prev_size when starting up

This is useful to know in case someone initiates a seek or
direction change before we reach the second cluster.

5 years agomatroskademux: try to ensure keyframe when seeking without index
Tim-Philipp Müller [Wed, 8 Aug 2018 11:37:54 +0000 (12:37 +0100)]
matroskademux: try to ensure keyframe when seeking without index

When seeking in pull mode without an index (because there is no index
or the file is still being written to) we bisect to find the right
cluster to jump to. However, it's possible the cluster we found doesn't
start with a keyframe, which leads to decoding errors, so if we know
that the found cluster starts with a delta frame try to scan back to
previous clusters until we find one that starts with a keyframe or
we are back at the beginning. Theoretically it's possible that all
clusters but the first one do not start with a keyframe and the
keyframes are in the middle of clusters, but this is extremely
unusual, so we will cover this case with a basic sanity check.

This problem is especially problematic with content recorded with
dynamic GOP and FPS, where long GOP lengths and low FPS may cause a
large set of clusters to lack key frames. Playback would then be
started on a non-keyframe cluster, and the large number of such frames
would make the content impossible to decode fo a long stretch of time.

Based on patch by: Mats Lindestam <matslm@axis.com>

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

5 years agomatroskademux: extract cluster prevsize if available
Tim-Philipp Müller [Wed, 18 Jan 2017 10:27:38 +0000 (10:27 +0000)]
matroskademux: extract cluster prevsize if available

This is useful for reverse playback/trickmodes
without an index, and will also be useful in the
seek handler if we need to scan back to find a cluster
that starts with a keyframe.

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

5 years agov4l2bufferpool: Validate stride/offset when importing
Nicolas Dufresne [Wed, 25 Jul 2018 23:27:01 +0000 (19:27 -0400)]
v4l2bufferpool: Validate stride/offset when importing

This will prevent situation where buffer size allow importing but rendering
goes wrong due to a miss-match in expected stride and offset.

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

5 years agov4l2object: Add a method to try and import buffers
Nicolas Dufresne [Wed, 1 Aug 2018 17:07:52 +0000 (13:07 -0400)]
v4l2object: Add a method to try and import buffers

This method will check if a buffer, base on it's video meta,
can be imported. It will also try and adapt the request stride
in case this is the only that miss-match.

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

5 years agov4l2allocator: Trace the buffer index we import to
Nicolas Dufresne [Wed, 1 Aug 2018 16:07:20 +0000 (12:07 -0400)]
v4l2allocator: Trace the buffer index we import to

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

5 years agov4l2bufferpool: Fix typo in error message
Nicolas Dufresne [Thu, 26 Jul 2018 02:16:59 +0000 (22:16 -0400)]
v4l2bufferpool: Fix typo in error message

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

5 years agov4l2bufferpool: Only queue buffer if preparation worked
Nicolas Dufresne [Tue, 24 Jul 2018 16:07:22 +0000 (12:07 -0400)]
v4l2bufferpool: Only queue buffer if preparation worked

The preparation code imports the buffer, doing bunch of
validation. Only queue the buffer in the driver if the
importation worked. This way we don't rely on the driver
to validate.

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

5 years agov4l2object: Only allow DMABuf export for STREAMING device
Nicolas Dufresne [Tue, 24 Jul 2018 16:05:45 +0000 (12:05 -0400)]
v4l2object: Only allow DMABuf export for STREAMING device

DMABuf exportation requires mmap, which requires STREAMING
capabilities.

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

5 years agov4l2bufferpool: Activate the other pool first
Nicolas Dufresne [Fri, 13 Jul 2018 18:42:21 +0000 (14:42 -0400)]
v4l2bufferpool: Activate the other pool first

This change has no effect. We will need to acquire a buffer from the
pool later in order to validate / adapt with the video alignment for
the downstream buffers.

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

5 years agov4l2src: Simplify format handling
Nicolas Dufresne [Mon, 9 Jul 2018 19:33:02 +0000 (15:33 -0400)]
v4l2src: Simplify format handling

Always initially use try_format(), delaying set_format() to when the
allocation is being negotiated. This avoid having two code paths, and
will be help adding support for properly importing buffers of specific
strides and offsets.

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

5 years agomatroska: fix handling of FlagInterlaced
Tim-Philipp Müller [Thu, 23 Aug 2018 20:57:35 +0000 (22:57 +0200)]
matroska: fix handling of FlagInterlaced

This is an enum not a boolean, and a value of 2 signals
that the video is progressive, but we would mistakenly set
interlace-mode=mixed on the output caps.

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

5 years agov4l2object: complete colorspace info in debug log
Philipp Zabel [Thu, 9 Aug 2018 13:14:05 +0000 (15:14 +0200)]
v4l2object: complete colorspace info in debug log

The desired colorimetry is logged with all parameters (colorpsace,
range, matrix, and transfer function), but of the values actually
set by the driver, only colorspace is logged. Complete the debug
log message to display all colorimetry parameters:

  Desired colorspace is 8:1:1:1
  Got format of 640x480, format YU12, nb planes 1, colorspace 8

->

  Desired colorspace is 8:1:1:1
  Got format of 640x480, format YU12, nb planes 1, colorspace 8:0:0:0

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

5 years agov4l2object: fix typo in comment
Philipp Zabel [Thu, 9 Aug 2018 13:12:57 +0000 (15:12 +0200)]
v4l2object: fix typo in comment

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

5 years agov4l2object: improve colorspace handling for JPEG sources
Philipp Zabel [Thu, 9 Aug 2018 13:08:59 +0000 (15:08 +0200)]
v4l2object: improve colorspace handling for JPEG sources

gstjpegdec sets 1:4:0:0 colorimetry (full range BT.601 YCbCr encoding
with unknown primaries and unknown transfer function). This currently
gets translated to bt601 or bt709 depending on resolution.
Both cases result in a negotiation failure:

    ERROR: from element /GstPipeline:pipeline0/v4l2video0convert:v4l2video0convert0: Device '/dev/video0' does not support 1:4:0:0 colorimetry

Improve the guessing game by selecting JPEG colorimetry (JPEG colorspace
with sRGB transfer function) under these specific conditions, and loosen
the matching so that 1:4:0:0 input gets accepted if the device is
actually configured to 1:4:7:1 (V4L2_PIX_FMT_JPEG default).

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

5 years agov4l2object: stop V4L2 from zeroing extended colorimetry for non-mplane
Philipp Zabel [Thu, 9 Aug 2018 15:24:35 +0000 (17:24 +0200)]
v4l2object: stop V4L2 from zeroing extended colorimetry for non-mplane

Setting the priv field to a magic value stops V4L2 core from zeroing
the extended colorimetry fields quantization, ycbcr_enc, and xfer_func
for non-mplane queues.

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

5 years agov4l2: Remove a trailing whitespace
Zeeshan Ali [Sun, 19 Aug 2018 13:39:16 +0000 (15:39 +0200)]
v4l2: Remove a trailing whitespace

Otherwise, the latest gst-indent check doesn't pass.

5 years agomeson: add options to disable gobject cast checks and glib asserts
Tim-Philipp Müller [Sat, 18 Aug 2018 20:08:55 +0000 (21:08 +0100)]
meson: add options to disable gobject cast checks and glib asserts

... and define G_DISABLE_DEPRECATED for development versions,
like we do in autotools.

5 years agomeson: find libjpeg via pkg-config
Tim-Philipp Müller [Sat, 18 Aug 2018 20:01:52 +0000 (21:01 +0100)]
meson: find libjpeg via pkg-config

This effectively (but optionally) requires libjpeg-turbo which
ships with a .pc file and is what pretty much everyone these days
uses anyway for libjpeg, so shouldn't be a problem hopefully.

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

5 years agoudpsrc: Fix build when SO_RCVBUFFORCE is not defined
Nicolas Dufresne [Fri, 17 Aug 2018 21:35:43 +0000 (17:35 -0400)]
udpsrc: Fix build when SO_RCVBUFFORCE is not defined

This shoudl fix the mingw build.

5 years agoudpsrc: Balance Linux value of get/set_rcvbuf
Nicolas Dufresne [Fri, 17 Aug 2018 18:17:39 +0000 (14:17 -0400)]
udpsrc: Balance Linux value of get/set_rcvbuf

On Linux, the kernel returns twice the size as it will allocate extra
space for accouting. We devides this value by two in order to ensure
that get/set value now match. This fixes the set buffer size validation
and allow having a nice warning when the size if surpassed and the
process does not have CAP_NET_ADMIN capabilities.

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

5 years agoupdsrc: set udp buffer size forcibly
Guillaume Desmottes [Fri, 17 Aug 2018 12:05:04 +0000 (14:05 +0200)]
updsrc: set udp buffer size forcibly

The udp buffer size is limited to a maximum of around 100K.
Some apps need to set the force bufsize for their own operation.
Use the SO_RCVBUFFORCE option in order to override the rmem_max limit
of linux kernel. Require user to have the CAP_NET_ADMIN privilege to
work.

Original patch from Kyungnam Bae <kyungnam.bae@lge.com>

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

5 years agoudpsrc: factor out gst_udpsrc_get_rcvbuf()
Guillaume Desmottes [Fri, 17 Aug 2018 11:59:00 +0000 (13:59 +0200)]
udpsrc: factor out gst_udpsrc_get_rcvbuf()

No semantic change.

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

5 years agomeson: Rename caca option to libcaca
Nirbheek Chauhan [Fri, 17 Aug 2018 13:41:21 +0000 (19:11 +0530)]
meson: Rename caca option to libcaca

All options must match the plugin directory name.

5 years agomeson: Add build files for osxaudio, osxvideo, waveform
Nirbheek Chauhan [Fri, 17 Aug 2018 13:26:54 +0000 (18:56 +0530)]
meson: Add build files for osxaudio, osxvideo, waveform

osxaudio is for macOS and iOS
osxvideo is for macOS
waveform is for Windows

5 years agodocs: update for changes in master
Tim-Philipp Müller [Fri, 17 Aug 2018 13:44:26 +0000 (14:44 +0100)]
docs: update for changes in master

5 years agoexamples: dist qt examples
Tim-Philipp Müller [Fri, 17 Aug 2018 10:45:47 +0000 (11:45 +0100)]
examples: dist qt examples

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

5 years agomeson: Add an option for tests
Nirbheek Chauhan [Thu, 16 Aug 2018 18:57:59 +0000 (00:27 +0530)]
meson: Add an option for tests

This is needed because we don't always have gstreamer-check available,
for instance inside Cerbero on iOS.

5 years agomp4 robust muxing: improve documentation and logging
Mathieu Duponchelle [Thu, 16 Aug 2018 16:55:29 +0000 (18:55 +0200)]
mp4 robust muxing: improve documentation and logging

5 years agortph26*pay: Update param set timestamp even if parameters unchanged
Jan Alexander Steffens (heftig) [Tue, 3 Jul 2018 21:11:56 +0000 (23:11 +0200)]
rtph26*pay: Update param set timestamp even if parameters unchanged

rtph264pay and rtph265pay skip updating the parameter set timestamp if
the units they see contain no new configuration. This can result in
them injecting duplicate parameters.

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

5 years agortspsrc: Add support for SET_PARAMETER and GET_PARAMETER using signals
Ulf Olsson [Wed, 15 Aug 2018 11:43:53 +0000 (13:43 +0200)]
rtspsrc: Add support for SET_PARAMETER and GET_PARAMETER using signals

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

5 years agosplitmuxsink: Don't leak old muxer/sink in async mode
Jan Schmidt [Tue, 14 Aug 2018 16:28:20 +0000 (02:28 +1000)]
splitmuxsink: Don't leak old muxer/sink in async mode

Make sure to clear the reference taken earlier in the function
when switching muxer/sink asynchronously so they don't leak

5 years agosplitmuxsink: Fix reference counting loop
Jan Schmidt [Tue, 14 Aug 2018 16:10:25 +0000 (02:10 +1000)]
splitmuxsink: Fix reference counting loop

The stream context was holding a reference to the
internal queue and pads, with pad probes that were
in turn holding references to the stream context.

This lead to a leak if the request pads weren't explicitly
released.

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

5 years agoaacparse: fix codec_data buffer leak
Roland Jon [Sat, 11 Aug 2018 08:45:25 +0000 (16:45 +0800)]
aacparse: fix codec_data buffer leak

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

5 years agoqtdemux: Handle closed captions as subtitle streams
Sebastian Dröge [Thu, 2 Aug 2018 13:12:45 +0000 (16:12 +0300)]
qtdemux: Handle closed captions as subtitle streams

5 years agov4l2src: fix first input used is always used next times
Iñigo Huguet [Thu, 2 Aug 2018 06:40:17 +0000 (08:40 +0200)]
v4l2src: fix first input used is always used next times

The input from an v4l2 device that was used the first time was
remembered for next times, and set again always the pipeline is
set to READY state. This was making that users wasn't able to
select a different input without having to create a new pipeline.

This patch makes that v4l2src element forget previous used input
when going to NULL state, so it will check again for the current
selected input when going again to READY state. Users can change
to NULL state, select a new input with a VIDIOC_S_INPUT ioctl
and change to PLAYING again.

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

5 years agoqtmux: The sample size we have to reserve is 256+8 bytes for the header for CDP packets
Sebastian Dröge [Thu, 2 Aug 2018 10:40:09 +0000 (13:40 +0300)]
qtmux: The sample size we have to reserve is 256+8 bytes for the header for CDP packets

5 years agoqtmux: Properly allocate 256 bytes per CDP packet in prefill mode
Sebastian Dröge [Thu, 2 Aug 2018 09:27:45 +0000 (12:27 +0300)]
qtmux: Properly allocate 256 bytes per CDP packet in prefill mode

Instead of allowing 256 but only pre-allocating 100.

5 years agoRevert "qtmux: Allow for CDP packets up to 320 bytes"
Sebastian Dröge [Thu, 2 Aug 2018 09:27:17 +0000 (12:27 +0300)]
Revert "qtmux: Allow for CDP packets up to 320 bytes"

This reverts commit 5eed1d49bdb7e7a632c7135656c482ed38a6ac2a.

255 is actually the maximum, there's a bug if more is arriving.

5 years agoqtmux: Allow for CDP packets up to 320 bytes
Sebastian Dröge [Wed, 1 Aug 2018 13:50:03 +0000 (16:50 +0300)]
qtmux: Allow for CDP packets up to 320 bytes

Apparently they can be bigger than 256 bytes sometimes.

5 years agortppayload: Fix VP8/VP9/OPUS dual encoding name handling
Nicolas Dufresne [Sat, 14 Jul 2018 02:31:04 +0000 (22:31 -0400)]
rtppayload: Fix VP8/VP9/OPUS dual encoding name handling

All these were copy pasted and would lead to assertion when chained with
rtpmux. This commit rewrite the negotiation with downstream. This also
drop the fallback to ancient names if the pad is unlinked. This was
completly arbitrary decision that made no sense.

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

5 years agoqt: Ensure GL headers are included
Matthew Waters [Wed, 1 Aug 2018 02:06:23 +0000 (12:06 +1000)]
qt: Ensure GL headers are included

Otherwise there may be no valid typedef of GLsync.

...
/usr/include/gstreamer-1.0/gst/gl/gstglfuncs.h:93:24: note: in definition of macro 'GST_GL_EXT_FUNCTION'
   ret (GSTGLAPI *name) args;
                        ^~~~
/usr/include/gstreamer-1.0/gst/gl/glprototypes/sync.h:33:23: error: 'GLsync' has not been declared
                      (GLsync sync))
                       ^~~~~~
...

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

5 years agomeson: Fix oss4 header checks
Nirbheek Chauhan [Tue, 31 Jul 2018 21:48:58 +0000 (03:18 +0530)]
meson: Fix oss4 header checks

Otherwise, oss4 ends up getting built when force-disabled.

5 years agomeson: Fix missing variable in v4l2 build
Nirbheek Chauhan [Tue, 31 Jul 2018 19:40:49 +0000 (01:10 +0530)]
meson: Fix missing variable in v4l2 build

5 years agoqtdemux: Don't assert in prefill mode if a track has no samples at all
Sebastian Dröge [Tue, 31 Jul 2018 09:47:47 +0000 (12:47 +0300)]
qtdemux: Don't assert in prefill mode if a track has no samples at all

Just write it with a duration of 0, no samples, etc.

5 years agoqtdemux: Don't assert if a file does not have any active streams
Sebastian Dröge [Tue, 31 Jul 2018 09:33:54 +0000 (12:33 +0300)]
qtdemux: Don't assert if a file does not have any active streams

** (gst-play-1.0:9113): CRITICAL **: 12:31:54.360: qtdemux_is_streams_update: assertion 'qtdemux->active_streams != NULL' failed

5 years agoqtmux: Reserve 256 bytes for CDP packets in pre-fill mode
Sebastian Dröge [Mon, 30 Jul 2018 10:33:28 +0000 (13:33 +0300)]
qtmux: Reserve 256 bytes for CDP packets in pre-fill mode

92 is sometimes too small and compared to the wasted space for other
codecs 256 bytes is small (and should be the maximum CDP packet size)

5 years agomeson: Add feature options for all plugins
Nirbheek Chauhan [Wed, 25 Jul 2018 02:05:28 +0000 (07:35 +0530)]
meson: Add feature options for all plugins

Checks for GL, Qt5, and C++ are still automagic. FIXMEs have been
added for these so they can be fixed later.

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

5 years agodeinterlace: Closed caption pass-through
Vivia Nikolaidou [Wed, 25 Jul 2018 14:15:53 +0000 (17:15 +0300)]
deinterlace: Closed caption pass-through

Pass through closed caption data when deinterlacing. When two
deinterlaced frames are created for the same interlaced frame (e.g.
fields=all), the second of the two frames will have no closed caption
data.

Also fixed memory leaks related to timecode meta pass-through.

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

5 years agoqtmux: Implement muxing of AV1 into MP4 files
Olivier Crête [Wed, 25 Jul 2018 22:37:48 +0000 (18:37 -0400)]
qtmux: Implement muxing of AV1 into MP4 files

According to
https://aomediacodec.github.io/av1-isobmff/

5 years agomatroskamux: Put codec_data as CodecPrivate for AV1
Olivier Crête [Wed, 25 Jul 2018 21:09:06 +0000 (17:09 -0400)]
matroskamux: Put codec_data as CodecPrivate for AV1

5 years agomatroskamux: Accept muxing AV1
Olivier Crête [Wed, 25 Jul 2018 21:08:53 +0000 (17:08 -0400)]
matroskamux: Accept muxing AV1

5 years agoqtdemux: Recognize more AV1 atoms
Olivier Crête [Wed, 25 Jul 2018 20:51:38 +0000 (16:51 -0400)]
qtdemux: Recognize more AV1 atoms

5 years agomatroskademux: Extract codec_data for AV1
Olivier Crête [Wed, 25 Jul 2018 20:39:18 +0000 (16:39 -0400)]
matroskademux: Extract codec_data for AV1

According to
https://github.com/Matroska-Org/matroska-specification/blob/av1-mappin/codec/av1.md

5 years agoqtdemux: Extract AV1 codec_data and put it in the caps
Olivier Crête [Wed, 25 Jul 2018 18:31:39 +0000 (14:31 -0400)]
qtdemux: Extract AV1 codec_data and put it in the caps

Also extract the presentation-delay and put it in the caps.

5 years agoqtdemux: Add initial support for AV1 demuxing
Olivier Crête [Wed, 25 Jul 2018 14:43:11 +0000 (10:43 -0400)]
qtdemux: Add initial support for AV1 demuxing

Following the spec at
https://aomediacodec.github.io/av1-isobmff/

5 years agortspsrc: Add a small configurable teardown delay
Jan Schmidt [Thu, 26 Jul 2018 14:41:57 +0000 (00:41 +1000)]
rtspsrc: Add a small configurable teardown delay

This causes rtspsrc to send a teardown and wait on
PAUSED->READY transition, with a configurable delay.
Otherwise, typically teardown never gets sent in
playbin / uridecodebin where the transition back to NULL
happens too quickly.

The timeout is set to 100ms default.

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

5 years agortpgstpay: Add support for force-keyunit events
Sebastian Dröge [Thu, 26 Jul 2018 13:43:28 +0000 (16:43 +0300)]
rtpgstpay: Add support for force-keyunit events

This triggers immediate re-sending of the configuration data in-band.

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

5 years agortp: Use running_time instead of PTS for config-interval calculations
Sebastian Dröge [Fri, 13 Jul 2018 16:45:19 +0000 (19:45 +0300)]
rtp: Use running_time instead of PTS for config-interval calculations

PTS can start again from a different offset while the running time is
increasing. The only thing that matters here is the running time.

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

5 years agoexample: Build GTK and GTK GL example code
Nicolas Dufresne [Fri, 20 Jul 2018 02:48:34 +0000 (22:48 -0400)]
example: Build GTK  and GTK GL example code

5 years agortpL8pay: don't try to modify a read-only structure
Michael Olbrich [Thu, 19 Jul 2018 15:31:03 +0000 (17:31 +0200)]
rtpL8pay: don't try to modify a read-only structure

Just remove the code. It's not doing anything useful anyways. The modified
caps are the result of a caps query, so either not used afterwards of a
reference to some internal caps of another element that should not be
modified.

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

5 years agoqmlgl: Fix conflicting declaration of type GLsync for non-android
Iñigo Huguet [Tue, 17 Jul 2018 06:23:54 +0000 (08:23 +0200)]
qmlgl: Fix conflicting declaration of type GLsync for non-android

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

5 years agodeinterlace: Timecode pass-through
Vivia Nikolaidou [Mon, 16 Jul 2018 16:03:39 +0000 (19:03 +0300)]
deinterlace: Timecode pass-through

When it is trivial to pass-through a timecode, by only removing the
"interlaced" flag, do pass-through. Otherwise, double the fps_n and
adjust the "frames" field.

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

5 years agosplitmux: Improve handling of repeated timestamps
Jan Schmidt [Mon, 16 Jul 2018 14:03:19 +0000 (00:03 +1000)]
splitmux: Improve handling of repeated timestamps

When handling input with timestamps that repeat, sometimes
splitmuxsink would get confused and ignore a keyframe.

The logic in question is a holdover from before the cmd queue
moved the file cutting to the multiqueue output side and made
it deterministic, so it's no longer needed on the input
here.

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

5 years agoRevert "splitmuxsrc: Make sure events are writable"
Jan Schmidt [Mon, 16 Jul 2018 15:33:55 +0000 (01:33 +1000)]
Revert "splitmuxsrc: Make sure events are writable"

This reverts commit 3ac5430311b20f30814cdabf5724fb687748bb5b.

There's no need to make a freshly created event writable,
and the other half of this patch was already fixed
and pushed in f2f15a1

5 years agosplitmuxsrc: Make sure events are writable
Jan Schmidt [Mon, 16 Jul 2018 13:43:29 +0000 (23:43 +1000)]
splitmuxsrc: Make sure events are writable

Before setting the seqnum on events sent downstream,
make sure they are writable.

5 years agov4l2bufferpool: Validate that capture buffers were queued
Nicolas Dufresne [Fri, 13 Jul 2018 20:51:24 +0000 (16:51 -0400)]
v4l2bufferpool: Validate that capture buffers were queued

When the pool is started, we allocate and release buffer, expecting
the pool release-buffer handler to queue them. Though, as we rely
on release function, there is no direct way to detect that this
process didn't work.

To check this, validate that the number of queued buffer is the same
as the number of allocated buffers. This allow returning an error
when buffer importation was refused by the driver.

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

5 years agov4l2bufferpool: Only return eos for M2M devices
Nicolas Dufresne [Fri, 13 Jul 2018 20:02:02 +0000 (16:02 -0400)]
v4l2bufferpool: Only return eos for M2M devices

This will avoid sending EOS on v4l2src when a driver sends an empty
buffers. This case would be a bug in the driver, but yet the camera
should keep running.

This also removes the check for corrupted buffers, as this check is
already done later.

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

5 years agov4l2: Add a macro to check for M2M
Nicolas Dufresne [Fri, 13 Jul 2018 19:58:36 +0000 (15:58 -0400)]
v4l2: Add a macro to check for M2M

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

5 years agov4l2allocator: Fix userptr importation
Nicolas Dufresne [Fri, 13 Jul 2018 18:41:13 +0000 (14:41 -0400)]
v4l2allocator: Fix userptr importation

The length passed to the driver was always 0 instead of the size of
the memory. This would fail validation in videobuf2.

5 years agov4l2bufferpool: Remove duplicate check
Nicolas Dufresne [Thu, 12 Jul 2018 19:11:39 +0000 (15:11 -0400)]
v4l2bufferpool: Remove duplicate check

We were calling gst_v4l2_is_buffer_valid() before and inside
gst_v4l2_buffer_pool_qbuf() as we needed to access the group. The second
check failed since the writability of the buffer get inherited from the
GstMemory, which lead to pipeline failure. As we cannot avoid the extra
ref, it would be racy otherwise, just pass the group to _dbuf() so it
does not have to call gst_v4l2_is_buffer_valid() again.

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

5 years agortpsession: Don't start the RTCP thread until it's needed
Havard Graff [Fri, 25 Aug 2017 09:58:12 +0000 (11:58 +0200)]
rtpsession: Don't start the RTCP thread until it's needed

Always wait with starting the RTCP thread until either a RTP or RTCP
packet is sent or received. Special handling is needed to make sure the
RTCP thread is started when requesting an early RTCP packet.

We want to wait with starting the RTCP thread until it's needed in order
to not send RTCP packets for an inactive source.

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

5 years agov4l2src: Try to avoid TRY_FMT when camera is streaming
Nicolas Dufresne [Wed, 11 Jul 2018 16:21:44 +0000 (12:21 -0400)]
v4l2src: Try to avoid TRY_FMT when camera is streaming

Some camera firmware crash is TRY_FMT is called during streaming. As a
side effect. This try and detect that the same format as currently
running is about to be tried, and skip renegotiation.

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

5 years agov4l2videodec: Protect double calls to set_format()
Nicolas Dufresne [Mon, 9 Jul 2018 17:59:02 +0000 (13:59 -0400)]
v4l2videodec: Protect double calls to set_format()

In some cases, set_format() may get called twice before the output
format is set. Running an allocation query in this case is both not
needed and will cause assertion due tot he NULL caps.

5 years agoscaletempo: Mark as Audio in classification
Thibault Saunier [Mon, 9 Jul 2018 00:08:18 +0000 (20:08 -0400)]
scaletempo: Mark as Audio in classification

5 years agoqtdemux: Store and propagate SEGMENT sequence numbers
Edward Hervey [Fri, 6 Jul 2018 13:21:33 +0000 (15:21 +0200)]
qtdemux: Store and propagate SEGMENT sequence numbers

* When receiving a segment in TIME, use that seqnum
* Only reset the stored sequence number when doing HARD reset
  (and not when we get a FLUSH event from upstream)

5 years agov4l2transform: Implement stable element name
Michael Tretter [Sun, 1 Jul 2018 19:27:32 +0000 (15:27 -0400)]
v4l2transform: Implement stable element name

The first converter to be found will now gain the name v4l2convert.
Other converters will be named after the m2m dev node end point they are
attached to.

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

5 years agomatroskademux: Set subtitle tag title from TrackName field
Philippe Normand [Wed, 13 Jun 2018 16:39:57 +0000 (17:39 +0100)]
matroskademux: Set subtitle tag title from TrackName field

GUI applications can then use the title tag to set menu items or labels
representing the track.

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

5 years agov4l2videoenc: Only renegotiate with upstream
Nicolas Dufresne [Thu, 28 Jun 2018 23:08:35 +0000 (19:08 -0400)]
v4l2videoenc: Only renegotiate with upstream

When the decoder get linked further, it will receive a renegotiation
event from downstream. This case is not supported and should be ignored.

This fixes issues when this encoder is used inside an GstRtspServer
pipeline.

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

5 years agoqtdemux: rework segment event pushing, again
Alicia Boya García [Sat, 9 Jun 2018 21:58:01 +0000 (23:58 +0200)]
qtdemux: rework segment event pushing, again

This patch aims at fixing the recent regressions in the adaptive test
suite.

All segment pushing in push mode is now done with
gst_qtdemux_check_send_pending_segment(), which is idempotent and
handles both edit lists cases and cases where the upstream TIME segments
have to be sent directly.

Fragmented files that start with a non-zero tfdt are also taken into
account, but their handling has been vastly simplified: now they are
handled as implicit default seeks so there is no need to extend the
GstSegment formulas as was being done before.

qtdemux->segment.duration is no longer modified when
upstream_format_is_time, respecting in this way the durations provided
by dashdemux and fixing bugs in reverse playback tests where mangled
durations appeared in the emitted segments.

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

5 years agoqtdemux: Don't send EOS during upstream reverse playback
Alicia Boya García [Sun, 17 Jun 2018 00:01:59 +0000 (02:01 +0200)]
qtdemux: Don't send EOS during upstream reverse playback

Upstream driving elements such as dashdemux often do reverse playback by
feeding qtdemux with the fragments containing the requested playback
range in reverse order.

But the requested playback range stop may be somewhere in the
middle of a fragment. In that case, a naive pts >= segment.stop
condition may declare end of segment prematurely when demuxing this
first fragment.

This used not to happen because there were places in moov parsing where
segment.stop was overwritten to GST_CLOCK_TIME_NONE even if
upstream_format_is_time -- resulting in this case in a segment with rate
< 0 and stop == -1 and hence not triggering the EOS check, but that was
likely an accident.

This patch modifies the EOS check to take this case into account, not
sending EOS when upstream_format_is_time if rate < 0.

This fixes adaptive.dash.playback.seek_end_live.DASHIF_livestream_testpic_2s

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

5 years agov4l2transform: fold property set/get PROP_OUTPUT_IO_MODE case into default
Peter Seiderer [Tue, 6 Feb 2018 12:51:14 +0000 (13:51 +0100)]
v4l2transform: fold property set/get PROP_OUTPUT_IO_MODE case into default

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

5 years agov4l2videoenc: Don't set colorimetry on capture
Nicolas Dufresne [Fri, 22 Jun 2018 14:56:31 +0000 (14:56 +0000)]
v4l2videoenc: Don't set colorimetry on capture

The colorimetry will be set along with the raw format and those fields
will then be copied from sink to src caps by the gst encoder.

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

5 years agov4l2object: Really always set colorimetry
Nicolas Dufresne [Wed, 27 Jun 2018 20:57:29 +0000 (16:57 -0400)]
v4l2object: Really always set colorimetry

This fixes patch dd1c5aed656e07e3dad01f83410f3af16cfb14cf which
pretended to always set colorimetry but the patch was incomplete.
This is again best effort considering the spec says that for CAPTURE
you may only read this value.

5 years agov4l2videodec: do not call streamon while pool is flushing
Michael Tretter [Tue, 26 Jun 2018 13:04:39 +0000 (15:04 +0200)]
v4l2videodec: do not call streamon while pool is flushing

gst_v4l2_buffer_pool_flush() executes streamoff for the output, but
streamoff->streamon for the capture of the decoder.
gst_v4l2_buffer_pool_streamon() on capture assumes that is able to
resurrect the buffers from the pool, but acquiring buffers fails if the
buffer pool is still flushing.

The decoder needs to stop flushing the pools before calling
gst_v4l2_buffer_pool_flush() to restart the v4l2 device. Otherwise
starting the decoding thread might fail, because there are no buffers in
the capture pool.

This fixes a regression that was introduced in 97985a335c78
("v4l2videodec: Add dynamic resolution change support").

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

5 years agov4l2object: use S_SELECTION instead of S_CROP in gst_v4l2_object_set_crop
Philipp Zabel [Mon, 25 Jun 2018 14:03:17 +0000 (16:03 +0200)]
v4l2object: use S_SELECTION instead of S_CROP in gst_v4l2_object_set_crop

The S_CROP call doesn't work on mem2mem output queues. Use the
S_SELECTION call to set the crop rectangle and only fall back to
S_CROP for ancient kernels.
This will allow v4l2videoenc to set the coded size on the output
queue via S_FMT and then set the visible size via the crop rectangle,
as required by the V4L2 codec API.

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

5 years agov4l2videoenc: activate capture pool after output pool
Marian Mihailescu [Wed, 27 Jun 2018 13:46:00 +0000 (13:46 +0000)]
v4l2videoenc: activate capture pool after output pool

Some drivers need output buffers set before capture buffers.
CODA cannot set output format if capture is streaming.
Exynos MFC fails on output STREAMON if capture is already streaming.
This patch delays capture activation until output is configured and
streaming

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

5 years agoUpdate for g_type_class_add_private() deprecation in recent GLib
Tim-Philipp Müller [Sat, 23 Jun 2018 21:44:19 +0000 (23:44 +0200)]
Update for g_type_class_add_private() deprecation in recent GLib

https://gitlab.gnome.org/GNOME/glib/merge_requests/7

5 years agosouphttpsrc: Protect input stream with lock
Edward Hervey [Wed, 20 Jun 2018 08:03:59 +0000 (10:03 +0200)]
souphttpsrc: Protect input stream with lock

This was the last remaining place where modifying/unreffing the
input stream was not protected by the lock

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

6 years agosplitmuxsrc: Make sure events are writable before setting their seqnum
Sebastian Dröge [Mon, 18 Jun 2018 09:13:48 +0000 (12:13 +0300)]
splitmuxsrc: Make sure events are writable before setting their seqnum

6 years agov4l2bufferpool: Drop truncated frames
Nicolas Dufresne [Mon, 28 May 2018 19:19:52 +0000 (15:19 -0400)]
v4l2bufferpool: Drop truncated frames

Drop truncated frames regardless if they have the ERROR flag or not.
Truncated frame causes video frame map failure in many elements
including cluttersink, glupload etc.

6 years agov4l2bufferpool: Try return input buffer soon
Nicolas Dufresne [Mon, 2 Apr 2018 16:59:33 +0000 (12:59 -0400)]
v4l2bufferpool: Try return input buffer soon

In this patch we use a non-blocking poll in order to return all input
buffers (buffers from v4l2-output queue). This prevent holding too long
on upstreaming buffer in importing.

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

6 years agoqt: also check for un-suffixed moc
Matthew Waters [Thu, 7 Jun 2018 03:56:03 +0000 (13:56 +1000)]
qt: also check for un-suffixed moc

e.g. Qt windows installer doesn't have suffixes

6 years agoqtdemux: Do not set INVALID seqnum on events
Thibault Saunier [Wed, 6 Jun 2018 15:44:33 +0000 (11:44 -0400)]
qtdemux: Do not set INVALID seqnum on events

6 years agotests: qtdemux: Add checking exposed segment event
Seungha Yang [Fri, 1 Jun 2018 13:47:10 +0000 (22:47 +0900)]
tests: qtdemux: Add checking exposed segment event

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

6 years agoqtdemux: Forward upstream time-format segment without mapping
Seungha Yang [Fri, 1 Jun 2018 12:08:10 +0000 (21:08 +0900)]
qtdemux: Forward upstream time-format segment without mapping

Sample table based segment event (genereted by qtdemux) could break
presentation timeline. For example, qtdemux should not modify upstream
time format segment (e.g., adaptivedemux use case)

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

6 years agortspsrc: Seek handling is always done with a valid event
Edward Hervey [Thu, 19 Apr 2018 06:14:47 +0000 (08:14 +0200)]
rtspsrc: Seek handling is always done with a valid event

Remove the checks

6 years agowavparse: Don't set invalid seqnum on events
Edward Hervey [Wed, 6 Jun 2018 05:46:54 +0000 (07:46 +0200)]
wavparse: Don't set invalid seqnum on events

Some codepath will call gst_wavparse_perform_seek without an event
and therefore without a valid seqnum

6 years agoqtdemux: Clarify field name about stream-encryption-system
Thibault Saunier [Fri, 25 May 2018 10:28:04 +0000 (12:28 +0200)]
qtdemux: Clarify field name about stream-encryption-system

This field is actually only informatory and the user can potentially
choose something else. EME tests in WebKit testsuite actually doesn't
take it into and force another encryption system to be used, and expects
to be given the occasion to do so.

This basically also reverts 3e063703b3a51b8aaa7f75f36c4660c583a60e93.