platform/upstream/gstreamer.git
4 years agodeinterlace: Support packed formats for YADIF
Vivia Nikolaidou [Tue, 5 May 2020 13:59:56 +0000 (16:59 +0300)]
deinterlace: Support packed formats for YADIF

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/444>

4 years agodeinterlace: Call the planar functions for the Y plane of nv12/nv21
Vivia Nikolaidou [Wed, 6 May 2020 08:04:18 +0000 (11:04 +0300)]
deinterlace: Call the planar functions for the Y plane of nv12/nv21

In some algorithms (like yadif), the Y plane has to be handled different
than the UV plane. Therefore, the planar_y functions are now called for
the Y plane, and the nv12/nv21 functions are handling only the UV/VU
planes respectively.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/444>

4 years agodeinterlace: Add C implementation of YADIF
Jan Schmidt [Thu, 2 Jan 2020 15:34:59 +0000 (02:34 +1100)]
deinterlace: Add C implementation of YADIF

Import the YADIF deinterlacer from ffmpeg and modify
it to match the simple deinterlace scanlines structure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/444>

4 years agodeinterlace: Allow for 5 fields for interpolation
Jan Schmidt [Thu, 2 Jan 2020 15:33:25 +0000 (02:33 +1100)]
deinterlace: Allow for 5 fields for interpolation

Add an extra field to the simple deinterlace implementation,
so that methods can potentially use 5 fields - the current
field, and 2 before and 2 after.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/444>

4 years agodeinterlace: Force renegotiation when changing mode
Jan Schmidt [Wed, 6 May 2020 15:17:25 +0000 (01:17 +1000)]
deinterlace: Force renegotiation when changing mode

Switching the deinterlacing mode on-the-fly from disabled to
auto used to work, but was broken by commit #1f21747c some
years ago.

Force re-negotiation with downstream when the mode or
fields properties are changed, otherwise deinterlace
never switches out of the passthrough mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/584>

4 years agojpegenc: remove meta copy in jpegenc
nian.yan [Thu, 23 Apr 2020 07:32:58 +0000 (15:32 +0800)]
jpegenc: remove meta copy in jpegenc

GstVideoEncoder takes care of the Meta copy, so there is no need in
jpegenc

Fixes http://gstreamer-devel.966125.n4.nabble.com/jpegenc-copy-GstMeta-twice-tt4693981.html

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/576>

4 years agoimagefreeze: Handle flushing correctly
Sebastian Dröge [Tue, 5 May 2020 14:47:28 +0000 (17:47 +0300)]
imagefreeze: Handle flushing correctly

First of all get rid of the atomic seeking boolean, which was only ever
set and never read. Replace it with a flushing boolean that is used in
the loop function to distinguish no buffer because of flushing and no
buffer because of an error as otherwise we could end up in a
GST_FLOW_ERROR case during flushing.

Also only reset the state of imagefreeze in flush-stop when all
processing is stopped instead of doing it as part of flush-start.

And last, get a reference to the imagefreeze buffer in the loop function
in the very beginning and work from that as otherwise it could in theory
be replaced or set to NULL in the meantime as we release and re-take the
mutex a couple of times during the loop function.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/580>

4 years agovidebox: Use MIN instead of CLAMP for uint
Edward Hervey [Wed, 6 May 2020 04:48:24 +0000 (06:48 +0200)]
videbox: Use MIN instead of CLAMP for uint

an unsigned int is always positive.

CID #206207
CID #206208
CID #206209
CID #206210
CID #206211

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/583>

4 years agoavidemux: Avoid potential double-free
Edward Hervey [Wed, 6 May 2020 04:35:27 +0000 (06:35 +0200)]
avidemux: Avoid potential double-free

stream->name was being freed (without being NULL-ed) before we were certain it
would be set again.

CID #1456071

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/582>

4 years agodeinterlace: Don't leak frame in error case
Edward Hervey [Tue, 5 May 2020 15:30:48 +0000 (17:30 +0200)]
deinterlace: Don't leak frame in error case

CID #1455494

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/581>

4 years agoslitmuxsrc: Properly stop the loop if not part reader is present
Edward Hervey [Tue, 5 May 2020 13:19:49 +0000 (15:19 +0200)]
slitmuxsrc: Properly stop the loop if not part reader is present

Previously this would end up in a refcounting loop of hell.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/578>

4 years agoflvmux: Add skip-backwards-streams property
Vivia Nikolaidou [Tue, 31 Mar 2020 11:32:19 +0000 (14:32 +0300)]
flvmux: Add skip-backwards-streams property

Backwards timestamps confuse librtmp, even if they're only backwards
relative to the other stream. If the timestamp of a stream is going
backwards related to the other stream, this property allows the muxer to
skip a few buffers until it reaches the timestamp of the other stream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/572>

4 years agoflvmux: Allow requesting streamable pads after header is written
Vivia Nikolaidou [Tue, 31 Mar 2020 11:10:35 +0000 (14:10 +0300)]
flvmux: Allow requesting streamable pads after header is written

Allows us to request pads after writing header for streamable flv's.

For non-streamable it doesn't make sense to request a new pad after
writing the header, because the headers have been written already and we
can't add the new stream. But for streamable, any clients that connect
after the new pad has been added will be able to see both streams.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/572>

4 years agoqt/x11: also pass the window for gstgl -> qt context
Matthew Waters [Mon, 27 Apr 2020 08:11:32 +0000 (18:11 +1000)]
qt/x11: also pass the window for gstgl -> qt context

Removes this warning from Qt:

QGLXContext: Multiple configs for FBConfig ID -1
QSGContext::initialize: depth buffer support missing, expect rendering errors

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/575>

4 years agoqt: perform surface creation in the main thread
Matthew Waters [Mon, 27 Apr 2020 05:34:15 +0000 (15:34 +1000)]
qt: perform surface creation in the main thread

As is required when creating a QWindow instance set out in the Qt
documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/575>

4 years agoqtdemux: Add 'mp3 ' fourcc that VLC seems to produce now
Olivier Crête [Wed, 22 Apr 2020 19:32:31 +0000 (15:32 -0400)]
qtdemux: Add 'mp3 ' fourcc that VLC seems to produce now

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/574>

4 years agortpjitterbuffer: Properly free internal packets queue in finalize()
Sebastian Dröge [Wed, 22 Apr 2020 11:09:37 +0000 (14:09 +0300)]
rtpjitterbuffer: Properly free internal packets queue in finalize()

As we override the GLib item with our own structure, we cannot use any
function from GList or GQueue that would try to free the RTPJitterBufferItem.
In this patch, we move away from g_queue_new() which forces using
g_queue_free(). This this function could use g_slice_free() if there is any items
left in the queue. Passing the wrong size to GSLice may cause data corruption
and crash.

A better approach would be to use a proper intrusive linked list
implementation but that's left as an exercise for the next person
running into crashes caused by this.

Be ware that this regression was introduced 6 years ago in the following
commit [0], the call to flush() looked useless, as there was a g_queue_free()
afterward.

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
[0] https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/commit/479c7642fd953edf1291a0ed4a3d53618418019c

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/573>

4 years agotests: splitmuxsink: Add more timecode based split test
Seungha Yang [Mon, 20 Apr 2020 10:43:57 +0000 (19:43 +0900)]
tests: splitmuxsink: Add more timecode based split test

... and split test cases to run tests in parallel

4 years agosplitmuxsink: Enhancement for timecode based split
Seungha Yang [Fri, 10 Apr 2020 14:52:45 +0000 (23:52 +0900)]
splitmuxsink: Enhancement for timecode based split

The calculated threshold for timecode might be varying depending on
"max-size-timecode" and framerate.
For instance, with framerate 29.97 (30000/1001) and
"max-size-timecode=00:02:00;02", every fragment will have identical
number of frames 3598. However, when "max-size-timecode=00:02:00;00",
calculated next keyframe via gst_video_time_code_add_interval()
can be different per fragment, but this is the nature of timecode.
To compensate such timecode drift, we should keep track of expected
timecode of next fragment based on observed timecode.

4 years agosplitmuxsink: Post error when requested timecode interval is invalid
Seungha Yang [Fri, 10 Apr 2020 15:35:16 +0000 (00:35 +0900)]
splitmuxsink: Post error when requested timecode interval is invalid

In case we cannot rely on max-size-timecode for split decision,
post error instead of crashing

4 years agortpjitterbuffer: don't use RTX packets in rate-calc and reset-logic
Havard Graff [Thu, 16 Apr 2020 14:47:50 +0000 (16:47 +0200)]
rtpjitterbuffer: don't use RTX packets in rate-calc and reset-logic

The problem was this:

Due to the highly irregular arrival of RTX-packet the max-misorder variable
could be pushed very low. (-10).

If you then at some point get a big in the sequence-numbers (62 in the
test) you end up sending RTX-requests for some of those packets, and then
if the sender answers those requests, you are going to get a bunch of
RTX-packets arriving. (-13 and then 5 more packets in the test)

Now, if max-misorder is pushed very low at this point, these RTX-packets
will trigger the handle_big_gap_buffer() logic, and because they arriving
so neatly in order, (as they would, since they have been requested like
that), the gst_rtp_jitter_buffer_reset() will be called, and two things
will happen:
1. priv->next_seqnum will be set to the first RTX packet
2. the 5 RTX-packet will be pushed into the chain() function

However, at this point, these RTX-packets are no longer valid, the
jitterbuffer has already pushed lost-events for these, so they will now
be dropped on the floor, and never make it to the waiting loop-function.

And, since we now have a priv->next_seqnum that will never arrive
in the loop-function, the jitterbuffer is now stalled forever, and will
not push out another buffer.

The proposed fixes:
1. Don't use RTX in calculation of the packet-rate.
2. Don't use RTX in large-gap logic, as they are likely to be dropped.

4 years agov4l2videodec: Increase internal bitstream pool size
Nicolas Dufresne [Wed, 15 Apr 2020 16:36:29 +0000 (12:36 -0400)]
v4l2videodec: Increase internal bitstream pool size

This patch will now set the maximum of buffers to 32, allowing to grow the
pool for drivers that supports that and will respect the minimum buffers
reported by the driver. This was made to fix a stall with the virtio CODEC
driver.

Fixes #672

4 years agosplitmuxsink: Do split-at-running-time splitting based on the time of the start of...
Sebastian Dröge [Wed, 15 Apr 2020 14:50:31 +0000 (17:50 +0300)]
splitmuxsink: Do split-at-running-time splitting based on the time of the start of the GOP

If the start of the GOP is >= the requested running time, put it into a
new fragment. That is, split-at-running-time would always ensure that a
split happens as early as possible after the given running time.

Previously it was comparing against the current incoming timestamp,
which does not tell us what we actually want to know as it has no direct
relation to the GOP start/end.

4 years agosplitmuxsink: Fix off-by-one in running time comparison for split-at-running-time
Sebastian Dröge [Wed, 15 Apr 2020 10:21:05 +0000 (13:21 +0300)]
splitmuxsink: Fix off-by-one in running time comparison for split-at-running-time

If we get a keyframe exactly at the requested running time we would only
split on the next keyframe afterwards due to wrong usage of > vs. >=.

4 years agortspsrc: Properly set segments seqnums after seeks
Thibault Saunier [Thu, 9 Apr 2020 16:23:44 +0000 (12:23 -0400)]
rtspsrc: Properly set segments seqnums after seeks

4 years agoflvdemux: Don't write an empty string as a tag
Vivia Nikolaidou [Wed, 8 Apr 2020 16:49:00 +0000 (19:49 +0300)]
flvdemux: Don't write an empty string as a tag

To stop warnings like:

GStreamer-WARNING **: 19:47:48.186: Trying to set empty string on
taglist field 'encoder'. Please file a bug.

4 years agov4l2bufferpool: request the maximum number of buffers for USERPTR
Nicolas Dufresne [Wed, 8 Apr 2020 16:34:40 +0000 (12:34 -0400)]
v4l2bufferpool: request the maximum number of buffers for USERPTR

This is to match what we now do for DMABuf importation.

4 years agov4l2bufferpool: request the maximum number of buffers for DMABUF
Michael Olbrich [Wed, 20 Nov 2019 14:32:29 +0000 (15:32 +0100)]
v4l2bufferpool: request the maximum number of buffers for DMABUF

There are often only two buffers queued in the kernel so no new buffers are
requested.

With every qbuf, the kernel receives a new DMABUF for the specified index.
This most likely differs from the last DMABUF and the old cached entry is
released. This results in a lot of map/unmap overhead if the kernel driver
needs a mapping for the buffer.

With a larger queue, it's quite likely, that both old and new DMABUFs are
also mapped for another index. So the map/unmap is skipped, because the
mapping is reference counted.

The corresponding allocated buffers don't contain any actual memory, so
allocating them is quite cheep. So the log message is updated to clarify
this.

4 years agortspsrc: Avoid stack overflow recursing waiting for response
Thibault Saunier [Wed, 8 Apr 2020 13:45:17 +0000 (09:45 -0400)]
rtspsrc: Avoid stack overflow recursing waiting for response

Instead of recursing, simply implement a loop with gotos, the same
way it was done before 812175288769d647ed6388755aed386378d9210c

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/710

4 years agoqtmux: Add property for enforcing the creation of chunks in single-stream files
Sebastian Dröge [Mon, 6 Apr 2020 13:25:59 +0000 (16:25 +0300)]
qtmux: Add property for enforcing the creation of chunks in single-stream files

This is disabled by default as it unnecessarily creates bigger headers
but it is something that is required by some applications and most
notably the Apple ProRes spec.

4 years agoflvmux: Fix invalid padlist accesses.
Jan Schmidt [Thu, 2 Apr 2020 13:16:10 +0000 (00:16 +1100)]
flvmux: Fix invalid padlist accesses.

Request pads can released at any time, so make sure to hold
the object lock when iterating the element sinkpads list where
that's safe, or to use other safe pad iteration patterns in
other places.

When choosing a best pad, return a reference to the pad to make sure it
stays alive for output in the aggregator srcpad task.

Should fix a spurious valgrind error in the CI flvmux tests and some
other potential problems if the request sink pads are released while
the element is running..

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/714

4 years agoqtmux: Add option to create a timecode trak in non-mov flavors
Vivia Nikolaidou [Mon, 22 Oct 2018 12:41:56 +0000 (15:41 +0300)]
qtmux: Add option to create a timecode trak in non-mov flavors

Even if timecode trak is officially unsupported in non-mov flavors,
some software still supports it, e.g. Final Cut Pro X:

https://developer.apple.com/library/archive/technotes/tn2174/_index.html

The user might still expect to see the timecode information in the
non-mov file despite it being officially unsupported , because other
software e.g. QuickTime will create a timecode trak even in mp4 files.
Furthermore, software that supports timecode trak in non-mov flavors
will also display the file duration in "timecode units" instead of real
clock time, which is not necessarily the same for 29.97 fps and friends.
This might confuse users, who see a different duration for the same
framerate and amount of frames depending on whether the container is mp4
or mov.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/512

4 years agortpLXXdepay: Set the UNPOSITIONED flag on the audio-info when configuring an unpositi...
Sebastian Dröge [Thu, 16 Jan 2020 07:30:39 +0000 (09:30 +0200)]
rtpLXXdepay: Set the UNPOSITIONED flag on the audio-info when configuring an unpositioned layout

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/688

4 years agortpjpeg: Use gst_memory_map() instead of gst_buffer_map()
Kristofer Björkström [Wed, 1 Apr 2020 11:19:46 +0000 (13:19 +0200)]
rtpjpeg: Use gst_memory_map() instead of gst_buffer_map()

gst_buffer_map () results in memcopying when a GstBuffer contains
more than one GstMemory.
This has quite an impact on performance on systems with limited amount
of resources. With this patch the whole GstBuffer will not be mapped at
once, instead each individual GstMemory will be iterated and mapped
separately.

4 years agobuffermemory: keep track of buffer size and current offset
Kristofer Björkström [Wed, 1 Apr 2020 11:17:03 +0000 (13:17 +0200)]
buffermemory: keep track of buffer size and current offset

Added the possibility to get current offset and the total size of the
buffer.

4 years agortpopuspay: make depay ! pay work
Havard Graff [Fri, 3 Apr 2020 08:29:18 +0000 (10:29 +0200)]
rtpopuspay: make depay ! pay work

There is a use-case for a server to re-payload opus going through it.

Problem was that the payloader requires channels in the caps, but
this is not something the depayloader can parse out of the stream, meaning
caps-negotiation would fail.

Removing the requirement of channels in the template-caps fixes this.

4 years agotests: Split splitmux test case
Seungha Yang [Fri, 3 Apr 2020 07:49:25 +0000 (16:49 +0900)]
tests: Split splitmux test case

Since we are adding more and more tests into splitmux,
we need to split it to avoid CI timeout.

4 years agosplitmuxsink: Don't send too many force key unit event
Seungha Yang [Fri, 3 Apr 2020 04:45:56 +0000 (13:45 +0900)]
splitmuxsink: Don't send too many force key unit event

splitmuxsink should requst keyframe depending on configured
threshold and previously requested time in order to avoid too many
keyframe request.

4 years agomatroska: Check the return value of gst_segment_do_seek()
Jan Schmidt [Fri, 20 Mar 2020 10:32:36 +0000 (21:32 +1100)]
matroska: Check the return value of gst_segment_do_seek()

gst_segment_do_seek() can fail.

4 years agoqtdemux: Send instant-rate-change event if requested in the SEEK event
Sebastian Dröge [Fri, 8 Jun 2018 10:12:01 +0000 (13:12 +0300)]
qtdemux: Send instant-rate-change event if requested in the SEEK event

Handle an instant rate change seek immediately by reflecting
it downstream as an instant-rate-change event, and do no
further seek handling.

4 years agomatroska-demux: Send instant-rate-change event if requested in the SEEK event
Sebastian Dröge [Tue, 15 May 2018 15:26:16 +0000 (18:26 +0300)]
matroska-demux: Send instant-rate-change event if requested in the SEEK event

Short-circuit instant rate change events by generating
a downstream instant-rate-change event and doing no further
seek processing.

4 years agomatroska: Update for video-hdr struct change
Seungha Yang [Tue, 10 Mar 2020 14:16:00 +0000 (23:16 +0900)]
matroska: Update for video-hdr struct change

See the change of -base https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/594

4 years agortpbin: make warning messages more meaningful
Aaron Boxer [Tue, 31 Mar 2020 19:51:27 +0000 (15:51 -0400)]
rtpbin: make warning messages more meaningful

4 years agortpsession: rename RTCP thread
Nicolas Pernas Maradei [Fri, 27 Mar 2020 18:24:03 +0000 (19:24 +0100)]
rtpsession: rename RTCP thread

RTP session starts a new thread for RTCP and names it
"rtpsession-rtcp-thread" which happens to be longer than the maximum 16B
allowed by pthread_setname_np and causes the naming to fail.
See docs for more details.

This commit simply shortens the thread's name so it can actually be set.

4 years agortpjitterbuffer: create specific API for appending buffers, events etc
Havard Graff [Mon, 30 Mar 2020 20:26:33 +0000 (22:26 +0200)]
rtpjitterbuffer: create specific API for appending buffers, events etc

To avoid specifying a bunch of mystic variables.

4 years agortpjitterbuffer: various test-improvements
Havard Graff [Mon, 10 Feb 2020 16:33:54 +0000 (17:33 +0100)]
rtpjitterbuffer: various test-improvements

Mainly generalize all the latest tests that have found various stalls
in the jitterbuffer, so that they only consist of a series of packets
with various seqnum/rtptime/rtx combinations, arriving at a specific time.

This means future tests can be more easily written to prove certain
behavior does not cause stalls.

Also fix the warning on windows:
warning C4244: 'initializing': conversion from 'double' to 'gint', possible loss of data

4 years agortpjitterbuffer: fix waiting timer/queue code
Havard Graff [Fri, 27 Mar 2020 13:07:04 +0000 (14:07 +0100)]
rtpjitterbuffer: fix waiting timer/queue code

Changing the types from boolean to guint due to the ++ operand used on
them, and only call JBUF_SIGNAL_QUEUE after settling down,
or else you end up signaling the waiting code in chain() for every buffer
pushed out.

4 years agoqtmux: Error out instead of crashing if reserved-max-duration is 0 or no samples...
Sebastian Dröge [Mon, 23 Mar 2020 17:55:37 +0000 (19:55 +0200)]
qtmux: Error out instead of crashing if reserved-max-duration is 0 or no samples could be created in prefill mode

4 years agogdkpixbufoverlay: Use GST_VIDEO_OVERLAY_COMPOSITION_BLEND_FORMATS for the supported...
Sebastian Dröge [Thu, 12 Mar 2020 13:16:44 +0000 (15:16 +0200)]
gdkpixbufoverlay: Use GST_VIDEO_OVERLAY_COMPOSITION_BLEND_FORMATS for the supported formats

We don't do any blending by ourselves since a while now.

Note that this is a regression in "supported" formats: previously
ARGB64 was supported, for example, but in practice it caused blending to
not take place at all.

4 years agosplitmuxsrc: Fix some deadlock conditions and a crash
Jan Schmidt [Mon, 23 Mar 2020 13:23:24 +0000 (00:23 +1100)]
splitmuxsrc: Fix some deadlock conditions and a crash

When switching the splitmuxsrc state back to NULL quickly, it
can encounter deadlocks shutting down the part readers that
are still starting up, or encounter a crash if the splitmuxsrc
cleaned up the parts before the async callback could run.

Taking the state lock to post async-start / async-done messages can
deadlock if the state change function is trying to shut down the
element, so use some finer grained locks for that.

4 years agosplitmux: Make the unit test faster
Jan Schmidt [Mon, 23 Mar 2020 13:18:54 +0000 (00:18 +1100)]
splitmux: Make the unit test faster

The playback test is considerably faster if it runs with the
appsink set to sync=false

4 years agotests: splitmux: Add test for timecode based split
Seungha Yang [Wed, 25 Mar 2020 13:14:36 +0000 (22:14 +0900)]
tests: splitmux: Add test for timecode based split

4 years agosplitmuxsink: Split fragment only if queued time is larger than threshold
Seungha Yang [Wed, 25 Mar 2020 12:20:07 +0000 (21:20 +0900)]
splitmuxsink: Split fragment only if queued time is larger than threshold

The queued time includes the duration of the last queued frame
(i.e., new keyframe) so the condition check should not be inclusive.
Note that the new fragment will be cut excluding the last frame
and therefore if the condition is inclusive way,
the fragment might have one frame shorter duration for all keyframe
stream such as jpeg or all-inter video streams.

4 years agosplitmuxsink: Don't need to trace next timecode for split decision
Seungha Yang [Wed, 25 Mar 2020 12:01:00 +0000 (21:01 +0900)]
splitmuxsink: Don't need to trace next timecode for split decision

Since the commit 94bb76b6b9c48981d3ad42a8c4370b9658db4229, splitmuxsink
will split fragments based on queued time and the threshold of that.
So don't need to store the next timecode for split decision.

4 years agov4l2: add alternate interlace mode
Guillaume Desmottes [Wed, 8 Aug 2018 07:27:19 +0000 (09:27 +0200)]
v4l2: add alternate interlace mode

When using this mode each frame is split in two fields, each one being
transferred using its own buffer.
This is implemented with the V4L2_FIELD_ALTERNATE field format in v4l2.

This mode is enabled using a caps filter such as
"v4l2src ! video/x-raw\(format:Interlaced\)"

Here are the main changes related to this feature:

- use the INTERLACED caps feature with this mode.

- in this mode both fields of a given frame have the same sequence/offset
so adjust the algorithm checking for lost field/frame accordingly.

- double pool's min number of buffers as each frame requires 2 buffers.

Fix #504
Co-authored-by: Zeeshan Ali <zeenix@collabora.co.uk>
4 years agov4l2: display field when setting or trying format
Guillaume Desmottes [Wed, 5 Feb 2020 07:33:51 +0000 (13:03 +0530)]
v4l2: display field when setting or trying format

Ease debugging interlacing pipelines.

4 years agov4l2: pass v4l2object to GST_V4L2_MIN_BUFFERS()
Guillaume Desmottes [Thu, 30 Jan 2020 07:05:02 +0000 (12:35 +0530)]
v4l2: pass v4l2object to GST_V4L2_MIN_BUFFERS()

Will be used to double the number of buffers in alternate interlace
mode.

4 years agov4l2: use GST_VIDEO_INFO_FIELD_HEIGHT()
Guillaume Desmottes [Thu, 30 Jan 2020 06:39:12 +0000 (12:09 +0530)]
v4l2: use GST_VIDEO_INFO_FIELD_HEIGHT()

Use GST_VIDEO_INFO_FIELD_HEIGHT() instead of GST_VIDEO_INFO_HEIGHT()
when we actually want the field height rather than the frame height.
So far both are equals but that won't longer be the case when
implementing alternate interlace mode.

4 years agosplitmuxsink: Mark some split decision related properties as MUTABLE_READY
Seungha Yang [Tue, 24 Mar 2020 13:08:27 +0000 (22:08 +0900)]
splitmuxsink: Mark some split decision related properties as MUTABLE_READY

The change of various criteria for split decision while muxing is on progress
wouldn't work well as expected.

4 years agosplitmuxsink: Take account queued time and max-size-timecode for split decision
Seungha Yang [Tue, 24 Mar 2020 04:45:00 +0000 (13:45 +0900)]
splitmuxsink: Take account queued time and max-size-timecode for split decision

Not only the requested keyframe time, the queued size should be
a criterion for the split decision of timecode based mode
(same as max-size-time based split case).

4 years agoqmlgloverlay: fix usage without an qmlglsink in the pipeline
Matthew Waters [Tue, 24 Mar 2020 01:55:27 +0000 (12:55 +1100)]
qmlgloverlay: fix usage without an qmlglsink in the pipeline

Without a qmlglsink, we need to retrieve the window system display
ourselves rather than relying solely on qmlglsink to have priority on
the choice of display.

4 years agoFix usage of C99
Xavier Claessens [Tue, 24 Mar 2020 01:32:04 +0000 (21:32 -0400)]
Fix usage of C99

It's 2020, way too early for that, let's stick to C89 for now.

4 years agov4l2bufferpool: Use unique name for v4l2bufferpool object
Seungha Yang [Mon, 23 Mar 2020 07:34:46 +0000 (16:34 +0900)]
v4l2bufferpool: Use unique name for v4l2bufferpool object

Assign unique sequence number to an object name for better debugging

4 years agoqmlgloverlay: don't leak resources freed on a different GL thread
Matthew Waters [Mon, 23 Mar 2020 03:02:22 +0000 (14:02 +1100)]
qmlgloverlay: don't leak resources freed on a different GL thread

deleting a QOpenGLFrameBufferObject needs to occur on the same thread it
was created on in order to actually free the relevant resources
immediately.  Otherwise, they will be queued for deletion and not freed
until the associated QOpenGLContext is destroyed.

4 years agoqt: reorganize include defines
Matthew Waters [Thu, 19 Mar 2020 22:14:01 +0000 (09:14 +1100)]
qt: reorganize include defines

4 years agortptimerqueue: remove ->num from the timer
Havard Graff [Thu, 19 Mar 2020 22:17:21 +0000 (23:17 +0100)]
rtptimerqueue: remove ->num from the timer

This concept was only used by the "multi"-lost timer, and since that
one is not around any longer, the "num" concept is superfluous.

4 years agortpjitterbuffer: remove the concept of "already-lost"
Havard Graff [Thu, 19 Mar 2020 22:37:26 +0000 (23:37 +0100)]
rtpjitterbuffer: remove the concept of "already-lost"

This is a concept that only applies when a buffer arrives in the chain
function, and it has already been scheduled as part of a "multi"-lost
timer.

However, "multi"-lost timers are now a thing of the past, making this
whole concept superflous, and this buffer is now simply counted as "late",
having already been pushed out (albeit as a lost-event).

4 years agortpjitterbuffer: immediately insert a lost-event on multiple lost packets
Havard Graff [Thu, 19 Mar 2020 22:12:04 +0000 (23:12 +0100)]
rtpjitterbuffer: immediately insert a lost-event on multiple lost packets

There is a problem with the code today, where a single timer will
be scheduled for a series of lost packets, and then if the first packet
in that series arrives, it will cause a rescheduling of that timer, going
from a "multi"-timer to a single-timer, causing a lot of the packets
in that timer to be unaccounted for, and creating a situation in where
the jitterbuffer will never again push out another packet.

This patch solves the problem by instead of scheduling those lost packets
as another timer, it instead asks to have that lost-event pushed straight
out.

This very much goes with the intent of the code here: These packets are
so desperately late that no cure exists, and we might as well get the
lost-event out of the way and get on with it.

This change has some interesting knock-on effect being presented in
later commits. It completely removes the concept of "already-lost", so
that is why that test has been disabled in this commit, to be
removed later.

4 years agortpjitterbuffer: rework large-gap tests
Havard Graff [Thu, 19 Mar 2020 22:03:50 +0000 (23:03 +0100)]
rtpjitterbuffer: rework large-gap tests

Make sure to set the time the buffer is supposed to arrive at, so
as not to trigger an artificial situation.

4 years agortpjitterbuffer: refactor lost_timeout code
Havard Graff [Thu, 19 Mar 2020 11:17:22 +0000 (12:17 +0100)]
rtpjitterbuffer: refactor lost_timeout code

Split it up in code related to the timer, (do_lost_timeout) and code
to insert a lost-item/event and update private jitterbuffer-variables.

4 years agotest/check: split out rtptimerqueue-tests in a separate file
Havard Graff [Fri, 18 Oct 2019 15:43:36 +0000 (17:43 +0200)]
test/check: split out rtptimerqueue-tests in a separate file

4 years agogstqmlgl: Link to opengl32.lib on MinGW
Dmitriy Purgin [Wed, 5 Feb 2020 08:56:23 +0000 (09:56 +0100)]
gstqmlgl: Link to opengl32.lib on MinGW

4 years agoqtmux: Fix build warning
Seungha Yang [Thu, 19 Mar 2020 14:51:47 +0000 (23:51 +0900)]
qtmux: Fix build warning

gstqtmux.c(644): warning C4133: '=':
  incompatible types - from 'gboolean (__cdecl *)(GstAggregator *,GstAggregatorPad *,GstEvent *)'
  to 'GstFlowReturn (__cdecl *)(GstAggregator *,GstAggregatorPad *,GstEvent *)'

4 years agosplitmuxsink: Reset cleanly for reuse
Jan Schmidt [Thu, 19 Mar 2020 12:05:49 +0000 (23:05 +1100)]
splitmuxsink: Reset cleanly for reuse

Reset the splitmuxsink completely when changing states so that
it can be reused.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1241

4 years agompegaudioparse: Use a constant bit rate to convert between time and bytes if possible.
Zebediah Figura [Tue, 18 Feb 2020 04:37:10 +0000 (22:37 -0600)]
mpegaudioparse: Use a constant bit rate to convert between time and bytes if possible.

This should result in no worse accuracy than the base parse element, and may
result in better accuracy. In particular, the number of bytes processed at any
given point, as accumulated by baseparse, can be only accurate to
(1 / # of frames) bytes per second, and if we try to seek immediately after
pausing the pipeline to a large offset, this small inaccuracy can propagate to
something noticeable.

The use case that prompted this patch is a 45-minute MPEG-1 layer 3 file, which
has a constant bit rate but no seek tables. Trying to seek the pipeline
immediately after pauisng it, without the ACCURATE flag, to a location 41
minutes in, yields a location that is, even with <https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/374>,
still audibly incorrect. This patch yields a much closer position, no longer
audibly incorrect, and likely within a frame of the most correct position.

4 years agoqtmux: fix renegotiation check
Mathieu Duponchelle [Wed, 4 Mar 2020 21:10:40 +0000 (22:10 +0100)]
qtmux: fix renegotiation check

By the time sink_event is called, the pad's current caps have
already been updated. To address this, implement sink_event_pre_queue,
and check if the pad can be renegotiated there.

Fixes #707

4 years agosplitmuxsink: Decouple keyframe request and the decision for fragmentation
Seungha Yang [Thu, 12 Mar 2020 11:34:47 +0000 (20:34 +0900)]
splitmuxsink: Decouple keyframe request and the decision for fragmentation

Split the decision for keyframe request and fragmentation in order to
ensure periodic keyframe request.

4 years agoqt: add a qml overlay filter element [part 2]
Matthew Waters [Wed, 26 Feb 2020 07:29:06 +0000 (18:29 +1100)]
qt: add a qml overlay filter element [part 2]

It takes a qml scene description and renders it using a possible input
stream.

Currently supported on GLX and WGL.

Follow up to (as that MR had an old version of the commit):
- https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/475
4778d7166a02caf793df4f845dc35b6933d87c81: qt: add a qml overlay filter element

4 years agoqt: add a qml overlay filter element
Matthew Waters [Wed, 26 Feb 2020 07:29:06 +0000 (18:29 +1100)]
qt: add a qml overlay filter element

It takes a qml scene description and renders it using a possible input
stream.

Currently supported on GLX and WGL.

4 years agoqt: don't always activate/deactivate our GstGLContext
Matthew Waters [Tue, 25 Feb 2020 10:47:14 +0000 (21:47 +1100)]
qt: don't always activate/deactivate our GstGLContext

Techincally it is enough to activate at the beginning and then forget.

4 years agotest/qml: add an dynamically adding qmlglsink element
Matthew Waters [Tue, 4 Feb 2020 08:43:52 +0000 (19:43 +1100)]
test/qml: add an dynamically adding qmlglsink element

The example shows how to add qmlglsink to an already running pipeline
with pre-existing OpenGL elements.

4 years agoqmlglsink: propagate the context up the the application
Matthew Waters [Tue, 4 Feb 2020 08:40:45 +0000 (19:40 +1100)]
qmlglsink: propagate the context up the the application

Allows the application to be notified of the OpenGL context creation.

4 years agoqtitem: fix leak of caps
Matthew Waters [Mon, 3 Feb 2020 04:59:34 +0000 (15:59 +1100)]
qtitem: fix leak of caps

4 years agowavpack: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:28:18 +0000 (19:28 +0100)]
wavpack: Use G_DECLARE_FINAL_TYPE

4 years agovpx: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:26:18 +0000 (19:26 +0100)]
vpx: Use G_DECLARE_FINAL_TYPE

4 years agotwolame: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:22:00 +0000 (19:22 +0100)]
twolame: Use G_DECLARE_FINAL_TYPE

4 years agotaglib: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:20:49 +0000 (19:20 +0100)]
taglib: Use G_DECLARE_FINAL_TYPE

4 years agospeex: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:18:39 +0000 (19:18 +0100)]
speex: Use G_DECLARE_FINAL_TYPE

4 years agosoup: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:16:22 +0000 (19:16 +0100)]
soup: Use G_DECLARE_FINAL_TYPE

4 years agoshout2: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:14:17 +0000 (19:14 +0100)]
shout2: Use G_DECLARE_FINAL_TYPE

4 years agoraw1394: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:11:52 +0000 (19:11 +0100)]
raw1394: Use G_DECLARE_FINAL_TYPE

4 years agoqt: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:06:50 +0000 (19:06 +0100)]
qt: Use G_DECLARE_FINAL_TYPE

4 years agopulse: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 18:00:18 +0000 (19:00 +0100)]
pulse: Use G_DECLARE_FINAL_TYPE

4 years agompg123: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:54:33 +0000 (18:54 +0100)]
mpg123: Use G_DECLARE_FINAL_TYPE

4 years agolibpng: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:52:57 +0000 (18:52 +0100)]
libpng: Use G_DECLARE_FINAL_TYPE

4 years agolibcaca: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:49:53 +0000 (18:49 +0100)]
libcaca: Use G_DECLARE_FINAL_TYPE

4 years agolame: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sun, 15 Mar 2020 17:40:28 +0000 (18:40 +0100)]
lame: Use G_DECLARE_FINAL_TYPE

4 years agojack: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sat, 14 Mar 2020 16:52:38 +0000 (17:52 +0100)]
jack: Use G_DECLARE_FINAL_TYPE

4 years agogtk: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Sat, 14 Mar 2020 16:43:50 +0000 (17:43 +0100)]
gtk: Use G_DECLARE_FINAL_TYPE

4 years agogdk_pixbuf: Use G_DECLARE_FINAL_TYPE
Niels De Graef [Fri, 13 Mar 2020 17:47:49 +0000 (18:47 +0100)]
gdk_pixbuf: Use G_DECLARE_FINAL_TYPE