platform/upstream/gstreamer.git
4 years agovulkan: implement proper descriptor set handling
Matthew Waters [Wed, 6 Nov 2019 11:19:42 +0000 (22:19 +1100)]
vulkan: implement proper descriptor set handling

The major functionality gain this provides is proper reference counting
for a descriptor set.  Overall this allows us to create descriptor sets
when they are needed (or reused from a cache) without violating any of
vulkan's object synchronisation requirements.

As there are a fixed number of sets available in a pool, the number of
descriptors in elements is currently hardcoded to 32.  This can be extended
in a future change to create pools on the fly if that limit is ever overrun.

4 years agovulkan/fence: add always-signalled fence type
Matthew Waters [Tue, 5 Nov 2019 22:34:36 +0000 (09:34 +1100)]
vulkan/fence: add always-signalled fence type

Allows a cleaner control flow when there is no fence available for use
with the trash list.  An always signalled fence type will always return
TRUE for gst_vulkan_fence_is_signalled.

4 years agovulkan: add handle type for arbitrary vulkan handles
Matthew Waters [Tue, 5 Nov 2019 22:29:51 +0000 (09:29 +1100)]
vulkan: add handle type for arbitrary vulkan handles

Serve two purposes:
1. refcounting of vulkan handles with associated destruction.  When
   combined with the trash list, the user can ensure destruction at
   the correct time according to the vulkan rules.
2. avoids polluting our API with 32-bit vs 64-bit integer/pointers
   differences as exposed through the vulkan API.  on 32-bit, vulkan
   non-dispatchable handles are 64-bit integers and on 64-bit, they
   are pointers.

4 years agovulkanviewconvert: fix typo of output image view name
Matthew Waters [Wed, 6 Nov 2019 11:09:02 +0000 (22:09 +1100)]
vulkanviewconvert: fix typo of output image view name

4 years agovulkan: fix non-dispatchable handles on 32-bit platforms
Matthew Waters [Wed, 16 Oct 2019 06:47:33 +0000 (17:47 +1100)]
vulkan: fix non-dispatchable handles on 32-bit platforms

non-dispatchable handles are 64-bit integers on 32-bit platforms

4 years agovulkan: use VK_NULL_HANDLE in more places
Matthew Waters [Wed, 16 Oct 2019 06:42:33 +0000 (17:42 +1100)]
vulkan: use VK_NULL_HANDLE in more places

Fixes compiler warnings on 32-bit platforms assigning a void * to a
64-bit integer value.

4 years agovulkan: use the provided VKAPI_ATTR for the debug callback
Matthew Waters [Wed, 16 Oct 2019 06:27:16 +0000 (17:27 +1100)]
vulkan: use the provided VKAPI_ATTR for the debug callback

Ensures that we get the calling convention correct for the platform we
are using.

4 years agovulkan: dump surface information
Matthew Waters [Sun, 3 Nov 2019 10:50:39 +0000 (21:50 +1100)]
vulkan: dump surface information

4 years agovulkan: print criticals/warnings for vulkan errors/warnings
Matthew Waters [Wed, 30 Oct 2019 08:33:25 +0000 (19:33 +1100)]
vulkan: print criticals/warnings for vulkan errors/warnings

Simplifies finding the erronous cases in using the Vulkan API
incorrectly.

4 years agovulkan/image: use the full video info for returning vulkan formats
Matthew Waters [Tue, 29 Oct 2019 13:57:55 +0000 (00:57 +1100)]
vulkan/image: use the full video info for returning vulkan formats

We may need some colorspace information for returning sRGB vs no sRGB.

4 years agotsdemux: Handle continuity mismatch in more cases
Edward Hervey [Wed, 6 Nov 2019 13:22:07 +0000 (14:22 +0100)]
tsdemux: Handle continuity mismatch in more cases

Packets of a given PID are meant to have sequential continuity counters
(modulo 16). If there are not sequential, this is the sign of a broken
stream, which we then consider as a discontinuity.

But if that new packet is a frame start (PUSI is true), then we can resume
from that packet without any damage.

4 years agovulkan: Fix build error when gstvulkan is not installed
Yeongjin Jeong [Fri, 1 Nov 2019 05:22:46 +0000 (14:22 +0900)]
vulkan: Fix build error when gstvulkan is not installed

The following build error occurs:

vkdeviceprovider.h:30:10: fatal error: gst/vulkan/vulkan.h: No such file or directory
  #include <gst/vulkan/vulkan.h>
           ^~~~~~~~~~~~~~~~~~~~~

4 years agodebugutils: clockselect, a pipeline that enables clock selection
Ederson de Souza [Wed, 23 Oct 2019 17:11:46 +0000 (10:11 -0700)]
debugutils: clockselect, a pipeline that enables clock selection

Sometimes, one wants to force a clock on some pipelines - for instance,
when testing TSN related pipelines, one usually uses GstPtpClock or
CLOCK_REALTIME (assuming system realtime clock is in sync with network
one). Until now, one needs to write an application for that - not
difficult, but quite boring if one just wants to test something. This
patch presents a new element to help that: clockselect.

clockselect is a pipeline with two properties to select a clock. One
property, "clock-id", enables one to choose between "monotonic",
"realtime", "ptp" or "default" clock - where default keeps pipeline
behaviour of choosing a clock based on its elements. The other property,
"ptp-domain" gives one the choice of which PTP domain should be used.

Some very simple tests also added for this new element.

4 years agoDon't pass default GLib marshallers for signals
Niels De Graef [Tue, 27 Aug 2019 05:59:27 +0000 (07:59 +0200)]
Don't pass default GLib marshallers for signals

By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.

4 years agosrt: split incoming buffer up into srt chunk
Justin Kim [Mon, 28 Oct 2019 04:42:15 +0000 (13:42 +0900)]
srt: split incoming buffer up into srt chunk

4 years agowasapi: minor cleanup
Ignacio Casal Quinteiro [Sat, 2 Nov 2019 15:29:02 +0000 (16:29 +0100)]
wasapi: minor cleanup

4 years agosdp: don't leak the ghost pad
Michael Olbrich [Tue, 27 Aug 2019 13:14:31 +0000 (15:14 +0200)]
sdp: don't leak the ghost pad

The peer is already gone when pad_removed_cb() called, so the ghost cannot
be removed. Use g_object_set_data() instead to remember the ghost pad.

Copied from similar code in GstRTPBin.

4 years agod3dvideosink: support OverlayComposition for GPU overlay compositing
Aaron Boxer [Tue, 22 Oct 2019 18:10:30 +0000 (14:10 -0400)]
d3dvideosink: support OverlayComposition for GPU overlay compositing

4 years agobasetsmux: allow null J2K profile
Aaron Boxer [Tue, 5 Nov 2019 01:42:19 +0000 (20:42 -0500)]
basetsmux: allow null J2K profile

Since we are not requiring that profile equals GST_JPEG2000_PARSE_PROFILE_BC_SINGLE,
(as the standard requires) we can allow profile to be null. We relax this condition because
OpenJPEG can't create broadcast profiles.

4 years agojpeg2000parse: fail caps negotiation if caps are NOT fixed
Aaron Boxer [Sun, 3 Nov 2019 10:56:12 +0000 (05:56 -0500)]
jpeg2000parse: fail caps negotiation if caps are NOT fixed

4 years agojpeg2000parse: use pre_push_frame to reset parser
Aaron Boxer [Thu, 8 Aug 2019 19:27:11 +0000 (15:27 -0400)]
jpeg2000parse: use pre_push_frame to reset parser

4 years agojpeg2000parse: parse_event: call base class at end
Aaron Boxer [Thu, 8 Aug 2019 19:26:22 +0000 (15:26 -0400)]
jpeg2000parse: parse_event: call base class at end

derived class should do it's work first before calling base

4 years agojpeg2000parse: do hard reset if gst_base_parse_finish_frame fails
Aaron Boxer [Tue, 6 Aug 2019 01:53:54 +0000 (21:53 -0400)]
jpeg2000parse: do hard reset if gst_base_parse_finish_frame fails

4 years agojpeg2000parse: initialize some variables to make valgrind happy
Aaron Boxer [Mon, 5 Aug 2019 21:15:57 +0000 (17:15 -0400)]
jpeg2000parse: initialize some variables to make valgrind happy

4 years agojpeg2000parse: add unit test
Aaron Boxer [Fri, 9 Aug 2019 13:29:22 +0000 (09:29 -0400)]
jpeg2000parse: add unit test

4 years agojpeg2000parse: use GST_INT in caps for profile
Aaron Boxer [Fri, 9 Aug 2019 13:28:53 +0000 (09:28 -0400)]
jpeg2000parse: use GST_INT in caps for profile

Negotiation failed with GST_UINT

4 years agojpeg2000parse: make explicit that codec_format is for src caps
Aaron Boxer [Mon, 5 Aug 2019 19:38:08 +0000 (15:38 -0400)]
jpeg2000parse: make explicit that codec_format is for src caps

4 years agojpeg2000parse: refactor
Aaron Boxer [Mon, 5 Aug 2019 19:24:49 +0000 (15:24 -0400)]
jpeg2000parse: refactor

1. only recalculate src codec format if sink caps change
2. use correct value for "jp2c" magic in J2C box ID
3. only parse J2K magic once, and store result
4. more sanity checks comparing caps to parsed codec

4 years agojpeg2000parse: set parsed to TRUE in src caps
Aaron Boxer [Mon, 5 Aug 2019 19:34:08 +0000 (15:34 -0400)]
jpeg2000parse: set parsed to TRUE in src caps

4 years agojpeg2000parse: only cache caps parameters when caps have in fact changed
Aaron Boxer [Mon, 5 Aug 2019 19:33:33 +0000 (15:33 -0400)]
jpeg2000parse: only cache caps parameters when caps have in fact changed

4 years agojpeg2000parse: fix typos in media format
Aaron Boxer [Mon, 5 Aug 2019 19:23:24 +0000 (15:23 -0400)]
jpeg2000parse: fix typos in media format

4 years agojpeg2000parse: add reset method
Aaron Boxer [Mon, 5 Aug 2019 19:19:12 +0000 (15:19 -0400)]
jpeg2000parse: add reset method

Also add three new struct members, currently unused.

4 years agodocumentation: fixed a heap o' typos
Aaron Boxer [Mon, 2 Sep 2019 19:08:44 +0000 (15:08 -0400)]
documentation: fixed a heap o' typos

4 years agoAdd files from gst-rtmp
Vivia Nikolaidou [Tue, 5 Nov 2019 13:52:55 +0000 (13:52 +0000)]
Add files from gst-rtmp

For master, without autotools.

4 years agoav1enc: Add tile-{columns,rows} properties
Wonchul Lee [Sun, 6 Oct 2019 13:46:52 +0000 (22:46 +0900)]
av1enc: Add tile-{columns,rows} properties

It provides to set tile-columns and tile-rows configurations. The av1
codec allows an input image frame be partitioned into separate vertical
or horizontal tile which can be encoded or decoded independently. It
helps to encode/decode parallel.

4 years agoav1enc: Enable row-mt by default
Wonchul Lee [Sun, 6 Oct 2019 08:20:12 +0000 (17:20 +0900)]
av1enc: Enable row-mt by default

Enabling row-mt property can help to increase cpu utilization and reduce
encoding speed, so set it to on by default.

4 years agocurlhttpsrc: Hook up libcurl logging message to gstreamer
Yeongjin Jeong [Tue, 23 Jul 2019 09:24:11 +0000 (18:24 +0900)]
curlhttpsrc: Hook up libcurl logging message to gstreamer

CURLOPT_DEBUGFUNCTION option replaces the standard debug function
used when CURLOPT_VERBOSE is in effect. This callback receives various debug information.

4 years agoristsrc: Apply BINDTODEVICE to socket created by udpsrc too
Olivier Crête [Fri, 20 Sep 2019 12:52:15 +0000 (14:52 +0200)]
ristsrc: Apply BINDTODEVICE to socket created by udpsrc too

4 years agoccconverter: Instead of erroring out on too big input drop additional data
Sebastian Dröge [Sun, 3 Nov 2019 08:54:40 +0000 (09:54 +0100)]
ccconverter: Instead of erroring out on too big input drop additional data

4 years agovtdec: fix leak of CMFormatDescription
Roman Shpuntov [Wed, 30 Oct 2019 07:56:41 +0000 (14:56 +0700)]
vtdec: fix leak of CMFormatDescription

There was consideration for replacing the CMFormatDescription used
on format changes in `set_format()` however on shutdown, we were
leaking the CMFormatDescription at the end of processing.

'https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1106'

4 years agoh265parse: Fix wrong NALU minimum length check
Yeongjin Jeong [Fri, 11 Oct 2019 19:04:59 +0000 (04:04 +0900)]
h265parse: Fix wrong NALU minimum length check

Fixes a problem where an EOS/EOB NALU placed at the end of
an AU is detected as an other AU and create a buffer that
does not have valid pts.

4 years agoh264parse: Fix wrong NALU minimum length check
Yeongjin Jeong [Fri, 11 Oct 2019 18:49:33 +0000 (03:49 +0900)]
h264parse: Fix wrong NALU minimum length check

Fixes a problem where an EOS/EOB NALU placed at the end of
an AU is detected as an other AU and create a buffer that
does not have valid pts.

4 years agoopenexr: Fix compilation with OpenEXR 2.4
Jan Alexander Steffens (heftig) [Sat, 2 Nov 2019 15:51:09 +0000 (16:51 +0100)]
openexr: Fix compilation with OpenEXR 2.4

It uses modern C++; adding -std=c++98 breaks the build.

4 years agovtdec: memory leaks bugfix
Roman Shpuntov [Thu, 31 Oct 2019 08:14:21 +0000 (15:14 +0700)]
vtdec: memory leaks bugfix

release 'videoDecoderSpecification' variable in 'gst_vtdec_create_session' function.
release 'extensions' variable in 'create_format_description_from_codec_data' function.

4 years agomsdkmjpegenc: convert UYVY to YUY2 instead of NV12
Haihao Xiang [Fri, 11 Oct 2019 06:48:11 +0000 (14:48 +0800)]
msdkmjpegenc: convert UYVY to YUY2 instead of NV12

Before this fix, the chroma subsampling of the output is 4:2:0. It is
4:2:2 with this fix, which is better for UYVY input

4 years agomsdkmjpegenc: don't need conversion for BGRA and YUY2
Haihao Xiang [Fri, 11 Oct 2019 05:05:33 +0000 (13:05 +0800)]
msdkmjpegenc: don't need conversion for BGRA and YUY2

jpeg encoder in MSDK can accept BGRA and YUY2 input.

4 years agomsdkenc: add need_conversion method
Haihao Xiang [Fri, 11 Oct 2019 04:50:02 +0000 (12:50 +0800)]
msdkenc: add need_conversion method

In future, a sub class of GstMsdkEncClass may decide a native format by
using this method, e.g. JPEG encoder may accept YUY2 input, however the
current implemation needs a conversion from YUY2 to NV12 before encoding.

In addtion, a sub class may choose a format for encoding if the input
format is not supported by MSDK, e.g. the current implemation does
UYVY->NV12 if the input format is UYVY. We may do UYVY->YUY2 for JPEG
encoder in future

4 years agomsdk: support for MFX_FOURCC_BGR4 frame allocation
Haihao Xiang [Wed, 9 Oct 2019 05:41:09 +0000 (13:41 +0800)]
msdk: support for MFX_FOURCC_BGR4 frame allocation

MFX_FOURCC_BGR4 is mapped to VA_FOURCC_ABGR and JPEG encoder needs a
MFX_FOURCC_BGR4 frame for internal usage when the input format is
MFX_FOURCC_RGB4

This is a preparation for supporting native formats of JPEG encoder

4 years agompegtsmux: Add SCTE-35 support
Edward Hervey [Thu, 26 Sep 2019 15:45:31 +0000 (17:45 +0200)]
mpegtsmux: Add SCTE-35 support

This adds two properties:
* scte-35-pid: If not 0, enables the SCTE-35 support for the current
  program. This will write the proper PMT and send SCTE-35 NULL
  commands (i.e. heartbeats) at a regular interval
* scte-35-null-interval: This specifies the interval at which the
  NULL commands should be sent

Sending SCTE-35 commands is done by creating the appropriate SCTE-35
GstMpegtsSection and then sending them on the muxer. See the
associated example

4 years agompegts: Add support for SCTE-35 sections
Edward Hervey [Thu, 26 Sep 2019 15:28:27 +0000 (17:28 +0200)]
mpegts: Add support for SCTE-35 sections

Not all commands are supported, but the most common ones are.
Both parsing and packetizing is supported

4 years agotsmux: Disable bluray-isms from PMT
Edward Hervey [Thu, 26 Sep 2019 15:43:57 +0000 (17:43 +0200)]
tsmux: Disable bluray-isms from PMT

We were unconditionally adding top-level descriptors in the PMT which
were only related to bluray support for PS3 (from 10 years ago).

These should be re-added conditionally

4 years agompegtspacketizer: Fix off-by-one error
Edward Hervey [Thu, 26 Sep 2019 15:13:30 +0000 (17:13 +0200)]
mpegtspacketizer: Fix off-by-one error

This went un-noticed for 6 years :( The issue is that for short
sections (without subtables and CRC), we would always fail when
checking whether we had enough data or not and then default to the
long section checking.

Use the long section checking would then cause interesting side-effects
for short sections (such as believing they were already seen and therefore
would be dropped/ignored).

4 years agomsdkdec: use decoder base class packetized flag
Víctor Manuel Jáquez Leal [Mon, 28 Oct 2019 12:28:28 +0000 (13:28 +0100)]
msdkdec: use decoder base class packetized flag

Instead of using a proxy of `is_packetized` flag this patch
replaces it with the accessor to that flag in decoder base class,
avoiding probable mismatches.

4 years agomsdkdec: add parse callback for non-packetized input
Haihao Xiang [Fri, 27 Sep 2019 02:50:18 +0000 (10:50 +0800)]
msdkdec: add parse callback for non-packetized input

commit 55c0d720 added the capability to handle non-packetized bitstream,
and there is a loop to handle multiple frames in a non-packetized buffer
in gst_msdkdec_handle_frame. However it is possible that a
non-packetized buffer still contains valid data but there is no long any
pending unfinished frame. Currently gst_video_decoder_decode_frame is
invoked to send a new frame with new input data, the situaltion is
repeated till an EOS is received. An application has to exit when
receiving an EOS, however there is still valid data in a
non-packetezied input buffer, hence some frames are dropped.

This fix adds a parse callback for non-packeteized input, a new frame
will be sent to the subclass as soon as the input buffer has valid data

This fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/665

4 years agoccextractor: Remove unused set/get_property() functions
Sebastian Dröge [Mon, 28 Oct 2019 09:25:15 +0000 (11:25 +0200)]
ccextractor: Remove unused set/get_property() functions

4 years agoccextractor: Always forward all sticky events to the caption pad
Sebastian Dröge [Mon, 28 Oct 2019 09:22:06 +0000 (11:22 +0200)]
ccextractor: Always forward all sticky events to the caption pad

And only update the caps and stream-start event accordingly. This
ensures that we'll always forward sticky events that arrive after the
caption pad was created, and especially updates to existing sticky
events like the segment event.

Also create a proper stream id based on the upstream stream id for the
stream-start event, and make sure that all the sticky events we know are
already on the caption pad at the time it is added to the element.

4 years agovulkanimage: move fence creation earlier
Matthew Waters [Sun, 27 Oct 2019 15:27:04 +0000 (02:27 +1100)]
vulkanimage: move fence creation earlier

Fixes a critical:

GStreamer-CRITICAL **: 02:26:34.698: gst_mini_object_ref: assertion 'mini_object != NULL' failed

4 years agovulkan: change to clamp to edge rather than clamp to border
Matthew Waters [Sun, 27 Oct 2019 15:18:18 +0000 (02:18 +1100)]
vulkan: change to clamp to edge rather than clamp to border

clamp-to-border will return the border color which is typically black,
white or transparent.  When linear filtering the edge pixels will
typeically be combined with the border color which is not typically what
we want.  Especially when color converting, this removes a green box
around the edge when converting YUV->RGB.

4 years agomsdkh265enc: Add support for tiled encoding
Haihao Xiang [Thu, 24 Oct 2019 07:26:33 +0000 (15:26 +0800)]
msdkh265enc: Add support for tiled encoding

Add num-tile-rows and num-tile-cols properties to set the number of rows
and columns

4 years agosrtpenc: also insert ssrc(s) from rtp buffers
Julien Isorce [Thu, 24 Oct 2019 23:42:23 +0000 (16:42 -0700)]
srtpenc: also insert ssrc(s) from rtp buffers

This fixes a regression from commit "srtp: Support libsrtp2"
e9aa11720071f8a1d22b336395e66dd8cbca0c00 where an internal
set of ssrc(s) was added because the libsrtp v2 keeps its
internal streams as private. But the change prevented that
ssrc(s) that not in the caps from being added to the stats.
This patch ensures that all ssrc(s) are inserted to this set
instead of only inserting those from the caps.

4 years agomsdk: support P010_10LE in DMABuf mode for VP9/HEVC encoding
Haihao Xiang [Fri, 18 Oct 2019 04:26:26 +0000 (12:26 +0800)]
msdk: support P010_10LE in DMABuf mode for VP9/HEVC encoding

4 years agoandroidmedia: Make sure that the first member of GstAmcSurfaceTextureJNI is correct
Cheng-Chang Wu [Thu, 24 Oct 2019 11:10:30 +0000 (19:10 +0800)]
androidmedia: Make sure that the first member of GstAmcSurfaceTextureJNI is correct

It's a subclass of GstAmcSurfaceTexture so should have that as first
struct member or otherwise it won't work.

Fixes #1105

4 years agoandroidmedia: Call JNI method with the actual Java object instead of our wrapper...
Cheng-Chang Wu [Thu, 24 Oct 2019 11:14:58 +0000 (19:14 +0800)]
androidmedia: Call JNI method with the actual Java object instead of our wrapper struct

Fixes #1105

4 years agoopencv: Don't error when unable to detect OpenCV data dir
Jan Alexander Steffens (heftig) [Thu, 24 Oct 2019 13:40:25 +0000 (15:40 +0200)]
opencv: Don't error when unable to detect OpenCV data dir

Instead, mark OpenCV as not found. We error out later if OpenCV was
explicitly enabled.

4 years agomsdkvpp: add support Y410 and Y210 formats
Haihao Xiang [Fri, 11 Oct 2019 15:54:55 +0000 (23:54 +0800)]
msdkvpp: add support Y410 and Y210 formats

And clean up some macros

4 years agomsdkvpp: allow cropping via properties
U. Artie Eoff [Wed, 16 Oct 2019 18:59:32 +0000 (11:59 -0700)]
msdkvpp: allow cropping via properties

Add crop-left, crop-right, crop-top and crop-bottom
properties to msdkvpp and apply to input surface at
vpp transform run-time.

Implements #1097

4 years agowpe: Get rid of un-necessary frameComplete dispatchs
Philippe Normand [Tue, 22 Oct 2019 17:33:18 +0000 (18:33 +0100)]
wpe: Get rid of un-necessary frameComplete dispatchs

frameComplete() should be called only if there's a new commited frame.

4 years agowpe: Run frameComplete outside of images mutex scope
Philippe Normand [Sat, 19 Oct 2019 11:48:55 +0000 (12:48 +0100)]
wpe: Run frameComplete outside of images mutex scope

If the mutex is locked while running frameComplete there is a potential deadlock
bound to happen when we get a new exported images from the backend.

Fixes #1101

4 years agotimecodestamper: Add properties to time out cached upstream/LTC timecodes after a...
Sebastian Dröge [Wed, 23 Oct 2019 13:47:43 +0000 (16:47 +0300)]
timecodestamper: Add properties to time out cached upstream/LTC timecodes after a while

By default we never time them out and simply continue couting up with
each frame forever.

4 years agotimecodestamper: Add new auto-resync boolean property
Sebastian Dröge [Wed, 23 Oct 2019 12:03:09 +0000 (15:03 +0300)]
timecodestamper: Add new auto-resync boolean property

This allows selecting whether we continue updating our last known
upstream timecode whenever a new one arrives or instead only keep the
last known one and from there on count up.

4 years agotimecodestamper: Add last-known-or-zero mode
Sebastian Dröge [Wed, 23 Oct 2019 11:31:16 +0000 (14:31 +0300)]
timecodestamper: Add last-known-or-zero mode

This uses the last known upstream timecode (counted up per frame), or
otherwise zero if none was known.

The normal last-known timestamp uses the internal timecode as fallback
if no upstream timecode was ever known.

4 years agotimecodestamper: Don't initialize upstream timecode with zero if none was seen
Sebastian Dröge [Wed, 23 Oct 2019 11:29:06 +0000 (14:29 +0300)]
timecodestamper: Don't initialize upstream timecode with zero if none was seen

Instead keep it unset and use the internal timecode wherever needed as
fallback.

4 years agotimecodestamper: Update set-tc property documentation with latest version of reality
Sebastian Dröge [Wed, 23 Oct 2019 11:28:24 +0000 (14:28 +0300)]
timecodestamper: Update set-tc property documentation with latest version of reality

4 years agopnmdec: Return early on ::finish() if we have no actual data to parse
Sebastian Dröge [Tue, 22 Oct 2019 06:30:34 +0000 (09:30 +0300)]
pnmdec: Return early on ::finish() if we have no actual data to parse

Otherwise we'd be working with a NULL buffer and cause various critical
warnings along the way.

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

4 years agolv2: fix build without the debug system
Jordan Petridis [Tue, 24 Sep 2019 05:55:07 +0000 (08:55 +0300)]
lv2: fix build without the debug system

```
FAILED: subprojects/gst-plugins-bad/ext/lv2/b8a2ebe@@gstlv2@sha/gstlv2utils.c.o
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c: In function 'lv2_log_printf':
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c:50:3: error: attempt to use poisoned "gst_debug_log_valist"
   50 |   gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
      |   ^
../subprojects/gst-plugins-bad/ext/lv2/gstlv2utils.c:50:25: error: 'lv2_debug' undeclared (first use in this function); did you mean 'g_debug'?
   50 |   gst_debug_log_valist (lv2_debug, GST_LEVEL_INFO, "", "", 0, NULL, fmt, ap);
      |                         ^~~~~~~~~
      |                         g_debug
```

4 years agocamerabin2: preview: remove redundant property setting on appsink
Ratchanan Srirattanamet [Thu, 29 Aug 2019 14:20:37 +0000 (21:20 +0700)]
camerabin2: preview: remove redundant property setting on appsink

Commit 8a56a7de6d5f2cf70dbe6efbd7c8ed74600c8565 (camerabin2: preview:
Appsink doesn't need to sync) add a line that set the "sync" property on
the appsink. However, the author seems to forget that there's another
property setting on appsink a few lines below.

It's very likely that the added line is required because the original
line doesn't take effect (maybe because it's too late). But for whatever
reason, the original line is now redundant. So, I remove it in this
commit.

4 years agomeson: use gir_init_section in GstTranscoder
Alistair Buxton [Sat, 19 Oct 2019 12:52:54 +0000 (13:52 +0100)]
meson: use gir_init_section in GstTranscoder

GstTranscoder adds extra_args for gir which call gst_init() during
introspection. These extra arguments are the same as the standard
ones defined in the top level meson.build as "git_init_section",
However, the top level definition also ensures an empty plugin
repository is used.

Because GstTranscoder does not use the standard args, plugins get
loaded when it is introspected. Since some of the plugins fail
without specific hardware, this causes #1100.

This patch makes it use gir_init_section.

Fixes #1100.

4 years agomeson: build gir even when cross-compiling if introspection was enabled explicitly
Tim-Philipp Müller [Thu, 17 Oct 2019 23:39:12 +0000 (00:39 +0100)]
meson: build gir even when cross-compiling if introspection was enabled explicitly

This can be made to work in certain circumstances when
cross-compiling, so default to not building g-i stuff
when cross-compiling, but allow it if introspection was
enabled explicitly via -Dintrospection=enabled.

See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.

4 years agowpesrc: Implement load-bytes action signal
Philippe Normand [Tue, 24 Sep 2019 23:57:54 +0000 (16:57 -0700)]
wpesrc: Implement load-bytes action signal

4 years agowpe: Rewrite wpesrc as a glbasesrc subclass
Philippe Normand [Wed, 7 Aug 2019 16:07:21 +0000 (17:07 +0100)]
wpe: Rewrite wpesrc as a glbasesrc subclass

And since it no longer allocates memories itself, this fixes issues with
fakevideosink. A lot of code previously copied from gltestsrc is no longer
needed thanks to the glbasesrc super-class.

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

4 years agoFix get_supported_types function name
Javier Celaya [Wed, 9 Oct 2019 12:55:55 +0000 (14:55 +0200)]
Fix get_supported_types function name

4 years agoFix releasing local refs
Javier Celaya [Wed, 9 Oct 2019 12:55:29 +0000 (14:55 +0200)]
Fix releasing local refs

4 years agoFix names of MediaCodecInfo inner classes
Javier Celaya [Wed, 9 Oct 2019 12:55:05 +0000 (14:55 +0200)]
Fix names of MediaCodecInfo inner classes

4 years agoFix getting MediaCodecList static methods
Javier Celaya [Wed, 9 Oct 2019 12:54:24 +0000 (14:54 +0200)]
Fix getting MediaCodecList static methods

4 years agomsdkenc: close encoder upon bitrate change
Julien Isorce [Fri, 11 Oct 2019 16:51:24 +0000 (09:51 -0700)]
msdkenc: close encoder upon bitrate change

Upon bitrate change, make sure to close the encoder otherwise
the encoder is not re-initialized and the target bitrate is
never reached, and the encoder was flushed at each frame
from this moment.

Regression introduced in f2b35abcab which replaced the call
that was closing the encoder by an early return to avoid
re-initialization.

4 years agowasapi: Fix build warnings
Seungha Yang [Tue, 17 Sep 2019 11:32:18 +0000 (20:32 +0900)]
wasapi: Fix build warnings

gstwasapiutil.c(173) : warning C4715: 'gst_wasapi_device_role_to_erole': not all control paths return a value
gstwasapiutil.c(188) : warning C4715: 'gst_wasapi_erole_to_device_role': not all control paths return a value

4 years agowasapi: Don't cast GstDeviceProvider to GstElement
Seungha Yang [Tue, 17 Sep 2019 11:29:03 +0000 (20:29 +0900)]
wasapi: Don't cast GstDeviceProvider to GstElement

The GstDeviceProvider isn't subclass of GstElement.

(gst-device-monitor-1.0:49356): GLib-GObject-WARNING **: 20:21:18.651:
invalid cast from 'GstWasapiDeviceProvider' to 'GstElement'

4 years agoRemove autotools build system
Tim-Philipp Müller [Sun, 13 Oct 2019 13:22:50 +0000 (14:22 +0100)]
Remove autotools build system

4 years agodecklink: fix timestamp tracking when pausing
Matthew Waters [Mon, 14 Oct 2019 07:22:18 +0000 (02:22 -0500)]
decklink: fix timestamp tracking when pausing

play->pause->sleep()->play would result in late frames being scheduled

4 years agocodecparsers: h264: record pic_order_cnt elements size
Philipp Zabel [Wed, 4 Sep 2019 14:48:29 +0000 (16:48 +0200)]
codecparsers: h264: record pic_order_cnt elements size

Some hardware decoders, for example Hantro G1, have to be told the
size of the pic_order_cnt related syntax elements pic_order_cnt_lsb,
delta_pic_order_cnt_bottom, delta_pic_order_cnt[0], and
delta_pic_order_cnt[1] in bits.

4 years agocodecparsers: h264: record dec_ref_pic_marking() size
Philipp Zabel [Wed, 4 Sep 2019 13:57:30 +0000 (15:57 +0200)]
codecparsers: h264: record dec_ref_pic_marking() size

Some hardware decoders, for example Hantro G1, have to be told the size
of the dec_ref_pic_marking() syntax element in bits. Record the size so
it can be passed on to the hardware.

4 years agoh265parser: Calculate short term RPS size in slice header
Seungha Yang [Fri, 20 Sep 2019 11:14:57 +0000 (20:14 +0900)]
h265parser: Calculate short term RPS size in slice header

The calculated size of short_term_ref_pic_set is not a part of
HEVC syntax but the value is used by some stateless decoders
(e.g., vaapi, dxva, vdpau and nvdec) for the purpose of skipping
parsing the syntax by the accelerator.

4 years agoh265parser: Add H265 slice segment header documentation
Seungha Yang [Mon, 7 Oct 2019 01:36:37 +0000 (10:36 +0900)]
h265parser: Add H265 slice segment header documentation

Adding brief description for each value.

4 years agoh264parser: Expose parsed GstH264PPS::pic_scaling_matrix_present_flag
Seungha Yang [Wed, 11 Sep 2019 08:59:37 +0000 (17:59 +0900)]
h264parser: Expose parsed GstH264PPS::pic_scaling_matrix_present_flag

4 years agoh264parser: Expose all parsed flags of slice header
Seungha Yang [Tue, 27 Aug 2019 11:34:48 +0000 (20:34 +0900)]
h264parser: Expose all parsed flags of slice header

Add num_ref_idx_active_override_flag and sp_for_switch_flag to
member of GstH264SliceHdr. No reason to hiding them and
some decoder implementations (e.g., DXVA) rely on externally parsed header
data which can be provided by h264parser.

4 years agomsdk: return the right pointer
Haihao Xiang [Wed, 9 Oct 2019 06:00:01 +0000 (14:00 +0800)]
msdk: return the right pointer

The first channel in memory for MFX_FOURCC_RGB4 (VA_FOURCC_ARGB or
GST_VIDEO_FORMAT_BGRA) is B, not A. In MSDK, channle B is used to access
data for RGB4 surface. In addition, the returned pointers for
MFX_FOURCC_AYUV and MFX_FOURCC_Y410 in gst_msdk_video_memory_map_full
were wrong too before this fix.

4 years agomsdkenc: handle bitrate changes in playing state
Josep Torra [Mon, 7 Oct 2019 15:39:06 +0000 (08:39 -0700)]
msdkenc: handle bitrate changes in playing state

When the bitrate is changed in playing state the encoder issues a reconfig
that drains and recreates the underlaying hw encoder instance.
With this set of changes we ensure that all this work is only made when
the bitrate did actually change. It also tries to reuse the vpp buffer
pool and fixes the pool leak spotted when testing this feature.

4 years agoext: add libmicrodns-based mdns device provider
Mathieu Duponchelle [Mon, 16 Sep 2019 23:52:54 +0000 (01:52 +0200)]
ext: add libmicrodns-based mdns device provider

The provider for now only detects and handles rtsp devices, but
more protocols should be easy to add.

4 years agomsdkh265enc: add the missing profile string
Haihao Xiang [Tue, 8 Oct 2019 01:40:06 +0000 (09:40 +0800)]
msdkh265enc: add the missing profile string

4 years agohlssink2: Respect requested max-files property for decision on removing old fragments...
Seungha Yang [Mon, 7 Oct 2019 05:21:58 +0000 (14:21 +0900)]
hlssink2: Respect requested max-files property for decision on removing old fragments from disk

hlssink2 defined "max-files" property to decide the maximum number
of fragments which should be stored in disk. But we've not used
the property. Instead, the size has been maintained by "playlist-length".
Since "max-files" and "playlist-length" have different meaning,
the decision should be done by "max-files" property.

For example, an user might want expose only 3 fragments via playlist
but might want to keep more files than 3 in disk.