gstreamer: Update to 1.12.1 (#2611)

gst-plugins-good: Drop two patches contained in the new release and one unused patch.
This commit is contained in:
Christoph Reiter
2017-06-21 12:25:42 +02:00
committed by Алексей
parent ef3ad4b015
commit 52900ce27f
12 changed files with 20 additions and 274 deletions

View File

@@ -4,7 +4,7 @@ _srcname=gstreamer-editing-services
_realname=gst-editing-services
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Editing Services (mingw-w64)"
arch=('any')
@@ -18,7 +18,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gst-plugins-base")
options=(!libtool strip staticlibs)
source=(${url}/src/${_realname}/${_srcname}-${pkgver}.tar.xz
0002-add-cflags-for-gir.patch)
sha256sums=('993372f80cafd5395e90a4bc8bf28733513949a2ae4df987ab0dcc99fc5bab66'
sha256sums=('4e5aeda1812f7240f1e12ee7506667f77d1fc0d6183382fc2eecbfa928a91b69'
'9d4c26c60c6a1b2ef4430c82ff5fcbf06f1aae61572ec005b387bb5419564e78')
prepare() {

View File

@@ -3,7 +3,7 @@
_realname=gst-libav
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer libav (mingw-w64)"
arch=('any')
@@ -17,7 +17,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-gst-plugins-base")
options=(!libtool strip staticlibs)
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('39d1477f642ee980b008e78d716b16801eec9a6e5958c5a6cdc0cb04ab0750c4')
sha256sums=('55d7823fdf63195de991adfef32db4b8a8bef3cafa46115a951e590dc18a5077')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}

View File

@@ -5,7 +5,7 @@
_realname=gst-plugins-bad
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Bad Plugins (mingw-w64)"
arch=('any')
@@ -56,7 +56,7 @@ source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz
0002-fix-link-order.patch
0005-Include-glext-h.patch
0006-No-X11-on-_WIN32.patch)
sha256sums=('11b73cfff1b315a8e9be1756435ea84937e7cb90afbab0e8e6975367dbfb8534'
sha256sums=('7def8049d1c44e50199023159dfada60af58fd503ef58a020b79044bda705b97'
'd9433cbe0eba170e9228632883a9fe1634354e4e31c2261e5e2dcedca9b0ed6a'
'439436d02724c07af95f509647238f271f4717958dcf42dc5adb5a8e6a2108e7'
'da9b9c1cf8ce5ee77f7963a6ffecc2abfbc8d0e3c4ea88a49646c0c98a480e46')

View File

@@ -3,7 +3,7 @@
_realname=gst-plugins-base
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Base Plugins (mingw-w64)"
arch=('any')
@@ -25,7 +25,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-freetype"
options=(!libtool strip staticlibs)
conflicts=("${MINGW_PACKAGE_PREFIX}-gst-plugins-bad<1.12.0")
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('345fc6877f54b8b6e97aacf2996be37a51a0e369f53fc2cf83108af9f764364d')
sha256sums=('0cce9fadb574a840b3c9d31b69faf57aad6c5543c3b134a7b935de866c9e0465')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}

View File

@@ -1,97 +0,0 @@
From 2d44b53ff664658ba9a4578b5b3231365c7c8e71 Mon Sep 17 00:00:00 2001
From: Nirbheek Chauhan <nirbheek@centricular.com>
Date: Wed, 3 May 2017 23:23:10 +0530
Subject: [PATCH] directsoundsink: Fix corner case causing large CPU usage
We were unnecessarily looping/goto-ing repeatedly when we had exactly
the amount of data as the free space, and also when the free space was
too small. This, as it turns out, is a very common scenario with
Directsound on Windows.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=773681
We have to do polling here because the event notification API that
Directsound exposes cannot be used with live playback since all events
must be registered in advance with the capture buffer, you cannot
add/remove them once playback has begun. Directsoundsrc had the same
problem.
See also: https://bugzilla.gnome.org/show_bug.cgi?id=781249
---
sys/directsound/gstdirectsoundsink.c | 39 +++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/sys/directsound/gstdirectsoundsink.c b/sys/directsound/gstdirectsoundsink.c
index b7ec9b4..cceeca5 100644
--- a/sys/directsound/gstdirectsoundsink.c
+++ b/sys/directsound/gstdirectsoundsink.c
@@ -621,10 +621,10 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
if (SUCCEEDED (hRes) && SUCCEEDED (hRes2) && (dwStatus & DSBSTATUS_PLAYING)) {
DWORD dwFreeBufferSize = 0;
- DWORD sleepTime = 0;
+ guint64 sleep_time_ms = 0;
calculate_freesize:
- /* calculate the free size of the circular buffer */
+ /* Calculate the free space in the circular buffer */
if (dwCurrentPlayCursor < dsoundsink->current_circular_offset)
dwFreeBufferSize =
dsoundsink->buffer_size - (dsoundsink->current_circular_offset -
@@ -633,21 +633,28 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
dwFreeBufferSize =
dwCurrentPlayCursor - dsoundsink->current_circular_offset;
- if (length >= dwFreeBufferSize) {
- sleepTime =
- ((length -
- dwFreeBufferSize) * 1000) / (dsoundsink->bytes_per_sample *
- GST_AUDIO_BASE_SINK (asink)->ringbuffer->spec.info.rate);
- if (sleepTime > 0) {
- GST_DEBUG_OBJECT (dsoundsink,
- "gst_directsound_sink_write: length:%i, FreeBufSiz: %ld, sleepTime: %ld, bps: %i, rate: %i",
- length, dwFreeBufferSize, sleepTime, dsoundsink->bytes_per_sample,
- GST_AUDIO_BASE_SINK (asink)->ringbuffer->spec.info.rate);
- Sleep (sleepTime);
- }
+ /* Not enough free space, wait for some samples to be played out. We could
+ * write out partial data, but that will result in a tight loop in the
+ * audioringbuffer write thread, and lead to high CPU usage. */
+ if (length > dwFreeBufferSize) {
+ gint rate = GST_AUDIO_BASE_SINK (asink)->ringbuffer->spec.info.rate;
+ /* Wait for a time proportional to the space needed. In reality, the
+ * directsound sink's position does not update frequently enough, so we
+ * will end up waiting for much longer. Note that Sleep() has millisecond
+ * resolution at best. */
+ sleep_time_ms = gst_util_uint64_scale_int ((length - dwFreeBufferSize),
+ 1000, dsoundsink->bytes_per_sample * rate);
+ /* Make sure we don't run in a tight loop unnecessarily */
+ sleep_time_ms = MAX (sleep_time_ms, 10);
+ GST_DEBUG_OBJECT (dsoundsink,
+ "length: %u, FreeBufSiz: %ld, sleep_time_ms: %" G_GUINT64_FORMAT
+ ", bps: %i, rate: %i", length, dwFreeBufferSize, sleep_time_ms,
+ dsoundsink->bytes_per_sample, rate);
+ Sleep (sleep_time_ms);
+
+ /* May we send out? */
hRes = IDirectSoundBuffer_GetCurrentPosition (dsoundsink->pDSBSecondary,
&dwCurrentPlayCursor, NULL);
-
hRes2 =
IDirectSoundBuffer_GetStatus (dsoundsink->pDSBSecondary, &dwStatus);
if (SUCCEEDED (hRes) && SUCCEEDED (hRes2)
@@ -674,10 +681,10 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
if (dwStatus & DSBSTATUS_BUFFERLOST) {
hRes = IDirectSoundBuffer_Restore (dsoundsink->pDSBSecondary); /*need a loop waiting the buffer is restored?? */
-
dsoundsink->current_circular_offset = 0;
}
+ /* Lock a buffer of length @length for writing */
hRes = IDirectSoundBuffer_Lock (dsoundsink->pDSBSecondary,
dsoundsink->current_circular_offset, length, &pLockedBuffer1,
&dwSizeBuffer1, &pLockedBuffer2, &dwSizeBuffer2, 0L);
--
2.9.3

View File

@@ -1,140 +0,0 @@
From a303a7971c29db5599b34e82ef96565a1f58abee Mon Sep 17 00:00:00 2001
From: Dustin Spicuzza <dustin@virtualroadside.com>
Date: Mon, 8 May 2017 15:22:00 +0000
Subject: [PATCH] directsoundsink: Use GstClock API instead of Sleep() for
waiting
It's more accurate and allows cancellation.
https://bugzilla.gnome.org/show_bug.cgi?id=773681
---
sys/directsound/gstdirectsoundsink.c | 54 ++++++++++++++++++++++++++++++++----
sys/directsound/gstdirectsoundsink.h | 4 +++
2 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/sys/directsound/gstdirectsoundsink.c b/sys/directsound/gstdirectsoundsink.c
index cceeca5..44145ef 100644
--- a/sys/directsound/gstdirectsoundsink.c
+++ b/sys/directsound/gstdirectsoundsink.c
@@ -148,6 +148,10 @@ gst_directsound_sink_finalize (GObject * object)
dsoundsink->device_id = NULL;
g_mutex_clear (&dsoundsink->dsound_lock);
+ gst_object_unref (dsoundsink->system_clock);
+ if (dsoundsink->write_wait_clock_id != NULL) {
+ gst_clock_id_unref (dsoundsink->write_wait_clock_id);
+ }
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -227,6 +231,8 @@ gst_directsound_sink_init (GstDirectSoundSink * dsoundsink)
dsoundsink->buffer_size = DSBSIZE_MIN;
dsoundsink->volume = 100;
g_mutex_init (&dsoundsink->dsound_lock);
+ dsoundsink->system_clock = gst_system_clock_obtain ();
+ dsoundsink->write_wait_clock_id = NULL;
dsoundsink->first_buffer_after_reset = FALSE;
}
@@ -621,7 +627,8 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
if (SUCCEEDED (hRes) && SUCCEEDED (hRes2) && (dwStatus & DSBSTATUS_PLAYING)) {
DWORD dwFreeBufferSize = 0;
- guint64 sleep_time_ms = 0;
+ GstClockTime sleep_time_ms = 0, sleep_until;
+ GstClockID clock_id;
calculate_freesize:
/* Calculate the free space in the circular buffer */
@@ -646,11 +653,44 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
1000, dsoundsink->bytes_per_sample * rate);
/* Make sure we don't run in a tight loop unnecessarily */
sleep_time_ms = MAX (sleep_time_ms, 10);
+ sleep_until = gst_clock_get_time (dsoundsink->system_clock) +
+ sleep_time_ms * GST_MSECOND;
+
GST_DEBUG_OBJECT (dsoundsink,
"length: %u, FreeBufSiz: %ld, sleep_time_ms: %" G_GUINT64_FORMAT
", bps: %i, rate: %i", length, dwFreeBufferSize, sleep_time_ms,
dsoundsink->bytes_per_sample, rate);
- Sleep (sleep_time_ms);
+
+ if (G_UNLIKELY (dsoundsink->write_wait_clock_id == NULL ||
+ gst_clock_single_shot_id_reinit (dsoundsink->system_clock,
+ dsoundsink->write_wait_clock_id, sleep_until) == FALSE)) {
+
+ if (dsoundsink->write_wait_clock_id != NULL) {
+ gst_clock_id_unref (dsoundsink->write_wait_clock_id);
+ }
+
+ dsoundsink->write_wait_clock_id =
+ gst_clock_new_single_shot_id (dsoundsink->system_clock,
+ sleep_until);
+ }
+
+ clock_id = dsoundsink->write_wait_clock_id;
+ dsoundsink->reset_while_sleeping = FALSE;
+
+ GST_DSOUND_UNLOCK (dsoundsink);
+
+ /* don't bother with the return value as we'll detect reset separately,
+ as reset could happen between when this returns and we obtain the lock
+ again -- so we can't use UNSCHEDULED here */
+ gst_clock_id_wait (clock_id, NULL);
+
+ GST_DSOUND_LOCK (dsoundsink);
+
+ /* if a reset occurs, exit now */
+ if (dsoundsink->reset_while_sleeping == TRUE) {
+ GST_DSOUND_UNLOCK (dsoundsink);
+ return -1;
+ }
/* May we send out? */
hRes = IDirectSoundBuffer_GetCurrentPosition (dsoundsink->pDSBSecondary,
@@ -695,12 +735,12 @@ gst_directsound_sink_write (GstAudioSink * asink, gpointer data, guint length)
if (pLockedBuffer2 != NULL)
memcpy (pLockedBuffer2, (LPBYTE) data + dwSizeBuffer1, dwSizeBuffer2);
+ hRes = IDirectSoundBuffer_Unlock (dsoundsink->pDSBSecondary, pLockedBuffer1,
+ dwSizeBuffer1, pLockedBuffer2, dwSizeBuffer2);
+
// Update where the buffer will lock (for next time)
dsoundsink->current_circular_offset += dwSizeBuffer1 + dwSizeBuffer2;
dsoundsink->current_circular_offset %= dsoundsink->buffer_size; /* Circular buffer */
-
- hRes = IDirectSoundBuffer_Unlock (dsoundsink->pDSBSecondary, pLockedBuffer1,
- dwSizeBuffer1, pLockedBuffer2, dwSizeBuffer2);
}
/* if the buffer was not in playing state yet, call play on the buffer
@@ -787,7 +827,11 @@ gst_directsound_sink_reset (GstAudioSink * asink)
}
}
+ dsoundsink->reset_while_sleeping = TRUE;
dsoundsink->first_buffer_after_reset = TRUE;
+ if (dsoundsink->write_wait_clock_id != NULL) {
+ gst_clock_id_unschedule (dsoundsink->write_wait_clock_id);
+ }
GST_DSOUND_UNLOCK (dsoundsink);
}
diff --git a/sys/directsound/gstdirectsoundsink.h b/sys/directsound/gstdirectsoundsink.h
index 51f7648..eb27efd 100644
--- a/sys/directsound/gstdirectsoundsink.h
+++ b/sys/directsound/gstdirectsoundsink.h
@@ -81,6 +81,10 @@ struct _GstDirectSoundSink
/* lock used to protect writes and resets */
GMutex dsound_lock;
+ GstClock *system_clock;
+ GstClockID write_wait_clock_id;
+ gboolean reset_while_sleeping;
+
gboolean first_buffer_after_reset;
GstAudioRingBufferFormatType type;
--
2.9.3

View File

@@ -1,11 +0,0 @@
--- gst-plugins-good-1.0.6/tests/check/Makefile.am.orig 2013-04-10 09:12:03 +0400
+++ gst-plugins-good-1.0.6/tests/check/Makefile.am 2013-04-10 09:14:04 +0400
@@ -10,7 +10,7 @@
$(REGISTRY_ENVIRONMENT) \
GST_PLUGIN_SYSTEM_PATH_1_0= \
GST_PLUGIN_PATH_1_0=$(top_builddir)/gst:$(top_builddir)/ext:$(top_builddir)/sys:$(GSTPB_PLUGINS_DIR):$(GST_PLUGINS_DIR) \
- GST_PLUGIN_LOADING_WHITELIST="gstreamer@$(GST_PLUGINS_DIR):gst-plugins-base@$(GSTPB_PLUGINS_DIR):gst-plugins-good@$(top_builddir)" \
+ GST_PLUGIN_LOADING_WHITELIST="gstreamer@$(GST_PLUGINS_DIR);gst-plugins-base@$(GSTPB_PLUGINS_DIR);gst-plugins-good@$(subst /,\\,$(top_builddir))" \
GST_STATE_IGNORE_ELEMENTS="aasink autoaudiosrc autoaudiosink autovideosrc autovideosink \
cacasink cairotextoverlay \
halaudiosrc halaudiosink jackaudiosrc jackaudiosink \

View File

@@ -3,7 +3,7 @@
_realname=gst-plugins-good
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Base Plugins (mingw-w64)"
arch=('any')
@@ -24,17 +24,11 @@ depends=("${MINGW_PACKAGE_PREFIX}-cairo"
"${MINGW_PACKAGE_PREFIX}-taglib"
"${MINGW_PACKAGE_PREFIX}-wavpack")
options=(!libtool strip staticlibs)
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz
0001-directsoundsink-Fix-corner-case-causing-large-CPU-us.patch
0002-directsoundsink-Use-GstClock-API-instead-of-Sleep-fo.patch)
sha256sums=('8a1d734db7338e00c28b794a7f0a5a9e67d1c5c8b0074075b50638207d372ebc'
'8a3165af84bdd800899e99ea01149ce3a7188b1dabc365423234bd7b5717e458'
'61c9a7104b0c1ecb40bc98a08e1137cefb555d53246a751c07d326320b1bfaee')
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('121e8e46a7f0e622f09ec9be012607b89d737dd72d48b0f2f0680821ae2cf54b')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/0001-directsoundsink-Fix-corner-case-causing-large-CPU-us.patch
patch -p1 -i ${srcdir}/0002-directsoundsink-Use-GstClock-API-instead-of-Sleep-fo.patch
NOCONFIGURE=1 ./autogen.sh
}

View File

@@ -3,7 +3,7 @@
_realname=gst-plugins-ugly
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Ugly Plugins (mingw-w64)"
arch=('any')
@@ -24,7 +24,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-a52dec"
"${MINGW_PACKAGE_PREFIX}-x264")
options=(!libtool strip staticlibs)
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('5e68ba5046e83ee87b17d7a13931e6091466fd771e1338c5b929ee0944d40ad6')
sha256sums=('8fc2123d059713a34fa5d0a26641fb8158f52f6766633d2db7a661adc88e1069')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}

View File

@@ -3,8 +3,8 @@
_realname=gst-python
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgrel=2
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer GObject Introspection overrides for Python 3 (mingw-w64)"
arch=('any')
license=('LGPL')
@@ -20,7 +20,7 @@ source=(https://gstreamer.freedesktop.org/src/gst-python/${_realname}-${pkgver}.
'0002-msys2-fix-linking-errors.patch'
'0004-add-overrides.patch'
'0005-unix-override-dir.patch')
sha256sums=('be33de6b9f21e95f677ef91b142e5249e71c8d7e894a5a4a53e19cf18d5d9c07'
sha256sums=('1721be4f201eb0a73075dd7d39bf2251798124cb948440d4cf4f02d6fa0078a1'
'836cf2e9e713705e5fd0f09d4e38d3de839a3c663eb6fa85f0a3f9a5f0b224ee'
'dc4cd0f1890d82e5d09e667763b6a7c1731864e3ddfe4f0ff42d3e83de4def20'
'04f94d86379280d6a4d7970dd149f31ef9ea04f5151dc6f9be474069570366ac'

View File

@@ -3,7 +3,7 @@
_realname=gst-rtsp-server
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer RTSP server library (mingw-w64)"
arch=('any')
@@ -26,7 +26,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gst-plugins-bad")
options=(!libtool strip staticlibs)
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('85ae6bbe173b365ddf4859967144f1999b436531ecbe09935914bfa9f6b37652')
sha256sums=('f27b9bde057e861a7705fa1263a9288a09fce8c42d8d5363c0bef4fe93994292')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}

View File

@@ -3,7 +3,7 @@
_realname=gstreamer
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.12.0
pkgver=1.12.1
pkgrel=1
pkgdesc="GStreamer Multimedia Framework (mingw-w64)"
arch=('any')
@@ -25,7 +25,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
options=(!libtool strip staticlibs)
conflicts=("${MINGW_PACKAGE_PREFIX}-gst-plugins-bad<1.12.0")
source=("${url}/src/gstreamer/gstreamer-${pkgver}.tar.xz")
sha256sums=('14d5eef8297d2bf2a728d38fa43cd92cc267a0ad260cf83d770215212aff4302')
sha256sums=('9044b9d8b3ff44457fa9e36faa59c56684b587b34dee449bfe15ec0c32a3a6d2')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}