summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gst: don't use volatile to mean atomic1.16Matthew Waters2021-06-1712-21/+21
| | | | | | | | | | | | volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1012>
* matroskademux: Fix extraction of multichannel WavPackSebastian Dröge2021-03-152-46/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | The old code had a couple of issues that all lead to potential memory safety bugs. - Use a constant for the Wavpack4Header size instead of using sizeof. It's written out into the data and not from the struct and who knows what special alignment/padding requirements some C compilers have. - gst_buffer_set_size() does not realloc the buffer when setting a bigger size than allocated, it only allows growing up to the maximum allocated size. Instead use a GstAdapter to collect all the blocks and take out everything at once in the end. - Check that enough data is actually available in the input and otherwise handle it an error in all cases instead of silently ignoring it. Among other things this fixes out of bounds writes because the code assumed gst_buffer_set_size() can grow the buffer and simply wrote after the end of the buffer. Thanks to Natalie Silvanovich for reporting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/859 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/904>
* matroskademux: Initialize track context out parameter to NULL before parsingSebastian Dröge2021-03-151-0/+2
| | | | | | | | | | | | | | | Various error return paths don't set it to NULL and callers are only checking if the pointer is NULL. As it's allocated on the stack this usually contains random stack memory, and more often than not the memory of a previously parsed track. This then causes all kinds of memory corruptions further down the line. Thanks to Natalie Silvanovich for reporting. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/858 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/904>
* Release 1.16.31.16.3Tim-Philipp Müller2020-10-216-63/+840
|
* Update docsTim-Philipp Müller2020-10-2172-73/+73
|
* Update translationsTim-Philipp Müller2020-10-215-1076/+1010
|
* Automatic update of common submoduleTim-Philipp Müller2020-10-202-53/+52
| | | | From 59cb678 to a825d27
* rtpjitterbuffer: fix item freeing for 1.16 branchTim-Philipp Müller2020-09-283-1/+20
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/739>
* rtpjitterbuffer: Properly free internal packets queue in finalize()Sebastian Dröge2020-09-282-15/+18
| | | | | | | | | | | | | | | | | | | | | | | 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/739>
* v4l2videodec: Increase internal bitstream pool sizeNicolas Dufresne2020-09-281-1/+4
| | | | | | | | | | | 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 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/738>
* rtspsrc: Don't return TRUE for unhandled querySeungha Yang2020-09-271-2/+3
| | | | | | Expected return value for unhandled query is FALSE Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/752>
* rtspsrc: Avoid stack overflow recursing waiting for responseThibault Saunier2020-09-271-5/+8
| | | | | | | | | 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 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/751>
* rtpbin: fix shutdown crash in rtpbinHavard Graff2020-09-272-13/+76
| | | | | | | | | | | | | | | | | | | | | | | | | The key is to make sure the jitterbuffer is set to NULL *before* the ptdemux. The race that existed would basically happen when ptdemux had reached READY, and the jitterbuffer would then push a buffer, triggering a new pad with a new payloadtype being added and ghosted to the rtpbin itself. However, the srcpad of the ptdemux would now be inactive, and all the sticky-event pushed on it would be swallowed, not allowing any to reach the ghost-pad. Then the buffer in-flight would come to the ghostpad, and we would assert that a buffer arrived before the necessary events. By simply re-ordering the state-changes, we ensure that there will be no buffer racing into the ptdemux while its state is being changed, and the problem disappears completely. Notice also that there is not point in disconnecting the signals on the ptdemux before this point, since we need the push-thread to settle down before we can do this in a non-racy way. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/443>
* jpegdec: check buffer size before dereferencing. Fixes #541Jérôme Laheurte2020-09-251-0/+2
| | | | | | | | Some cameras (Panacast) have buggy drivers/firmware which send invalid JPEG frames, containing no data, which makes jpegdec crash because it assumes the frame is at least 2 bytes long. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/750>
* qtdemux: fix allocation explosion with stsd entriesJustin Chadwell2020-09-252-1/+56
| | | | | | | | | | | | 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/749>
* qtdemux: fix crashes when input stream contained no stsd entriesJustin Chadwell2020-09-252-0/+54
| | | | | | | | | | | | | 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/749>
* flacenc: Pass audio info from set_format() to query_total_samples() explicitlySebastian Dröge2020-09-251-4/+3
| | | | | | | | | | | | | | This fixes writing of the seek table header. gst_audio_encoder_get_audio_info() will still return old/unset audio info until set_format() has actually returned, which then results in query_total_samples() to always return 0. Thanks to Jacob Kauffmann for debugging this and finding the main cause. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/756 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/748>
* pulse: fix discovery of newly added devicesGuillaume Desmottes2020-09-251-2/+0
| | | | | | | | | | | Fix regression introduced in 7bc5e28d85992b03e5852879b8d4d96043496caf preventing the device provider to send the device-added message for new devices. By early returning the patch was discarding add/remove events. Fix #735 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/747>
* Use gst_element_class_set_metadata when passing dynamic stringsJordan Petridis2020-09-252-2/+2
| | | | | | | | | | gst_element_class_set_metadata is meant to only be used with static or inlined strings, which isn't the case for the 2 elements here resulting in use-after-free later on. https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#gst_element_class_set_static_metadata Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/746>
* speex: Fix crash on Windows caused by cross-CRT issueSeungha Yang2020-09-252-2/+3
| | | | | | | | Use speex_header_free() to free memory which was allocated by library. Cross-CRT issue should not happen on 1.17 Cerbero build but might happen custom build or so. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/745>
* rtspsrc: Use the correct type for storing the max-rtcp-rtp-time-diff propertySebastian Dröge2020-09-251-1/+1
| | | | | | | | | | It's an integer property and rtpbin also expects an integer. Passing it as a GstClockTime (guint64) to g_object_set() will cause problems, and on big endian MIPS apparently causes crashes. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/737 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/744>
* rtspsrc: Error out when failling to receive message responseThibault Saunier2020-09-251-0/+18
| | | | | | | | And let it rety twice. Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/717 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/743>
* deinterlace: Force renegotiation when changing modeJan Schmidt2020-09-251-8/+18
| | | | | | | | | | | | 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/742>
* slitmuxsrc: Properly stop the loop if not part reader is presentEdward Hervey2020-09-251-0/+4
| | | | | | Previously this would end up in a refcounting loop of hell. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/741>
* qtdemux: Add 'mp3 ' fourcc that VLC seems to produce nowOlivier Crête2020-09-252-0/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/740>
* jack: Use jack_free(3) to release portsokuoku2020-09-252-5/+5
| | | | | | | | | | | Port objects acquired with jack_get_ports() need to be freed with jack_free(3), not stdlib free(). On Windows, Jack may be linked against different libc than GStreamer libraries so free()ing port objects directly might cause crash because of libc mismatch. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/737>
* flacparse: fix broken reordering of flac metadataJennifer Berringer2020-06-071-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Each FLAC metadata block starts with a flag denoting whether it is the last metadata block. The existing flacparse code moves any existing VORBISCOMMENT block to immediately follow the STREAMINFO block without changing any block's last-metadata-block flag. If no VORBISCOMMENT block exists, it created one with the last-metadata-block flag set to true. This results in gstflacdec sometimes giving bad headers to libflac when trying to play perfectly valid FLAC files depending on the file's metadata ordering. Depending on the contents of the other metadata blocks, current versions of libflac may or may not return FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER when given this broken metadata. This is most noticeable with files that have a large cover art image attached where VORBISCOMMENT is the very last metadata block with no PADDING afterwards. This patch changes that behavior so that: 1. For FLAC files that already have a VORBISCOMMENT block, the metadata order is preserved. 2. For FLAC files that do not have a VORBISCOMMENT block, the generated dummy VORBISCOMMENT is placed immediately after STREAMINFO and inherits the last-metadata-block flag from STREAMINFO. https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/484
* rtpsession: rename RTCP threadNicolas Pernas Maradei2020-06-071-1/+1
| | | | | | | | | 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.
* tests: rtp-payloading: add minimal vp8/vp9 rtp payloading/depayloading testTim-Philipp Müller2020-03-131-0/+52
|
* rtpvp8pay, rtpvp9pay: fix caps leak in set_caps()Stian Selnes2020-03-132-0/+2
|
* videomixer: Don't leak peer capsEdward Hervey2020-03-131-0/+3
|
* rtspsrc: Fix for segmentation fault when handling set/get_parameter requestsAlexander Lapajne2020-02-101-1/+7
| | | | | | | | | | | | | gstrtspsrc uses a queue, set_get_param_q, to store set param and get param requests. The requests are put on the queue by calling get_parameters() and set_parameter(). A thread which executs in gst_rtspsrc_thread() then pops requests from the queue and processes them. The crash occured because the queue became empty and a NULL request object was then used. The reason that the queue became empty is that it was popped even when the thread was NOT processing a get parameter or set parameter command. The fix is to make sure that the queue is ONLY popped when the command being processed is a set parameter or get parameter command.
* v4l2: map GST_VIDEO_FORMAT_BGR15Guillaume Desmottes2020-02-081-0/+4
| | | | The GstVideoFormat to v4l2 conversion was missing for BGR15.
* v4l2: fix crash on invalid capsGuillaume Desmottes2020-02-081-0/+3
| | | | | | gst_v4l2_object_set_format_full() was returning FALSE without setting an error. Caller code (gst_v4l2src_fixate()) was then derefing a NULL pointer when trying to handle the error.
* vp8enc/vp8enc: set 1 for the default value of VP8E_SET_STATIC_THRESHOLDJulien Isorce2020-02-041-3/+6
| | | | | | | | | | | | | | | | | | | | In Google webrtc, the setting VP8E_SET_STATIC_THRESHOLD is set to 1 (except when the content is known to be static very often in which case it is set to 100, i.e. when sharing screen with Google Hangouts). The cpu usage drops a lot when using 1 for above setting because it allows the encoder to skip static/low content blocks. The current 0 default value uses too much cpu and confuses the user regarding the cpu usage expectations. User expects vp8enc to use low cpu by default. Documentation of VP8E_SET_STATIC_THRESHOLD: https://github.com/webmproject/libvpx/blob/master/vpx/vp8cx.h#L188 chromium/webrtc: https://chromium.googlesource.com/external/webrtc/+/b484ec0082948ae086c2ba4142b4d2bf8bc4dd4b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc#822 Closes #58
* jpegdec: Check return value of gst_buffer_map()Nicolas Dufresne2020-02-041-1/+10
| | | | | Without this check, the element will crash instead of returning an error.
* wavenc: Fix writing of the channel mask with >2 channelsSebastian Dröge2020-01-141-1/+1
| | | | | The channel position is an enum but the conversion code assumed it's a mask. Convert accordingly.
* videocrop: allow properties to be animated by GstControllerDaniel Molkentin2020-01-071-4/+25
|
* rtpjpegdepay: outputs framed jpegTim-Philipp Müller2019-12-061-3/+4
| | | | | | | Add parsed=true to output caps, as we always output whole frames, timestamped and all. Means also that the output can be decoded by avdec_mjpeg wihout plugging an extra parser (which has no rank).
* qtdemux: Specify REDIRECT information in error messageThibault Saunier2019-12-062-8/+26
| | | | | | | | | | | | | | | | | | There are in the wild (mp4) streams that basically contain no tracks but do have a redirect info[0], in which case, we won't be able to expose any pad (there are no tracks) so we can't post anything but an error on the bus, as: - it can't send EOS downstream, it has no pad, - posting an EOS message will be useless as PAUSED state can't be reached and there is no sink in the pipeline meaning GstBin will simply ignore it The approach here is to to add details to the ERROR message with a `redirect-location` field which elements like playbin handle and use right away. [0]: http://movietrailers.apple.com/movies/paramount/terminator-dark-fate/terminator-dark-fate-trailer-2_480p.mov
* Release 1.16.21.16.2Tim-Philipp Müller2019-12-036-21/+447
|
* Update docsTim-Philipp Müller2019-12-0372-77/+77
|
* Update translationsTim-Philipp Müller2019-12-031-99/+160
|
* rtpL16depay: don't crash if data is not modulo channels*widthHavard Graff2019-12-021-2/+14
|
* vp9dec: Fix broken 4:4:4 8bits decodingSeungha Yang2019-11-291-2/+5
| | | | | | | VPX_IMG_FMT_I444 pixel format with sRGB colorspace means GBR data. Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/651
* rtpsession: add locking for clear-pt-mapHavard Graff2019-11-292-0/+46
| | | | ...or it will segfault from time to time...
* wavparse: Fix push mode ignoring audio with a size smaller than segment bufferAmr Mahdi2019-11-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In push mode (streaming), if the audio size is smaller than segment buffer size, it would be ignored. This happens because when the plugin receives an EOS signal while a single audio chunk that is less than the segment buffer size is buffered, it does not flush this chunk. The fix is to flush the data chunk when it receives an EOS signal and has a single (first) chunk buffered. How to reproduce: 1. Run gst-launch with tcp source ``` gst-launch-1.0 tcpserversrc port=3000 ! wavparse ignore-length=0 ! audioconvert ! filesink location=bug.wav ``` 2. Send a wav file with unspecified data chunk length (0). Attached a test file ``` cat test.wav | nc localhost 3000 ``` 3. Compare the length of the source file and output file ``` ls -l test.wav bug.wav -rw-rw-r-- 1 amr amr 0 Aug 15 11:07 bug.wav -rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav ``` The expected length of the result of the gst-lauch pipeline should be the same as the test file minus the headers (44), which is ```3564 - 44 = 3520``` but the actual output length is ```0``` After the fix: ``` ls -l test.wav fix.wav -rw-rw-r-- 1 amr amr 3520 Aug 15 11:09 fix.wav -rwxrwxr-x 1 amr amr 3564 Aug 15 11:06 test.wav ```
* wavparse: Fix ignoring of last chunk in push modeAmr Mahdi2019-11-201-7/+18
| | | | | | | In push mode (streaming), if the last audio payload chunk is less than the segment rate buffer size, it would be ignored since the plugin waits until it has at least segment rate bufer size of audio. The fix is to introduce a flushing flag that indicates that no more audio will be available so that the plugin can recognize this condition and flush the data is has even if it is less than the desired segment rate buffer size.
* v4l2bufferpool: Queue number of allocated buffers to captureNicolas Dufresne2019-11-202-2/+6
| | | | | | | | | Before we do streamon, we queue all capture buffers by calling resurrect. When the driver supports CREATE_BUFS, this would lead to buffers being allocated till the maximum of 32 is reached. Instead, we now save the number of allocated buffers and queue this amount.
* v4l2object: Workaround bad TRY_FMT colorimetry implementationNicolas Dufresne2019-11-191-6/+14
| | | | | | | libv4l2 reset the colorpace to 0 and does not do any request to the driver. This yields an invalid colorspace which currently cause a negotiation failure. This workaround by ignoring bad values during the TRY_FMT step.