diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-10-31 10:14:14 +0100 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@qt.io> | 2016-11-14 17:04:32 +0000 |
commit | a7c23d86362efad27b8dbfd1bc570299dd606fbb (patch) | |
tree | 1db6f27ff768ca15303d216cd84a3bdc4575cd7f /src/multimedia | |
parent | f0ea26416a73e9ed60e0e0440275e73081f601a2 (diff) | |
download | qtmultimedia-a7c23d86362efad27b8dbfd1bc570299dd606fbb.tar.gz |
Cleanup all maemo/meego specific code
Change-Id: I6c6f28084c6b030928eebc53c5d0009b168ede6a
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r-- | src/multimedia/audio/audio.pri | 1 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.cpp | 74 | ||||
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.h | 1 | ||||
-rw-r--r-- | src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h | 141 |
4 files changed, 0 insertions, 217 deletions
diff --git a/src/multimedia/audio/audio.pri b/src/multimedia/audio/audio.pri index d6d6f9c54..d6d74a316 100644 --- a/src/multimedia/audio/audio.pri +++ b/src/multimedia/audio/audio.pri @@ -46,7 +46,6 @@ qtConfig(pulseaudio) { DEFINES += QT_MULTIMEDIA_PULSEAUDIO PRIVATE_HEADERS += audio/qsoundeffect_pulse_p.h SOURCES += audio/qsoundeffect_pulse_p.cpp - !maemo*:DEFINES += QTM_PULSEAUDIO_DEFAULTBUFFER } else { DEFINES += QT_MULTIMEDIA_QAUDIO PRIVATE_HEADERS += audio/qsoundeffect_qaudio_p.h diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index fcf4fee35..2e2dfc2db 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -62,9 +62,6 @@ #include <unistd.h> //#define QT_PA_DEBUG -#ifndef QTM_PULSEAUDIO_DEFAULTBUFFER -#define QT_PA_STREAM_BUFFER_SIZE_MAX (1024 * 64) //64KB is a trade-off for balancing control latency and uploading overhead -#endif QT_BEGIN_NAMESPACE @@ -679,7 +676,6 @@ void QSoundEffectPrivate::sampleReady() #ifdef QT_PA_DEBUG qDebug() << this << "reuse existing pulsestream"; #endif -#ifdef QTM_PULSEAUDIO_DEFAULTBUFFER const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(m_pulseStream); if (bufferAttr->prebuf > uint32_t(m_sample->data().size())) { pa_buffer_attr newBufferAttr; @@ -693,33 +689,6 @@ void QSoundEffectPrivate::sampleReady() } else { streamReady(); } -#else - const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(m_pulseStream); - if (bufferAttr->tlength < m_sample->data().size() && bufferAttr->tlength < QT_PA_STREAM_BUFFER_SIZE_MAX) { - pa_buffer_attr newBufferAttr; - newBufferAttr.maxlength = -1; - newBufferAttr.tlength = qMin(m_sample->data().size(), QT_PA_STREAM_BUFFER_SIZE_MAX); - newBufferAttr.minreq = bufferAttr->tlength / 2; - newBufferAttr.prebuf = -1; - newBufferAttr.fragsize = -1; - pa_operation *op = pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_reset_buffer_callback, m_ref->getRef()); - if (op) - pa_operation_unref(op); - else - qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute"); - } else if (bufferAttr->prebuf > uint32_t(m_sample->data().size())) { - pa_buffer_attr newBufferAttr; - newBufferAttr = *bufferAttr; - newBufferAttr.prebuf = m_sample->data().size(); - pa_operation *op = pa_stream_set_buffer_attr(m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, m_ref->getRef()); - if (op) - pa_operation_unref(op); - else - qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute"); - } else { - streamReady(); - } -#endif } else { if (!pulseDaemon()->context() || pa_context_get_state(pulseDaemon()->context()) != PA_CONTEXT_READY) { connect(pulseDaemon(), SIGNAL(contextReady()), SLOT(contextReady())); @@ -963,17 +932,7 @@ void QSoundEffectPrivate::createPulseStream() } m_pulseStream = stream; -#ifndef QTM_PULSEAUDIO_DEFAULTBUFFER - pa_buffer_attr bufferAttr; - bufferAttr.tlength = qMin(m_sample->data().size(), QT_PA_STREAM_BUFFER_SIZE_MAX); - bufferAttr.maxlength = -1; - bufferAttr.minreq = bufferAttr.tlength / 2; - bufferAttr.prebuf = -1; - bufferAttr.fragsize = -1; - if (pa_stream_connect_playback(m_pulseStream, 0, &bufferAttr, -#else if (pa_stream_connect_playback(m_pulseStream, 0, 0, -#endif PA_STREAM_START_CORKED, 0, 0) < 0) { qWarning("QSoundEffect(pulseaudio): Failed to connect stream, error = %s", pa_strerror(pa_context_errno(pulseDaemon()->context()))); @@ -1048,39 +1007,6 @@ void QSoundEffectPrivate::stream_state_callback(pa_stream *s, void *userdata) } } -void QSoundEffectPrivate::stream_reset_buffer_callback(pa_stream *s, int success, void *userdata) -{ -#ifdef QT_PA_DEBUG - qDebug() << "stream_reset_buffer_callback"; -#endif - Q_UNUSED(s); - QSoundEffectRef *ref = reinterpret_cast<QSoundEffectRef*>(userdata); - QSoundEffectPrivate *self = ref->soundEffect(); - ref->release(); - if (!self) - return; - - if (!success) - qWarning("QSoundEffect(pulseaudio): failed to reset buffer attribute"); -#ifdef QT_PA_DEBUG - qDebug() << self << "stream_reset_buffer_callback"; -#endif - const pa_buffer_attr *bufferAttr = pa_stream_get_buffer_attr(self->m_pulseStream); - self->m_pulseBufferSize = bufferAttr->tlength; - if (bufferAttr->prebuf > uint32_t(self->m_sample->data().size())) { - pa_buffer_attr newBufferAttr; - newBufferAttr = *bufferAttr; - newBufferAttr.prebuf = self->m_sample->data().size(); - pa_operation *op = pa_stream_set_buffer_attr(self->m_pulseStream, &newBufferAttr, stream_adjust_prebuffer_callback, userdata); - if (op) - pa_operation_unref(op); - else - qWarning("QSoundEffect(pulseaudio): failed to adjust pre-buffer attribute"); - } else { - QMetaObject::invokeMethod(self, "streamReady", Qt::QueuedConnection); - } -} - void QSoundEffectPrivate::stream_adjust_prebuffer_callback(pa_stream *s, int success, void *userdata) { #ifdef QT_PA_DEBUG diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h index 020aa031a..7be88c55a 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.h +++ b/src/multimedia/audio/qsoundeffect_pulse_p.h @@ -148,7 +148,6 @@ private: static void stream_flush_reload_callback(pa_stream *s, int success, void *userdata); static void stream_write_done_callback(void *p); static void stream_adjust_prebuffer_callback(pa_stream *s, int success, void *userdata); - static void stream_reset_buffer_callback(pa_stream *s, int success, void *userdata); pa_stream *m_pulseStream; int m_sinkInputId; diff --git a/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h b/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h deleted file mode 100644 index 8abdd1e02..000000000 --- a/src/multimedia/gsttools_headers/qgstreamergltexturerenderer_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGSTREAMERGLTEXTURERENDERER_H -#define QGSTREAMERGLTEXTURERENDERER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <qvideorenderercontrol.h> -#include <private/qvideosurfacegstsink_p.h> -#include <private/qgstreamerbushelper_p.h> - -#include "qgstreamervideorendererinterface_p.h" -#include <QtGui/qcolor.h> - -#include <X11/extensions/Xv.h> - -QT_BEGIN_NAMESPACE - -class QGLContext; - -class QGstreamerGLTextureRenderer : public QVideoRendererControl, - public QGstreamerVideoRendererInterface, - public QGstreamerSyncMessageFilter, - public QGstreamerBusMessageFilter -{ - Q_OBJECT - Q_INTERFACES(QGstreamerVideoRendererInterface QGstreamerSyncMessageFilter QGstreamerBusMessageFilter) - - Q_PROPERTY(bool overlayEnabled READ overlayEnabled WRITE setOverlayEnabled) - Q_PROPERTY(qulonglong winId READ winId WRITE setWinId) - Q_PROPERTY(QRect overlayGeometry READ overlayGeometry WRITE setOverlayGeometry) - Q_PROPERTY(QColor colorKey READ colorKey) - Q_PROPERTY(QSize nativeSize READ nativeSize NOTIFY nativeSizeChanged) - -public: - QGstreamerGLTextureRenderer(QObject *parent = 0); - virtual ~QGstreamerGLTextureRenderer(); - - QAbstractVideoSurface *surface() const; - void setSurface(QAbstractVideoSurface *surface); - - GstElement *videoSink(); - - bool isReady() const; - bool processBusMessage(const QGstreamerMessage &message); - bool processSyncMessage(const QGstreamerMessage &message); - void stopRenderer(); - - int framebufferNumber() const; - - bool overlayEnabled() const; - WId winId() const; - QRect overlayGeometry() const; - QColor colorKey() const; - QSize nativeSize() const; - -public slots: - void renderGLFrame(int); - - void setOverlayEnabled(bool); - void setWinId(WId id); - void setOverlayGeometry(const QRect &geometry); - void repaintOverlay(); - -signals: - void sinkChanged(); - void readyChanged(bool); - void nativeSizeChanged(); - -private slots: - void handleFormatChange(); - void updateNativeVideoSize(); - -private: - static void handleFrameReady(GstElement *sink, gint frame, gpointer data); - static gboolean padBufferProbe(GstPad *pad, GstBuffer *buffer, gpointer user_data); - - GstElement *m_videoSink; - QAbstractVideoSurface *m_surface; - QGLContext *m_context; - QSize m_nativeSize; - - WId m_winId; - QColor m_colorKey; - QRect m_displayRect; - bool m_overlayEnabled; - int m_bufferProbeId; - - QMutex m_mutex; - QWaitCondition m_renderCondition; -}; - -QT_END_NAMESPACE - -#endif // QGSTREAMERVIDEORENDRER_H |