platform/upstream/gstreamer.git
4 years agoflvmux: Return NEED_DATA when we drop a buffer
Vivia Nikolaidou [Mon, 10 Aug 2020 17:20:53 +0000 (20:20 +0300)]
flvmux: Return NEED_DATA when we drop a buffer

When we are dropping a buffer in find_best_pad (e.g. waiting for a
keyframe, or skipping backwards timestamp), return
GST_AGGREGATOR_FLOW_NEED_DATA to make sure we have enough data at the
next run. Otherwise, a stream that accidentally fell behind (e.g.
relinking race, or just waiting for a keyframe) will never get the
opportunity to catch up to the other one, because the other one will
always keep advancing.

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

4 years agoflvmux: Return NEED_DATA when no best pad is found
Vivia Nikolaidou [Mon, 10 Aug 2020 17:20:04 +0000 (20:20 +0300)]
flvmux: Return NEED_DATA when no best pad is found

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

4 years agoflvmux: Fix possible crash on GST_ITERATOR_RESYNC
Vivia Nikolaidou [Mon, 10 Aug 2020 17:17:38 +0000 (20:17 +0300)]
flvmux: Fix possible crash on GST_ITERATOR_RESYNC

Wrong pointer type

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

4 years agoqmlgloverlay: fix multiple elements with Qt 5.15
Matthew Waters [Mon, 10 Aug 2020 05:49:55 +0000 (15:49 +1000)]
qmlgloverlay: fix multiple elements with Qt 5.15

With Qt 5.15 multiple qmlgloverlay elements would produce:

ASSERT: "!m_gl->property(QSG_RENDERCONTEXT_PROPERTY).isValid()" in file /path/to/qt5/qtdeclarative/src/quick/scenegraph/qsgdefaultrendercontext.cpp, line 121

Workaround by setting the (seeminigly unused) property before
initialization.

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

4 years agortph26[45]pay: Change default aggregate-mode to "none" for backwards compatibility
Sebastian Dröge [Wed, 5 Aug 2020 07:41:33 +0000 (10:41 +0300)]
rtph26[45]pay: Change default aggregate-mode to "none" for backwards compatibility

We didn't aggregate at all in previous versions and there are apparently
various RTP implementations that don't handle aggregation well at all.

As part of this also document that for RTSP it is recommended to keep it
set to "none" while for WebRTC it should be set to "zero-latency".

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

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

4 years agobuild: update for gl pkg-config file split
Matthew Waters [Fri, 24 Jul 2020 06:58:34 +0000 (16:58 +1000)]
build: update for gl pkg-config file split

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

4 years agosplitmuxsink: Make sure flushing doesn't block
Jan Alexander Steffens (heftig) [Fri, 31 Jul 2020 11:50:13 +0000 (13:50 +0200)]
splitmuxsink: Make sure flushing doesn't block

* Trying to disconnect a stream from a running splitmuxsink by flushing
  it results in the FLUSH_START blocking in the stream queue's
  gst_pad_pause_task because the flush did not unblock
  complete_or_wait_on_out, so add a check for ctx->flushing there.

* Add a GST_SPLITMUX_BROADCAST_INPUT so check_completed_gop notices
  flushing changed and the incoming push is unblocked.

* Pass the FLUSH_STOP along to the muxer without waiting.

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

4 years agoimagefreeze: Wait until we have a clock
Vivia Nikolaidou [Tue, 4 Aug 2020 12:49:43 +0000 (15:49 +0300)]
imagefreeze: Wait until we have a clock

Otherwise it can happen that it tries to get the clock in PAUSED state
in live mode, which does not exist.

Thanks to Sebastian Dröge for helping debugging.

Fixes #775

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

4 years agoqtdemux: extract bit depth from codec data for ALAC
Tim-Philipp Müller [Fri, 31 Jul 2020 10:05:02 +0000 (11:05 +0100)]
qtdemux: extract bit depth from codec data for ALAC

The info in the sound sample description might not be
accurate if it's an older version atom.

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

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

4 years agoauparse: fix compiler warnings
Jordan Petridis [Tue, 28 Jul 2020 15:46:30 +0000 (18:46 +0300)]
auparse: fix compiler warnings

GCC 10 was complaining like following. It really is complaining about default cases returning
with potentially unitialized *desval, but those cases in the switch should never be hit.

```
 ../subprojects/gst-plugins-good/gst/auparse/gstauparse.c: In function 'gst_au_parse_chain':
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:481:37: error: 'timestamp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  481 |       GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:482:36: error: 'duration' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  482 |       GST_BUFFER_DURATION (outbuf) = duration;
../subprojects/gst-plugins-good/gst/auparse/gstauparse.c:480:34: error: 'offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  480 |       GST_BUFFER_OFFSET (outbuf) = offset;
cc1: all warnings being treated as errors
```

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

4 years agortspsrc: drop stream-start message posted by the internal udp sink(s)
George Kiagiadakis [Wed, 29 Jul 2020 11:06:55 +0000 (14:06 +0300)]
rtspsrc: drop stream-start message posted by the internal udp sink(s)

See #1368

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

4 years agotests: qtdemux: test correct pad names are created
Hosang Lee [Wed, 22 Jul 2020 07:24:15 +0000 (16:24 +0900)]
tests: qtdemux: test correct pad names are created

Test correct pad names are created in accordance to their media type
in mss mode.

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

4 years agoqtdemux: create correct pad names in encrypted streams
Hosang Lee [Tue, 16 Jun 2020 08:23:44 +0000 (17:23 +0900)]
qtdemux: create correct pad names in encrypted streams

Refer to "original-media-type" when setting stream's subtype
for encrypted streams in mss mode.

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

4 years agomatroskamux: Do caps renegotiation when it only adds fields
Thibault Saunier [Wed, 22 Jul 2020 18:31:13 +0000 (14:31 -0400)]
matroskamux: Do caps renegotiation when it only adds fields

Matroskamux can accept caps renegotiation if the new caps is a
superset of the old one, meaning upstream added new info to
the caps.

Same logic as a5f22f03aa25b04726f78ae619f40b3b648f7d48 in qtmux.

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

4 years agortpfunnel: protect internal srccaps with lock
Tim-Philipp Müller [Fri, 24 Jul 2020 13:02:26 +0000 (14:02 +0100)]
rtpfunnel: protect internal srccaps with lock

These are modified from sink pad event handlers, so
could be accessed from multiple threads at the same
time.

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

4 years agortpfunnel: copy caps before sending them in a caps-event
Havard Graff [Sun, 23 Feb 2020 22:44:16 +0000 (23:44 +0100)]
rtpfunnel: copy caps before sending them in a caps-event

Reason being we don't want downstream to own a ref to our
internal caps.

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

4 years agortpmanager: fix various documentation issues
Mathieu Duponchelle [Mon, 27 Jul 2020 13:41:26 +0000 (15:41 +0200)]
rtpmanager: fix various documentation issues

Improper naming of properties, improper links, misc

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

4 years agorpicamsrc: hypothetical fix for data pointer calculation
Tim-Philipp Müller [Fri, 24 Jul 2020 16:13:04 +0000 (17:13 +0100)]
rpicamsrc: hypothetical fix for data pointer calculation

mmal buffer header docs say data is valid for length bytes
from offset. In practice offset always seems to be 0 so
far though.

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

4 years agorpicamsrc: mark buffers as header and keyframe/delta-unit
Tim-Philipp Müller [Fri, 24 Jul 2020 15:35:43 +0000 (16:35 +0100)]
rpicamsrc: mark buffers as header and keyframe/delta-unit

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

4 years agorpicamsrc: fix nal alignment of output buffers
Tim-Philipp Müller [Fri, 24 Jul 2020 15:14:00 +0000 (16:14 +0100)]
rpicamsrc: fix nal alignment of output buffers

We claim output buffers are nal-aligned, but that wasn't
actually true: We would push out a partial nal in case
the nal doesn't fit into the max encoder-selected output
buffer size, and then the next buffer would not start
with a sync marker. That's not right and makes h264parse
unhappy.

Instead accumulate buffers until we have a full frame
(we can't rely on the NAL_END flag, it's always set).

Fixes #768

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

4 years agorpicamsrc: fix "Could not find component vc.ril.camera" on recent raspios
Tim-Philipp Müller [Mon, 13 Jul 2020 22:43:48 +0000 (23:43 +0100)]
rpicamsrc: fix "Could not find component vc.ril.camera" on recent raspios

Make extra sure all the required mmal libs such as libmmal_vc_client.so
actually get linked and stay linked. Otherwise the above error happens
it seems.

buster (10.4) with meson 0.55 and pi ref 2020-05-27
pi-gen, 825107f04027269db77426046f5085475b1ea22f, stage5

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

4 years agorpicamsrc: deviceprovider: hook up i18n properly
Tim-Philipp Müller [Mon, 13 Jul 2020 16:01:42 +0000 (17:01 +0100)]
rpicamsrc: deviceprovider: hook up i18n properly

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

4 years agorpicamsrc: deviceprovider: advertise (M)JPEG as well
Tim-Philipp Müller [Mon, 13 Jul 2020 15:55:48 +0000 (16:55 +0100)]
rpicamsrc: deviceprovider: advertise (M)JPEG as well

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

4 years agorpicamsrc: deviceprovider: also advertise constrained-baseline profile
Tim-Philipp Müller [Mon, 13 Jul 2020 15:50:58 +0000 (16:50 +0100)]
rpicamsrc: deviceprovider: also advertise constrained-baseline profile

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

4 years agomeson: add a plugin summary
Stéphane Cerveau [Thu, 23 Jul 2020 14:58:00 +0000 (16:58 +0200)]
meson: add a plugin summary

This summary displays a list of plugins which
have been enabled.

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

4 years agov4l2: enhance v4l2 control interface to support string type CID
Haihua Hu [Wed, 22 Jul 2020 01:46:47 +0000 (09:46 +0800)]
v4l2: enhance v4l2 control interface to support string type CID

add string type cid support for v4l2 implementation

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

4 years agoqtdemux: add Dolby Vision fourcc
Stéphane Cerveau [Wed, 1 Jul 2020 13:17:47 +0000 (15:17 +0200)]
qtdemux: add  Dolby Vision fourcc

This identifiers are registered in the MPEG-RA and defined
to be used by the Dolby Vision AVC/HEVC streams.

This is a first step to present the stream to the decoder.
Additional box parsing of DOVIConfigurationBox is necessary
to complete the media presentation with proper Dolby Vision
enhancements.

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

4 years agoimagefreeze: Copy GstCapsFeatures to caps for source pad
Luke Yelavich [Sun, 17 May 2020 05:51:09 +0000 (15:51 +1000)]
imagefreeze: Copy GstCapsFeatures to caps for source pad

Allows using imagefreeze with buffers in GLMemory. The following pipeline
works.

gst-launch-1.0 filesrc location=image.jpg ! jpegdec ! glupload ! \
imagefreeze ! glcolorconvert ! glimagesinkelement

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

4 years agortpmanager: fix "redefinition of typedef RTPTWCCManager" compiler warning
Tim-Philipp Müller [Mon, 20 Jul 2020 17:20:59 +0000 (18:20 +0100)]
rtpmanager: fix "redefinition of typedef RTPTWCCManager" compiler warning

G_DECLARE_FINAL_TYPE includes this typedef as well.

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

4 years agortp*pay: Allocate using the base class for audio codecs
Olivier Crête [Fri, 17 Jul 2020 20:39:25 +0000 (16:39 -0400)]
rtp*pay: Allocate using the base class for audio codecs

This is required to add RTP header extensions from the
meta automatically.

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

4 years agortspsrc: Fix segfault with illegal free
Ognyan Tonchev [Tue, 14 Jul 2020 11:14:09 +0000 (13:14 +0200)]
rtspsrc: Fix segfault with illegal free

set_get_param_q is not a pointer so it is illegal to call g_queue_free_full().
Freeing the requests by popping them from the queue instead.

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

4 years agoQtGLVideoItem: Use QSharedPointer::data() for better compatibility
Raul Tambre [Wed, 15 Jul 2020 11:40:42 +0000 (14:40 +0300)]
QtGLVideoItem: Use QSharedPointer::data() for better compatibility

Older Qt versions didn't have QSharedPointer::get(), which is just a modern alias for QSharedPointer::data().

FAILED: ext/qt/libgstqmlgl.so.p/qtitem.cc.o
c++ -Iext/qt/libgstqmlgl.so.p -Iext/qt -I../ext/qt -I. -I.. -I../gst-libs -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -I/usr/include/gstreamer-1.0 -I/usr/include/orc-0.4 -I/usr/lib/aarch64-linux-gnu/gstreamer-1.0/include -I/usr/include/aarch64-linux-gnu/qt5/QtCore -I/usr/include/aarch64-linux-gnu/qt5 -I/usr/include/aarch64-linux-gnu/qt5/QtGui -I/usr/include/aarch64-linux-gnu/qt5/QtQml -I/usr/include/aarch64-linux-gnu/qt5/QtNetwork -I/usr/include/aarch64-linux-gnu/qt5/QtQuick -I/usr/include/aarch64-linux-gnu/qt5/QtX11Extras -I/usr/include/libdrm -flto -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++11 -Wmissing-declarations -Wredundant-decls -Wwrite-strings -Winit-self -Wmissing-include-dirs -Wno-multichar -Wvla -Wpointer-arith -g -fdebug-prefix-map=/opt/good/src=. -Wformat -Werror=format-security -O3 -march=native -Wno-error -Wdate-time -fPIC -pthread -DHAVE_CONFIG_H -DHAVE_QT_X11 -DHAVE_QT_EGLFS -MD -MQ ext/qt/libgstqmlgl.so.p/qtitem.cc.o -MF ext/qt/libgstqmlgl.so.p/qtitem.cc.o.d -o ext/qt/libgstqmlgl.so.p/qtitem.cc.o -c ../ext/qt/qtitem.cc
In file included from /usr/include/gstreamer-1.0/gst/gst.h:55:0,
                 from /usr/include/gstreamer-1.0/gst/video/video.h:23,
                 from ../ext/qt/qtitem.cc:27:
../ext/qt/qtitem.cc: In destructor ‘virtual QtGLVideoItem::~QtGLVideoItem()’:
../ext/qt/qtitem.cc:138:86: error: ‘class QSharedPointer<QtGLVideoItemInterface>’ has no member named ‘get’
   GST_INFO ("%p Destroying QtGLVideoItem and invalidating the proxy %p", this, proxy.get());
                                                                                      ^
/usr/include/gstreamer-1.0/gst/gstinfo.h:682:31: note: in definition of macro ‘GST_CAT_LEVEL_LOG’
         (GObject *) (object), __VA_ARGS__);    \
                               ^~~~~~~~~~~
../ext/qt/qtitem.cc:138:3: note: in expansion of macro ‘GST_INFO’
   GST_INFO ("%p Destroying QtGLVideoItem and invalidating the proxy %p", this, proxy.get());
   ^

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

4 years agoqtdemux: fix allocation explosion with stsd entries
Justin Chadwell [Tue, 14 Jul 2020 13:24:20 +0000 (14:24 +0100)]
qtdemux: fix allocation explosion with stsd entries

Previously, the user input for stsd entries is trusted completely, and
so a maliciously crafted file could choose the length of the stsd
entries arbitrarily and cause qtdemux to try to allocate up to 2GB of
memory (half of a 32 bit max int).

This patch fixes this by sanity checking the stsd input against the
size of the entire stsd atom.

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

4 years agoqtdemux: fix crashes when input stream contained no stsd entries
Justin Chadwell [Mon, 13 Jul 2020 09:37:19 +0000 (10:37 +0100)]
qtdemux: fix crashes when input stream contained no stsd entries

During trak parsing, we need to check for the existence of stsd_entries,
otherwise, we end up with a NULL pointer to them. It is entirely
possible for the stsd to exist, but for it to have no entries, which the
previous checks did not take into account.

This patch adds a simply check to ensure that all files that do not
contain a stsd entry are deemed corrupt, and adds a test case to prevent
a regression.

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

4 years agodocs: update for new pixel formats
Tim-Philipp Müller [Wed, 15 Jul 2020 11:40:17 +0000 (12:40 +0100)]
docs: update for new pixel formats

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/753
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/754

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

4 years agorpicamsrc: fix build with older meson versions
Tim-Philipp Müller [Fri, 10 Jul 2020 20:43:14 +0000 (21:43 +0100)]
rpicamsrc: fix build with older meson versions

assert() used to require two arguments.

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

4 years agoexamples: hook up rpicamsrc examples
Tim-Philipp Müller [Fri, 10 Jul 2020 13:08:55 +0000 (13:08 +0000)]
examples: hook up rpicamsrc examples

webrtc one should probably go into gst-examples.

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

4 years agoexamples: fix indentation of rpicamsrc examples
Tim-Philipp Müller [Thu, 9 Jul 2020 23:42:13 +0000 (00:42 +0100)]
examples: fix indentation of rpicamsrc examples

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

4 years agorpicamsrc: flesh out docs and add to plugin docs cache
Tim-Philipp Müller [Thu, 9 Jul 2020 19:08:34 +0000 (19:08 +0000)]
rpicamsrc: flesh out docs and add to plugin docs cache

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

4 years agorpicamsrc: enable video orientation/direction unconditionally
Tim-Philipp Müller [Thu, 9 Jul 2020 18:04:10 +0000 (18:04 +0000)]
rpicamsrc: enable video orientation/direction unconditionally

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

4 years agorpicamsrc: remove mkenums template files which are no longer needed
Tim-Philipp Müller [Thu, 9 Jul 2020 17:37:01 +0000 (17:37 +0000)]
rpicamsrc: remove mkenums template files which are no longer needed

They were still being used by the autotools build, but that's gone.

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

4 years agorpicamsrc: fix indentation
Tim-Philipp Müller [Thu, 9 Jul 2020 17:35:15 +0000 (17:35 +0000)]
rpicamsrc: fix indentation

Not touching the Raspi* files.

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

4 years agorpicamsrc: fix and silence some compiler warnings
Tim-Philipp Müller [Thu, 9 Jul 2020 17:31:49 +0000 (17:31 +0000)]
rpicamsrc: fix and silence some compiler warnings

Some are in system headers, and in Raspi files we want
to keep modifications to a minimum.

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

4 years agorpicamsrc: hook up to build
Tim-Philipp Müller [Thu, 9 Jul 2020 16:07:30 +0000 (16:07 +0000)]
rpicamsrc: hook up to build

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

4 years agoMerge branch 'plugin-move-rpicamsrc'
Tim-Philipp Müller [Thu, 9 Jul 2020 11:46:30 +0000 (11:46 +0000)]
Merge branch 'plugin-move-rpicamsrc'

Move rpicamsrc from https://github.com/thaytan/gst-rpicamsrc/

It's a useful little element and works well, so might as well
make sure it's widely available so people can stop piping
raspivid output into fdsrc.

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

4 years agorpicamsrc: sync autotools with glib-mkenum usage in meson build
Tim-Philipp Müller [Sat, 2 May 2020 19:27:20 +0000 (19:27 +0000)]
rpicamsrc: sync autotools with glib-mkenum usage in meson build

4 years agorpicamsrc: meson: use gnome.glib_mkenums_simple() and fix build as Meson subproject
Tim-Philipp Müller [Sat, 2 May 2020 18:28:10 +0000 (18:28 +0000)]
rpicamsrc: meson: use gnome.glib_mkenums_simple() and fix build as Meson subproject

While at it also fix up the type defines, e.g.
GST_RPI_CAM_TYPE_RPI_CAM_SRC_EXPOSURE_MODE -> GST_RPI_CAM_SRC_TYPE_EXPOSURE_MODE

4 years agorpicamsrc: meson: drop map file and fix plugin symbol export with newer gstreamer...
Tim-Philipp Müller [Sun, 3 May 2020 11:09:47 +0000 (11:09 +0000)]
rpicamsrc: meson: drop map file and fix plugin symbol export with newer gstreamer versions

Use -fvisibility instead of a map file for symbol export, so that
the right symbols get exported with newer gstreamer versions. Older
GStreamer versions also still work of course.

Fixes blacklisting/plugin-loading issues with GStreamer >= 1.14

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/984,
closes https://github.com/thaytan/gst-rpicamsrc/issues/94
and https://github.com/thaytan/gst-rpicamsrc/issues/67

4 years agorpicamsrc: Attempt to workaround MMAL timeout bug
Jan Schmidt [Mon, 16 Jul 2018 09:49:21 +0000 (19:49 +1000)]
rpicamsrc: Attempt to workaround MMAL timeout bug

mmal_queue_timedwait() might spuriously return immediately
if called at exactly the wrong instant due to an internal
off-by-one bug. Attempt to work around that and just retry.

4 years agorpicamsrc: Improve timeout error
Jan Schmidt [Mon, 16 Jul 2018 09:30:26 +0000 (19:30 +1000)]
rpicamsrc: Improve timeout error

Propagate timeout errors so they're not reported
generically

4 years agorpicamsrc: webrtc example: Add a STUN server to the configuration
Jan Schmidt [Thu, 21 Jun 2018 12:50:28 +0000 (22:50 +1000)]
rpicamsrc: webrtc example: Add a STUN server to the configuration

To let the webrtc example work through NAT firewalls

4 years agorpicamsrc: webrtc example: Modify HTML to support other ports than 57778
Jan Schmidt [Thu, 21 Jun 2018 12:44:25 +0000 (22:44 +1000)]
rpicamsrc: webrtc example: Modify HTML to support other ports than 57778

4 years agorpicamsrc: webrtc example: Remove external fmtp insertion
Jan Schmidt [Thu, 21 Jun 2018 11:45:32 +0000 (21:45 +1000)]
rpicamsrc: webrtc example: Remove external fmtp insertion

GStreamer 1.14.2 should contain the backport of gst-plugins-bad
commit 5c450c5 adding FEC and RTX support, and incidentally
the fmtp field in the SDP

4 years agorpicamsrc: webrtc example: Set the locale
Jan Schmidt [Thu, 21 Jun 2018 10:33:03 +0000 (20:33 +1000)]
rpicamsrc: webrtc example: Set the locale

Make the date format in the overlay respect the current
locale

4 years agorpicamsrc: Don't destroy the camera component on startup error
Jan Schmidt [Wed, 20 Jun 2018 15:36:42 +0000 (15:36 +0000)]
rpicamsrc: Don't destroy the camera component on startup error

Just disable the camera component when it fails to start. The
most common reason is that the camera device is already in use,
and if we just disable the mmal component correct cleanup
will happen later

4 years agorpicamsrc: Add webrtc streaming example
Jan Schmidt [Sat, 12 May 2018 21:13:52 +0000 (21:13 +0000)]
rpicamsrc: Add webrtc streaming example

Add an example for testing webrtc streaming from the rpi
camera, based on the code from
https://bugzilla.gnome.org/show_bug.cgi?id=795404

Requires GStreamer 1.14.1 or git master

4 years agorpicamsrc: Expose constrained-baseline profile
Jan Schmidt [Sat, 12 May 2018 19:57:43 +0000 (19:57 +0000)]
rpicamsrc: Expose constrained-baseline profile

constrained-baseline is a useful profile for streaming to iOS
devices, and seems to work in the firmware, so let's publish it

4 years agorpicamsrc: Add define and increase reported maximum FPS from 90 to 1000
Jan Schmidt [Wed, 28 Mar 2018 11:00:10 +0000 (22:00 +1100)]
rpicamsrc: Add define and increase reported maximum FPS from 90 to 1000

4 years agorpicamsrc: Expand frame timeout from 100ms to 500ms
Jan Schmidt [Tue, 14 Nov 2017 04:01:21 +0000 (15:01 +1100)]
rpicamsrc: Expand frame timeout from 100ms to 500ms

rpicamsrc on a normal rpi camera doesn't start up fast enough,
and always fails the new 100ms timeout. A better solution
might be to have a longer timeout for the first frame, but
shorter once frames are running - but this quick fix will at
least make rpicamsrc work again.

4 years agorpicamsrc: RaspiCapture: use mmal_queue_timedwait() for buffer queueing
Georgii Staroselskii [Wed, 8 Nov 2017 09:14:35 +0000 (09:14 +0000)]
rpicamsrc: RaspiCapture: use mmal_queue_timedwait() for buffer queueing

If an external camera was disconnected, there were no feedback in an
application. It seems reasonable to wait on mmal_queue no longer than
100ms. If it's stuck we just return a FLOW_ERROR and let the application
decide what to do later.

4 years agorpicamsrc: RaspiCapture: handle MMAL_EVENT_ERROR
Georgii Staroselskii [Tue, 7 Nov 2017 15:14:06 +0000 (15:14 +0000)]
rpicamsrc: RaspiCapture: handle MMAL_EVENT_ERROR

4 years agorpicamsrc: Implement use-stc property to disable STC timestamps
Jan Schmidt [Fri, 30 Jun 2017 14:51:13 +0000 (00:51 +1000)]
rpicamsrc: Implement use-stc property to disable STC timestamps

If use-stc=false, then rpicamsrc won't apply
the camera timestamping to outgoing buffers, instead
relying on real-time timestamping by the
GStreamer clock. It means slightly less accuracy
and more jitter in timestamps, but might help on some
CSI inputs with broken timestamping.

4 years agorpicamsrc: Fix the descriptions of text annotation colour properties
Jan Schmidt [Fri, 19 May 2017 10:55:35 +0000 (20:55 +1000)]
rpicamsrc: Fix the descriptions of text annotation colour properties

The text annotation colour properties take an integer value
corresponding to a VUY colour, not a text string like
the copy-pasted description from raspivid suggests.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/59

4 years agorpicamsrc: Implement dynamic bitrate update
Jan Schmidt [Fri, 27 Jan 2017 01:58:29 +0000 (12:58 +1100)]
rpicamsrc: Implement dynamic bitrate update

Use mmal_port_set_parameter_uint32 to update the encoder
bitrate.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/60

4 years agorpicamsrc: Set outgoing buffer durations based on negotiated framerate.
Jan Schmidt [Sat, 8 Oct 2016 11:12:09 +0000 (11:12 +0000)]
rpicamsrc: Set outgoing buffer durations based on negotiated framerate.

make sure outgoing buffers have at least some duration set,
otherwise it leads to strange situations, like qtmux writing
out a file that doesn't include the final frame inside the
playable segment, because no-duration = 0 duration there.

4 years agorpicamsrc: Destroy mmal pool on shutdown always.
Jan Schmidt [Sat, 8 Oct 2016 11:10:30 +0000 (11:10 +0000)]
rpicamsrc: Destroy mmal pool on shutdown always.

Avoid hangs on the next run because we didn't clean up the mmal pool
last time we shutdown.

4 years agorpicamsrc: Switch back to MJPEG codec for image/jpeg
Jan Schmidt [Mon, 3 Oct 2016 15:29:49 +0000 (15:29 +0000)]
rpicamsrc: Switch back to MJPEG codec for image/jpeg

The JPEG codec hangs, not sure why yet. The MJPEG
codec doesn't provide a quality setting, and sometimes
freezes on shutdown, but otherwise seems more
reliable

4 years agorpicamsrc: Don't try and set H264 params with JPEG codec
Jan Schmidt [Mon, 3 Oct 2016 14:00:54 +0000 (14:00 +0000)]
rpicamsrc: Don't try and set H264 params with JPEG codec

4 years agorpicamsrc: First attempt at implementing MJPEG and raw video support
Jan Schmidt [Sun, 2 Oct 2016 15:34:50 +0000 (02:34 +1100)]
rpicamsrc: First attempt at implementing MJPEG and raw video support

4 years agorpicamsrc: Add experimental build using the Meson build system
Tim-Philipp Müller [Mon, 19 Sep 2016 12:06:05 +0000 (12:06 +0000)]
rpicamsrc: Add experimental build using the Meson build system

Builds in about 10 seconds vs. 77 seconds with autotools.

4 years agorpicamsrc: Implement GstVideoDirection interface
Xabier Rodriguez Calvar [Tue, 30 Aug 2016 15:00:41 +0000 (17:00 +0200)]
rpicamsrc: Implement GstVideoDirection interface

Instead of implementing a custom property, we implement that interface.

4 years agorpicamsrc: MMAL gives buffers with nal alignment, not AU
Jan Schmidt [Wed, 20 Jul 2016 16:29:57 +0000 (02:29 +1000)]
rpicamsrc: MMAL gives buffers with nal alignment, not AU

Fix the output caps, our buffers are not AU aligned, since
the SPS / PPS are given in separate packets at the start.

4 years agorpicamsrc: Create orientation property
Xabier Rodriguez Calvar [Fri, 8 Jul 2016 13:32:21 +0000 (15:32 +0200)]
rpicamsrc: Create orientation property

Its behavior and choices are analog to the ones present in [gl]videoflip
for the method property.

4 years agorpicamsrc: basesrc event handlers should not unref
Jan Schmidt [Sat, 2 Jan 2016 21:26:23 +0000 (08:26 +1100)]
rpicamsrc: basesrc event handlers should not unref

Don't unref the passed event when handling events via
the GstBaseSrc src pad event handler - basesrc does
the unref. That breaks handling of upstream
force-key-unit events by unreffing twice.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/43

4 years agorpicamsrc: Add property getters for preview window position.
Jan Schmidt [Thu, 17 Dec 2015 03:16:10 +0000 (14:16 +1100)]
rpicamsrc: Add property getters for preview window position.

Add the lines in get_property() for the preview-x/y/w/h properties
so the values can be retrieved without causing critical warnings.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/42

4 years agorpicamsrc: Add preview-x/y/w/h properties
Jan Schmidt [Tue, 1 Dec 2015 14:20:10 +0000 (01:20 +1100)]
rpicamsrc: Add preview-x/y/w/h properties

Expose properties for setting the position of the preview
window on the screen

4 years agorpicamsrc: Add properties for configuring annotation text size and colour.
Jan Schmidt [Wed, 21 Oct 2015 10:11:36 +0000 (21:11 +1100)]
rpicamsrc: Add properties for configuring annotation text size and colour.

Map the raspivid setting for annotation text size and colours
to properties.

4 years agorpicamsrc: Changed awb-gain-blue use the correct enum PROP_AWB_GAIN_BLUE and not...
ibauer [Thu, 8 Oct 2015 08:32:32 +0000 (10:32 +0200)]
rpicamsrc: Changed awb-gain-blue use the correct enum PROP_AWB_GAIN_BLUE and not PROP_AWB_GAIN_RED

4 years agorpicamsrc: Fix buffer PTS calculation
Jan Schmidt [Sat, 18 Jul 2015 15:48:35 +0000 (01:48 +1000)]
rpicamsrc: Fix buffer PTS calculation

Timestamps from MMAL are in microseconds,
so make sure to convert to nanoseconds before
using them to adjust the GStreamer buffer time

4 years agorpicamsrc: Basic orientation interface support
Philippe Normand [Mon, 11 May 2015 09:16:52 +0000 (11:16 +0200)]
rpicamsrc: Basic orientation interface support

The (h,v)flip attributes are now supported through this interface.
It should also be possible to support (h,v)center attributes using the
ROI properties.

4 years agorpicamsrc: Describe awb-mode=off in lowercase
Jan Schmidt [Mon, 11 May 2015 11:29:58 +0000 (21:29 +1000)]
rpicamsrc: Describe awb-mode=off in lowercase

Change the descriptions for the awb-gain-blue and awb-gain-red
properties to say 'awb-mode=off' instead of 'awb-mode=OFF'

See https://github.com/thaytan/gst-rpicamsrc/issues/26

4 years agorpicamsrc: colorbalance: protect with config_lock mutex
Philippe Normand [Mon, 11 May 2015 08:17:18 +0000 (10:17 +0200)]
rpicamsrc: colorbalance: protect with config_lock mutex

4 years agorpicamsrc: add test-color-balance example
Philippe Normand [Tue, 5 May 2015 17:03:43 +0000 (19:03 +0200)]
rpicamsrc: add test-color-balance example

This small test will display a live video preview of the rpicam with
the balance controls being updated once a second. The controls to
update can be disabled in the source by setting the CONTROL_* macros
values to 0.

4 years agorpicamsrc: Implement GstColorBalance interface
Philippe Normand [Wed, 29 Apr 2015 14:36:18 +0000 (16:36 +0200)]
rpicamsrc: Implement GstColorBalance interface

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/24

4 years agorpicamsrc: Fix initial config setting.
Jan Schmidt [Mon, 27 Apr 2015 12:56:32 +0000 (22:56 +1000)]
rpicamsrc: Fix initial config setting.

Make sure to update the captsure config before starting
capture. Since the capture component now keeps a local
copy of the config, it's not updated automatically.

4 years agorpicamsrc: Disable bitrate, quantisation and intra-refresh dynamic changes
Jan Schmidt [Sun, 26 Apr 2015 18:05:42 +0000 (04:05 +1000)]
rpicamsrc: Disable bitrate, quantisation and intra-refresh dynamic changes

The firmware rejects dynamic changes of those encoder params.

4 years agorpicamsrc: Send vcos_log_warn via GStreamer debug messages
Jan Schmidt [Sun, 26 Apr 2015 18:05:04 +0000 (04:05 +1000)]
rpicamsrc: Send vcos_log_warn via GStreamer debug messages

4 years agorpicamsrc: Add dynamic properties example
Jan Schmidt [Sun, 26 Apr 2015 16:43:14 +0000 (02:43 +1000)]
rpicamsrc: Add dynamic properties example

Python example of adjusting saturation on the fly

4 years agorpicamsrc: Update properties dynamically where possible
Jan Schmidt [Sun, 26 Apr 2015 14:54:54 +0000 (00:54 +1000)]
rpicamsrc: Update properties dynamically where possible

Update camera and encoder properties at runtime
where possible

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/19
and https://github.com/thaytan/gst-rpicamsrc/issues/23

4 years agorpicamsrc: split preview config and state
Jan Schmidt [Sun, 26 Apr 2015 14:40:23 +0000 (00:40 +1000)]
rpicamsrc: split preview config and state

4 years agorpicamsrc: Clear intra-refresh MMAL param struct.
Jan Schmidt [Mon, 20 Apr 2015 16:45:59 +0000 (02:45 +1000)]
rpicamsrc: Clear intra-refresh MMAL param struct.

Use memset on the stack allocated MMAL_PARAMETER_VIDEO_INTRA_REFRESH_T
struct. Apparently mmal_port_parameter_get() doesn't retrieve all
parameters, causing random failures when we set the intra-refresh
param on the encoder.

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/22 for me.

4 years agorpicamsrc: Merge changes from userland repo
Jan Schmidt [Mon, 20 Apr 2015 15:17:55 +0000 (01:17 +1000)]
rpicamsrc: Merge changes from userland repo

Current to b69f807ce59189457662c2144a8e7e12dc776988

No integration of stereoscopic support as yet

4 years agorpicamsrc: Map intra-refresh cyclic-rows to the correct MMAL param.
Jan Schmidt [Mon, 20 Apr 2015 14:02:27 +0000 (00:02 +1000)]
rpicamsrc: Map intra-refresh cyclic-rows to the correct MMAL param.

4 years agorpicamsrc: Use MMAL PTS and STC to calculate GStreamer timestamps
Jan Schmidt [Mon, 9 Mar 2015 13:22:40 +0000 (00:22 +1100)]
rpicamsrc: Use MMAL PTS and STC to calculate GStreamer timestamps

Don't apply timestamps based on output time from the encoder,
but use the MMAL STC and capture PTS to generate a GStreamer
timestamp that more accurately resembles the input (and would
preserve reordering should the encoder ever add B-frames).

Fixes https://github.com/thaytan/gst-rpicamsrc/issues/16

4 years agorpicamsrc: Defer encoder creation until after caps are negotiated
Jan Schmidt [Fri, 6 Mar 2015 15:11:25 +0000 (02:11 +1100)]
rpicamsrc: Defer encoder creation until after caps are negotiated

This ensures the encoder is created with the profile
negotiated with downstream

4 years agorpicamsrc: Read and set H.264 profile from negotiated caps
Jan Schmidt [Fri, 6 Mar 2015 14:17:30 +0000 (01:17 +1100)]
rpicamsrc: Read and set H.264 profile from negotiated caps

4 years agorpicamsrc: Add intra-refresh-type property, and set default keyframe spacing to ...
Jan Schmidt [Thu, 5 Mar 2015 16:43:07 +0000 (03:43 +1100)]
rpicamsrc: Add intra-refresh-type property, and set default keyframe spacing to -1 (auto)

This plus other recent commits mostly fix
bug https://github.com/thaytan/gst-rpicamsrc/issues/16

4 years agorpicamsrc: Add annotation-mode and annotation-text properties
Jan Schmidt [Thu, 5 Mar 2015 16:05:24 +0000 (03:05 +1100)]
rpicamsrc: Add annotation-mode and annotation-text properties

4 years agorpicamsrc: implement sensor-mode property
Jan Schmidt [Thu, 5 Mar 2015 15:42:00 +0000 (02:42 +1100)]
rpicamsrc: implement sensor-mode property

4 years agorpicamsrc: More conversion to GStreamer logging
Jan Schmidt [Thu, 5 Mar 2015 14:27:44 +0000 (01:27 +1100)]
rpicamsrc: More conversion to GStreamer logging