Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I0f0457e9863f540b7bd8bc104c92891d8cf5c483
This commit is contained in:
@@ -172,9 +172,6 @@ void AudioRecorder::toggleRecord()
|
||||
if (audioRecorder->state() == QMediaRecorder::StoppedState) {
|
||||
audioRecorder->setAudioInput(boxValue(ui->audioDeviceBox).toString());
|
||||
|
||||
if (!outputLocationSet)
|
||||
audioRecorder->setOutputLocation(generateAudioFilePath());
|
||||
|
||||
QAudioEncoderSettings settings;
|
||||
settings.setCodec(boxValue(ui->audioCodecBox).toString());
|
||||
settings.setSampleRate(boxValue(ui->sampleRateBox).toInt());
|
||||
@@ -214,24 +211,6 @@ void AudioRecorder::displayErrorMessage()
|
||||
ui->statusbar->showMessage(audioRecorder->errorString());
|
||||
}
|
||||
|
||||
QUrl AudioRecorder::generateAudioFilePath()
|
||||
{
|
||||
QDir outputDir(QDir::rootPath());
|
||||
|
||||
int lastImage = 0;
|
||||
int fileCount = 0;
|
||||
foreach (const QString &fileName, outputDir.entryList(QStringList(QString("testclip_*")))) {
|
||||
int imgNumber = fileName.mid(5, fileName.size() - 9).toInt();
|
||||
lastImage = qMax(lastImage, imgNumber);
|
||||
if (outputDir.exists(fileName))
|
||||
fileCount += 1;
|
||||
}
|
||||
lastImage += fileCount;
|
||||
QUrl location(QDir::toNativeSeparators(outputDir.canonicalPath()
|
||||
+ QString("/testclip_%1").arg(lastImage + 1, 4, 10, QLatin1Char('0'))));
|
||||
return location;
|
||||
}
|
||||
|
||||
// This function returns the maximum possible sample value for a given audio format
|
||||
qreal getPeakValue(const QAudioFormat& format)
|
||||
{
|
||||
|
||||
@@ -71,7 +71,6 @@ private slots:
|
||||
void updateState(QMediaRecorder::State);
|
||||
void updateProgress(qint64 pos);
|
||||
void displayErrorMessage();
|
||||
QUrl generateAudioFilePath();
|
||||
|
||||
private:
|
||||
Ui::AudioRecorder *ui;
|
||||
|
||||
@@ -90,7 +90,7 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface)
|
||||
m_videoSink = 0;
|
||||
|
||||
if (m_surface) {
|
||||
disconnect(m_surface, SIGNAL(supportedFormatsChanged()),
|
||||
disconnect(m_surface.data(), SIGNAL(supportedFormatsChanged()),
|
||||
this, SLOT(handleFormatChange()));
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void QGstreamerVideoRenderer::setSurface(QAbstractVideoSurface *surface)
|
||||
m_surface = surface;
|
||||
|
||||
if (m_surface) {
|
||||
connect(m_surface, SIGNAL(supportedFormatsChanged()),
|
||||
connect(m_surface.data(), SIGNAL(supportedFormatsChanged()),
|
||||
this, SLOT(handleFormatChange()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
QT += qml quick network multimedia-private qtmultimediaquicktools-private
|
||||
|
||||
LIBS += -L$$QT.multimedia.libs
|
||||
|
||||
HEADERS += \
|
||||
qdeclarativeaudio_p.h \
|
||||
qdeclarativemediametadata_p.h \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
|
||||
|
||||
project = qtmultimedia
|
||||
project = QtMultimedia
|
||||
description = Qt Multimedia Documentation
|
||||
url = http://qt-project.org/doc/qt-$QT_VER/qtmultimedia
|
||||
version = $QT_VERSION
|
||||
@@ -12,22 +12,22 @@ version = $QT_VERSION
|
||||
# Defines the name of the project. You cannot use operators (+, =, -) in
|
||||
# the name. Properties for this project are set using a qhp.<projectname>.property
|
||||
# format.
|
||||
qhp.projects = qtmultimedia
|
||||
qhp.qtmultimedia.file = qtmultimedia.qhp
|
||||
qhp.qtmultimedia.namespace = org.qt-project.qtmultimedia.$QT_VERSION_TAG
|
||||
qhp.qtmultimedia.indexTitle = Qt Multimedia
|
||||
qhp.qtmultimedia.virtualFolder = qtmultimedia
|
||||
qhp.projects = QtMultimedia
|
||||
qhp.QtMultimedia.file = qtmultimedia.qhp
|
||||
qhp.QtMultimedia.namespace = org.qt-project.qtmultimedia.$QT_VERSION_TAG
|
||||
qhp.QtMultimedia.indexTitle = Qt Multimedia
|
||||
qhp.QtMultimedia.virtualFolder = qtmultimedia
|
||||
|
||||
# For listing child nodes in Qt Creator or Assistant.
|
||||
qhp.qtmultimedia.subprojects = classes qmltypes
|
||||
qhp.qtmultimedia.subprojects.classes.title = C++ Classes
|
||||
qhp.qtmultimedia.subprojects.classes.indexTitle = Qt Multimedia C++ Classes
|
||||
qhp.qtmultimedia.subprojects.classes.selectors = class fake:headerfile
|
||||
qhp.qtmultimedia.subprojects.classes.sortPages = true
|
||||
qhp.qtmultimedia.subprojects.qmltypes.title = QML Types
|
||||
qhp.qtmultimedia.subprojects.qmltypes.indexTitle = Qt Multimedia QML Types
|
||||
qhp.qtmultimedia.subprojects.qmltypes.selectors = fake:qmlclass
|
||||
qhp.qtmultimedia.subprojects.qmltypes.sortPages = true
|
||||
qhp.QtMultimedia.subprojects = classes qmltypes
|
||||
qhp.QtMultimedia.subprojects.classes.title = C++ Classes
|
||||
qhp.QtMultimedia.subprojects.classes.indexTitle = Qt Multimedia C++ Classes
|
||||
qhp.QtMultimedia.subprojects.classes.selectors = class fake:headerfile
|
||||
qhp.QtMultimedia.subprojects.classes.sortPages = true
|
||||
qhp.QtMultimedia.subprojects.qmltypes.title = QML Types
|
||||
qhp.QtMultimedia.subprojects.qmltypes.indexTitle = Qt Multimedia QML Types
|
||||
qhp.QtMultimedia.subprojects.qmltypes.selectors = fake:qmlclass
|
||||
qhp.QtMultimedia.subprojects.qmltypes.sortPages = true
|
||||
|
||||
exampledirs += ../../../examples/multimedia \
|
||||
snippets
|
||||
|
||||
@@ -27,40 +27,37 @@
|
||||
|
||||
/*!
|
||||
\page multimediaoverview.html
|
||||
\title Qt Multimedia Overview
|
||||
\title Multimedia
|
||||
\brief A set of APIs for working with audio, video, radio and camera devices.
|
||||
|
||||
\ingroup technology-apis
|
||||
|
||||
Multimedia support in Qt is provided by the \l{Qt Multimedia} module. The Qt
|
||||
Multimedia module provides a rich feature set that enables you to easily take
|
||||
advantage of a platform's multimedia capabilities such as media playback and
|
||||
the use of camera and radio devices.
|
||||
|
||||
\section1 Overview
|
||||
|
||||
Multimedia support in Qt is provided by the Qt Multimedia module. The
|
||||
Qt Multimedia module provides a rich feature set that enables you to easily
|
||||
take advantage of a platforms multimedia capabilites and hardware. This
|
||||
ranges from the playback and recording of audio and video content to the use
|
||||
of available devices like cameras and radios.
|
||||
|
||||
\section2 Features
|
||||
\section1 Features
|
||||
|
||||
Here are some examples of what can be done with Qt Multimedia APIs:
|
||||
|
||||
\list
|
||||
\li Access raw audio devices for input and output
|
||||
\li Play low latency sound effects
|
||||
\li Play media files in playlists (like compressed audio, or video files)
|
||||
\li Play media files in playlists (such as compressed audio or video files)
|
||||
\li Record audio and compress it
|
||||
\li Tune and listen to radio stations, and receive radio program information
|
||||
\li Tune and listen to radio stations
|
||||
\li Use a camera, including viewfinder, image capture, and movie recording
|
||||
\li Play 3D positional audio with \l {Positional Audio} {QtAudioEngine}
|
||||
\li Decode audio media files into memory for processing
|
||||
\li Accessing video frames or audio buffers as they are played or recorded
|
||||
\endlist
|
||||
|
||||
\section2 Multimedia Components
|
||||
\section1 Multimedia Components
|
||||
|
||||
All of these tasks can be broadly broken down into four main areas. More information
|
||||
(including background information and class references) are available here:
|
||||
Qt's multimedia APIs are categorized into four main components. More
|
||||
information (including background information and class references) is
|
||||
available here:
|
||||
|
||||
\list
|
||||
\li \l {Audio Overview}
|
||||
@@ -69,8 +66,9 @@ All of these tasks can be broadly broken down into four main areas. More inform
|
||||
\li \l {Radio Overview}
|
||||
\endlist
|
||||
|
||||
\section2 Multimedia Recipes
|
||||
For some quick recipes for specific tasks, look at the overviews above and consult this table:
|
||||
\section1 Multimedia Recipes
|
||||
|
||||
For some quick recipes, look at the overviews above and consult this table:
|
||||
|
||||
\table 70%
|
||||
\header
|
||||
@@ -85,7 +83,8 @@ For some quick recipes for specific tasks, look at the overviews above and consu
|
||||
\li QSoundEffect
|
||||
\row
|
||||
\li Playing low latency audio
|
||||
\li \l{multimedia/audiooutput}{audioinput}, \l{multimedia/spectrum}{spectrum}
|
||||
\li \l{multimedia/audiooutput}{audioinput},
|
||||
\l{multimedia/spectrum}{spectrum}
|
||||
\li
|
||||
\li QAudioOutput
|
||||
\row
|
||||
@@ -95,7 +94,8 @@ For some quick recipes for specific tasks, look at the overviews above and consu
|
||||
\li QMediaPlayer
|
||||
\row
|
||||
\li Accessing raw audio input data
|
||||
\li \l{multimedia/spectrum}{spectrum}, \l {multimedia/audioinput}{audioinput}
|
||||
\li \l{multimedia/spectrum}{spectrum},
|
||||
\l {multimedia/audioinput}{audioinput}
|
||||
\li
|
||||
\li QAudioInput
|
||||
\row
|
||||
@@ -138,12 +138,14 @@ For some quick recipes for specific tasks, look at the overviews above and consu
|
||||
\li QCamera, QAbstractVideoSurface, QVideoFrame
|
||||
\row
|
||||
\li Capturing photos
|
||||
\li \l {Camera Example}{camera}, \l {multimediawidgets/declarative-camera}{declarative-camera}
|
||||
\li \l {Camera Example}{camera},
|
||||
\l {multimediawidgets/declarative-camera}{declarative-camera}
|
||||
\li \l Camera
|
||||
\li QCamera, QCameraImageCapture
|
||||
\row
|
||||
\li Capturing movies
|
||||
\li \l {Camera Example}{camera}, \l {multimediawidgets/declarative-camera}{declarative-camera}
|
||||
\li \l {Camera Example}{camera},
|
||||
\l {multimediawidgets/declarative-camera}{declarative-camera}
|
||||
\li \l Camera
|
||||
\li QCamera, QMediaRecorder
|
||||
\row
|
||||
@@ -156,26 +158,26 @@ For some quick recipes for specific tasks, look at the overviews above and consu
|
||||
|
||||
\section1 Limitations
|
||||
|
||||
In many cases the Qt Multimedia APIs build upon the multimedia framework of the underlying system.
|
||||
This can mean that support for various codec or containers can vary between machines,
|
||||
depending on what the end user has installed.
|
||||
The Qt Multimedia APIs build upon the multimedia framework of the underlying
|
||||
platform. This can mean that support for various codecs or containers can vary
|
||||
between machines, depending on what the end user has installed.
|
||||
|
||||
\section1 Advanced Usage
|
||||
|
||||
For developers wishing to access some platform specific settings,
|
||||
or to port the Qt Multimedia APIs to a new platform or technology,
|
||||
see \l{Multimedia Backend Development}.
|
||||
For developers wishing to access some platform specific settings, or to port the
|
||||
Qt Multimedia APIs to a new platform or technology, see \l{Multimedia Backend
|
||||
Development}.
|
||||
|
||||
\section1 Changes from Previous Versions
|
||||
|
||||
If you've previously used Qt Multimedia in Qt 4.x, or used Qt Multimedia Kit in Qt Mobility, please see
|
||||
\l {Changes in Qt Multimedia} for more information on what has changed, and what you might need to
|
||||
change when porting code.
|
||||
If you previously used Qt Multimedia in Qt 4, or used Qt Multimedia Kit in
|
||||
Qt Mobility, please see \l {Changes in Qt Multimedia} for more information on
|
||||
what changed, and what you might need to change when porting code.
|
||||
|
||||
\section1 Reference Documentation
|
||||
|
||||
\section2 QML Types
|
||||
The following types are accessed by using:
|
||||
The QML types are accessed by using:
|
||||
\code
|
||||
import QtMultimedia 5.0
|
||||
\endcode
|
||||
|
||||
@@ -30,10 +30,12 @@
|
||||
\title Qt Multimedia C++ Classes
|
||||
\ingroup modules
|
||||
|
||||
\brief The \l {Qt Multimedia} module provides audio, video, radio and camera functionality.
|
||||
\brief The \l {Qt Multimedia} module provides audio, video, radio and camera
|
||||
functionality.
|
||||
|
||||
The C++ classes provide more control over the multimedia content than the QML alternatives.
|
||||
If your application is serving complex use cases such as decoding media files, accessing video or audio buffers,
|
||||
use the C++ alternative. For more details about the complex audio, video, and camera use cases supported by the C++
|
||||
classes, refer to \l {Qt Multimedia Overview}.
|
||||
The C++ classes provide more control over the multimedia content than the
|
||||
QML alternatives. If your application is serving complex use cases such as
|
||||
decoding media files, accessing video or audio buffers, use the C++
|
||||
alternative. For more details about the complex audio, video, and camera use
|
||||
cases supported by the C++ classes, refer to \l {Qt Multimedia Overview}.
|
||||
*/
|
||||
|
||||
@@ -28,37 +28,46 @@
|
||||
/*!
|
||||
\page qtmultimedia-index.html
|
||||
\title Qt Multimedia
|
||||
\brief The Qt Multimedia module provides APIs for audio, video, radio and camera-related functionality.
|
||||
\brief The Qt Multimedia module provides APIs for audio, video, radio, and
|
||||
camera-related functionality.
|
||||
|
||||
Qt Multimedia is an essential module that provides a rich set of QML types and C++ classes to handle multimedia content. It also provides necessary APIs to access the camera and radio functionality.
|
||||
Qt Multimedia is an essential module that provides a rich set of QML types
|
||||
and C++ classes to handle multimedia content. It also provides necessary
|
||||
APIs to access the camera and radio functionality.
|
||||
|
||||
The \l{Qt Multimedia Widgets} module provides widget based multimedia classes.
|
||||
The \l{Qt Multimedia Widgets} module provides widget based multimedia
|
||||
classes.
|
||||
|
||||
\section1 Getting started
|
||||
\section1 Getting Started
|
||||
|
||||
The QML types can be imported into your applciation using the following import statement in your \c {.qml} file.
|
||||
The QML types can be imported into your applciation using the following
|
||||
import statement in your \c {.qml} file.
|
||||
|
||||
\code
|
||||
import QtMultimedia 5.0
|
||||
\endcode
|
||||
|
||||
If you intend to use the C++ classes in your application, include the C++ definitions using the following directive:
|
||||
If you intend to use the C++ classes in your application, include the C++
|
||||
definitions using the following directive:
|
||||
|
||||
\code
|
||||
#include <QtMultimedia>
|
||||
\endcode
|
||||
|
||||
\note If you are using a few classes from this module, we recommend including those specific classes only instead of the module.
|
||||
\note If you are using a few classes from this module, we recommend
|
||||
including those specific classes only instead of the module.
|
||||
|
||||
To link against the corresponding C++ libraries, add the following to your \c {qmake} project file:
|
||||
To link against the corresponding C++ libraries, add the following to your
|
||||
\c {qmake} project file:
|
||||
|
||||
\code
|
||||
QT += multimedia
|
||||
\endcode
|
||||
|
||||
\section1 QML types and C++ classes
|
||||
\section1 QML Types and C++ Classes
|
||||
|
||||
The following is a list of important QML types and C++ classes provided by this module:
|
||||
The following is a list of important QML types and C++ classes provided by
|
||||
this module:
|
||||
|
||||
\table
|
||||
\header
|
||||
@@ -72,13 +81,15 @@
|
||||
\li Access camera viewfinder frames
|
||||
\row
|
||||
\li MediaPlayer
|
||||
\li Add media playback functionality to a scene. It is same as Audio type, but can be used for video playback with the VideoOutput type.
|
||||
\li Add media playback functionality to a scene. It is same as Audio type,
|
||||
but can be used for video playback with the VideoOutput type.
|
||||
\row
|
||||
\li \l {QtMultimedia5::Radio}{Radio}
|
||||
\li Access radio functionality
|
||||
\row
|
||||
\li \l {QtMultimedia5::Video}{Video}
|
||||
\li Add Video playback functionality to a scene. It uses MediaPlayer and VideoOutput types to provide video playback functionality.
|
||||
\li Add Video playback functionality to a scene. It uses MediaPlayer and
|
||||
VideoOutput types to provide video playback functionality.
|
||||
\endtable
|
||||
|
||||
\table
|
||||
@@ -105,11 +116,11 @@
|
||||
\li Control video data.
|
||||
\endtable
|
||||
|
||||
\section1 Related information
|
||||
\section1 Related Information
|
||||
|
||||
\section2 Guides
|
||||
\list
|
||||
\li \l{Qt Multimedia Overview}
|
||||
\li \l Multimedia - overview of multimedia support in Qt
|
||||
\li \l{Audio Overview}
|
||||
\li \l{Positional Audio}
|
||||
\li \l{Video Overview}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
#include <qvideorenderercontrol.h>
|
||||
#include <private/qvideosurfacegstsink_p.h>
|
||||
#include <qabstractvideosurface.h>
|
||||
|
||||
#include "qgstreamervideorendererinterface_p.h"
|
||||
|
||||
@@ -74,7 +75,7 @@ private slots:
|
||||
|
||||
private:
|
||||
QVideoSurfaceGstSink *m_videoSink;
|
||||
QAbstractVideoSurface *m_surface;
|
||||
QPointer<QAbstractVideoSurface> m_surface;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
|
||||
|
||||
project = qtmultimediawidgets
|
||||
project = QtMultimediaWidgets
|
||||
description = Qt Multimedia Widgets Documentation
|
||||
url = http://qt-project.org/doc/qt-$QT_VER/qtmultimediawidgets
|
||||
version = $QT_VERSION
|
||||
@@ -12,22 +12,18 @@ version = $QT_VERSION
|
||||
# Defines the name of the project. You cannot use operators (+, =, -) in
|
||||
# the name. Properties for this project are set using a qhp.<projectname>.property
|
||||
# format.
|
||||
qhp.projects = qtmultimediawidgets
|
||||
qhp.qtmultimediawidgets.file = qtmultimediawidgets.qhp
|
||||
qhp.qtmultimediawidgets.namespace = org.qt-project.qtmultimediawidgets.$QT_VERSION_TAG
|
||||
qhp.qtmultimediawidgets.indexTitle = Qt Multimedia
|
||||
qhp.qtmultimediawidgets.virtualFolder = qtmultimediawidgets
|
||||
qhp.projects = QtMultimediaWidgets
|
||||
qhp.QtMultimediaWidgets.file = qtmultimediawidgets.qhp
|
||||
qhp.QtMultimediaWidgets.namespace = org.qt-project.qtmultimediawidgets.$QT_VERSION_TAG
|
||||
qhp.QtMultimediaWidgets.indexTitle = Qt Multimedia Widgets
|
||||
qhp.QtMultimediaWidgets.virtualFolder = qtmultimediawidgets
|
||||
|
||||
# For listing child nodes in Qt Creator or Assistant.
|
||||
qhp.qtmultimediawidgets.subprojects = classes qmltypes
|
||||
qhp.qtmultimediawidgets.subprojects.classes.title = C++ Classes
|
||||
qhp.qtmultimediawidgets.subprojects.classes.indexTitle = Qt Multimedia Widgets C++ Classes
|
||||
qhp.qtmultimediawidgets.subprojects.classes.selectors = class fake:headerfile
|
||||
qhp.qtmultimediawidgets.subprojects.classes.sortPages = true
|
||||
qhp.qtmultimediawidgets.subprojects.qmltypes.title = QML Types
|
||||
qhp.qtmultimediawidgets.subprojects.qmltypes.indexTitle = Qt Multimedia Widgets QML Types
|
||||
qhp.qtmultimediawidgets.subprojects.qmltypes.selectors = fake:qmlclass
|
||||
qhp.qtmultimediawidgets.subprojects.qmltypes.sortPages = true
|
||||
qhp.QtMultimediaWidgets.subprojects = classes
|
||||
qhp.QtMultimediaWidgets.subprojects.classes.title = C++ Classes
|
||||
qhp.QtMultimediaWidgets.subprojects.classes.indexTitle = Qt Multimedia Widgets C++ Classes
|
||||
qhp.QtMultimediaWidgets.subprojects.classes.selectors = class fake:headerfile
|
||||
qhp.QtMultimediaWidgets.subprojects.classes.sortPages = true
|
||||
|
||||
exampledirs += ../../../examples/multimediawidgets \
|
||||
snippets
|
||||
|
||||
@@ -103,6 +103,7 @@ public Q_SLOTS:
|
||||
void processEOS();
|
||||
void processLoadStateChange();
|
||||
void processPositionChange();
|
||||
void processMediaLoadError();
|
||||
|
||||
void processCurrentItemChanged();
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ static void *AVFMediaPlayerSessionObserverCurrentItemObservationContext = &AVFMe
|
||||
-(void) assetFailedToPrepareForPlayback:(NSError *)error
|
||||
{
|
||||
Q_UNUSED(error)
|
||||
//TODO: Let the session know that the assest failed to prepare for playback
|
||||
QMetaObject::invokeMethod(m_session, "processMediaLoadError", Qt::AutoConnection);
|
||||
#ifdef QT_DEBUG_AVF
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
qDebug() << [[error localizedDescription] UTF8String];
|
||||
@@ -357,7 +357,7 @@ static void *AVFMediaPlayerSessionObserverCurrentItemObservationContext = &AVFMe
|
||||
else if (context == AVFMediaPlayerSessionObserverCurrentItemObservationContext)
|
||||
{
|
||||
AVPlayerItem *newPlayerItem = [change objectForKey:NSKeyValueChangeNewKey];
|
||||
if (m_playerItem != newPlayerItem);
|
||||
if (m_playerItem != newPlayerItem)
|
||||
{
|
||||
m_playerItem = newPlayerItem;
|
||||
|
||||
@@ -799,13 +799,6 @@ void AVFMediaPlayerSession::processLoadStateChange()
|
||||
[[(AVFMediaPlayerSessionObserver*)m_observer player] setRate:m_rate];
|
||||
[[(AVFMediaPlayerSessionObserver*)m_observer player] play];
|
||||
}
|
||||
|
||||
} else {
|
||||
Q_EMIT error(QMediaPlayer::FormatError, tr("Failed to load media"));
|
||||
Q_EMIT mediaStatusChanged(m_mediaStatus = QMediaPlayer::InvalidMedia);
|
||||
Q_EMIT stateChanged(m_state = QMediaPlayer::StoppedState);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (newStatus != m_mediaStatus)
|
||||
@@ -817,6 +810,13 @@ void AVFMediaPlayerSession::processPositionChange()
|
||||
Q_EMIT positionChanged(position());
|
||||
}
|
||||
|
||||
void AVFMediaPlayerSession::processMediaLoadError()
|
||||
{
|
||||
Q_EMIT error(QMediaPlayer::FormatError, tr("Failed to load media"));
|
||||
Q_EMIT mediaStatusChanged(m_mediaStatus = QMediaPlayer::InvalidMedia);
|
||||
Q_EMIT stateChanged(m_state = QMediaPlayer::StoppedState);
|
||||
}
|
||||
|
||||
void AVFMediaPlayerSession::processCurrentItemChanged()
|
||||
{
|
||||
#ifdef QT_DEBUG_AVF
|
||||
|
||||
@@ -40,9 +40,11 @@
|
||||
****************************************************************************/
|
||||
#include "bbserviceplugin.h"
|
||||
|
||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
||||
#include "bbcameraservice.h"
|
||||
#include "bbmediaplayerservice.h"
|
||||
#include "bbvideodeviceselectorcontrol.h"
|
||||
#endif
|
||||
#include "bbmediaplayerservice.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
@@ -54,8 +56,10 @@ BbServicePlugin::BbServicePlugin()
|
||||
|
||||
QMediaService *BbServicePlugin::create(const QString &key)
|
||||
{
|
||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
||||
if (key == QLatin1String(Q_MEDIASERVICE_CAMERA))
|
||||
return new BbCameraService();
|
||||
#endif
|
||||
|
||||
if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER))
|
||||
return new BbMediaPlayerService();
|
||||
@@ -102,7 +106,9 @@ QString BbServicePlugin::deviceDescription(const QByteArray &service, const QByt
|
||||
|
||||
void BbServicePlugin::updateDevices() const
|
||||
{
|
||||
#ifndef Q_OS_BLACKBERRY_TABLET
|
||||
BbVideoDeviceSelectorControl::enumerateDevices(&m_cameraDevices, &m_cameraDescriptions);
|
||||
#endif
|
||||
|
||||
if (m_cameraDevices.isEmpty()) {
|
||||
qWarning() << "No camera devices found";
|
||||
|
||||
@@ -11,7 +11,11 @@ HEADERS += bbserviceplugin.h
|
||||
SOURCES += bbserviceplugin.cpp
|
||||
|
||||
include(common/common.pri)
|
||||
|
||||
!blackberry-playbook {
|
||||
include(camera/camera.pri)
|
||||
}
|
||||
|
||||
include(mediaplayer/mediaplayer.pri)
|
||||
|
||||
OTHER_FILES += blackberry_mediaservice.json
|
||||
|
||||
@@ -335,7 +335,7 @@ static void imageCaptureImageCallback(camera_handle_t handle, camera_buffer_t *b
|
||||
QMetaObject::invokeMethod(data->session, "imageCaptureError", Qt::QueuedConnection,
|
||||
Q_ARG(int, data->requestId),
|
||||
Q_ARG(QCameraImageCapture::Error, QCameraImageCapture::FormatError),
|
||||
Q_ARG(QString, QObject::tr("Camera provides image in unsupported format")));
|
||||
Q_ARG(QString, BbCameraSession::tr("Camera provides image in unsupported format")));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ static void imageCaptureImageCallback(camera_handle_t handle, camera_buffer_t *b
|
||||
QImage image;
|
||||
const bool ok = image.loadFromData(rawData, "JPG");
|
||||
if (!ok) {
|
||||
const QString errorMessage = QObject::tr("Could not load JPEG data from frame");
|
||||
const QString errorMessage = BbCameraSession::tr("Could not load JPEG data from frame");
|
||||
// We are inside a worker thread here, so emit error signal inside the main thread
|
||||
QMetaObject::invokeMethod(data->session, "imageCaptureError", Qt::QueuedConnection,
|
||||
Q_ARG(int, data->requestId),
|
||||
|
||||
@@ -87,6 +87,30 @@ void WindowGrabber::start()
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
#ifdef Q_OS_BLACKBERRY_TABLET
|
||||
|
||||
// HACK: On the Playbook, screen_read_window() will fail for invisible windows.
|
||||
// To workaround this, make the window visible again, but set a global
|
||||
// alpha of less than 255. The global alpha makes the window completely invisible
|
||||
// (due to a bug?), but screen_read_window() will work again.
|
||||
|
||||
errno = 0;
|
||||
int val = 200; // anything less than 255
|
||||
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_GLOBAL_ALPHA, &val);
|
||||
if (result != 0) {
|
||||
qWarning() << "WindowGrabber: unable to set global alpha:" << strerror(errno);
|
||||
return;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
val = 1;
|
||||
result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &val);
|
||||
if (result != 0) {
|
||||
qWarning() << "WindowGrabber: unable to make window visible:" << strerror(errno);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
result = screen_create_context(&m_screenContext, SCREEN_APPLICATION_CONTEXT);
|
||||
if (result != 0) {
|
||||
qWarning() << "WindowGrabber: cannot create screen context:" << strerror(errno);
|
||||
|
||||
@@ -672,7 +672,7 @@ void CameraBinSession::updateBusyStatus(GObject *o, GParamSpec *p, gpointer d)
|
||||
Q_UNUSED(p);
|
||||
CameraBinSession *session = reinterpret_cast<CameraBinSession *>(d);
|
||||
|
||||
bool idle = false;
|
||||
gboolean idle = false;
|
||||
g_object_get(o, "idle", &idle, NULL);
|
||||
bool busy = !idle;
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@ QT += multimedia-private
|
||||
CONFIG += no_private_qt_headers_warning
|
||||
|
||||
PLUGIN_TYPE = audio
|
||||
|
||||
load(qt_plugin)
|
||||
DESTDIR = $$QT.multimedia.plugins/$${PLUGIN_TYPE}
|
||||
|
||||
LIBS += -lasound
|
||||
|
||||
HEADERS += qnxaudioplugin.h \
|
||||
@@ -21,6 +20,3 @@ SOURCES += qnxaudioplugin.cpp \
|
||||
qnxaudioutils.cpp
|
||||
|
||||
OTHER_FILES += qnx_audio.json
|
||||
|
||||
target.path += $$[QT_INSTALL_PLUGINS]/$${PLUGIN_TYPE}
|
||||
INSTALLS += target
|
||||
|
||||
@@ -767,9 +767,9 @@ void tst_QAudioInput::pushSuspendResume()
|
||||
QVERIFY(audioInput.processedUSecs() == processedUs);
|
||||
|
||||
// Drain any data, in case we run out of space when resuming
|
||||
while (audioInput.bytesReady() >= audioInput.periodSize()) {
|
||||
const int reads = audioInput.bytesReady() / audioInput.periodSize();
|
||||
for (int r = 0; r < reads; ++r)
|
||||
feed->read(buffer.data(), audioInput.periodSize());
|
||||
}
|
||||
|
||||
audioInput.resume();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user