summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/multimedia/qmldir1
-rw-r--r--src/multimedia/platform/android/common/qandroidvideooutput.cpp63
-rw-r--r--src/multimedia/platform/android/common/qandroidvideooutput_p.h8
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp41
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h3
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp45
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol_p.h8
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp4
-rw-r--r--src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h2
-rw-r--r--src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol.cpp42
-rw-r--r--src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol_p.h2
-rw-r--r--src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol.cpp4
-rw-r--r--src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol_p.h8
-rw-r--r--src/multimedia/platform/android/wrappers/jni/androidcamera.cpp8
14 files changed, 92 insertions, 147 deletions
diff --git a/src/imports/multimedia/qmldir b/src/imports/multimedia/qmldir
index 48cdb0c8c..e7dcc3dd6 100644
--- a/src/imports/multimedia/qmldir
+++ b/src/imports/multimedia/qmldir
@@ -2,7 +2,6 @@ module QtMultimedia
plugin declarative_multimedia
classname QMultimediaDeclarativeModule
typeinfo plugins.qmltypes
-prefer :/qt-project.org/imports/QtMultimedia/
typeinfo plugins.qmltypes
Video 5.0 Video.qml
diff --git a/src/multimedia/platform/android/common/qandroidvideooutput.cpp b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
index 909a5b573..a9c879c1a 100644
--- a/src/multimedia/platform/android/common/qandroidvideooutput.cpp
+++ b/src/multimedia/platform/android/common/qandroidvideooutput.cpp
@@ -40,9 +40,11 @@
#include "qandroidvideooutput_p.h"
#include "androidsurfacetexture_p.h"
-#include <QAbstractVideoSurface>
+#include <qvideosink.h>
#include "private/qabstractvideobuffer_p.h"
#include <QVideoSurfaceFormat>
+#include <qvideosink.h>
+
#include <qevent.h>
#include <qcoreapplication.h>
#include <qopenglcontext.h>
@@ -170,7 +172,7 @@ private:
QAndroidTextureVideoOutput::QAndroidTextureVideoOutput(QObject *parent)
: QAndroidVideoOutput(parent)
- , m_surface(0)
+ , m_sink(0)
, m_surfaceTexture(0)
, m_externalTex(0)
, m_fbo(0)
@@ -195,28 +197,25 @@ QAndroidTextureVideoOutput::~QAndroidTextureVideoOutput()
}
}
-QAbstractVideoSurface *QAndroidTextureVideoOutput::surface() const
+QVideoSink *QAndroidTextureVideoOutput::surface() const
{
- return m_surface;
+ return m_sink;
}
-void QAndroidTextureVideoOutput::setSurface(QAbstractVideoSurface *surface)
+void QAndroidTextureVideoOutput::setSurface(QVideoSink *surface)
{
- if (surface == m_surface)
+ if (surface == m_sink)
return;
- if (m_surface) {
- if (m_surface->isActive())
- m_surface->stop();
-
+ if (m_sink) {
if (!m_surfaceTextureCanAttachToContext)
- m_surface->setProperty("_q_GLThreadCallback", QVariant());
+ m_sink->setProperty("_q_GLThreadCallback", QVariant());
}
- m_surface = surface;
+ m_sink = surface;
- if (m_surface && !m_surfaceTextureCanAttachToContext) {
- m_surface->setProperty("_q_GLThreadCallback",
+ if (m_sink && !m_surfaceTextureCanAttachToContext) {
+ m_sink->setProperty("_q_GLThreadCallback",
QVariant::fromValue<QObject*>(this));
}
}
@@ -231,7 +230,7 @@ bool QAndroidTextureVideoOutput::initSurfaceTexture()
if (m_surfaceTexture)
return true;
- if (!m_surface)
+ if (!m_sink)
return false;
if (!m_surfaceTextureCanAttachToContext) {
@@ -303,42 +302,27 @@ void QAndroidTextureVideoOutput::setVideoSize(const QSize &size)
void QAndroidTextureVideoOutput::stop()
{
- if (m_surface && m_surface->isActive())
- m_surface->stop();
m_nativeSize = QSize();
}
void QAndroidTextureVideoOutput::reset()
{
// flush pending frame
- if (m_surface)
- m_surface->present(QVideoFrame());
+ if (m_sink)
+ m_sink->newVideoFrame(QVideoFrame());
clearSurfaceTexture();
}
void QAndroidTextureVideoOutput::onFrameAvailable()
{
- if (!m_nativeSize.isValid() || !m_surface)
+ if (!m_nativeSize.isValid() || !m_sink)
return;
QAbstractVideoBuffer *buffer = new AndroidTextureVideoBuffer(this, m_nativeSize);
- QVideoFrame frame(buffer, m_nativeSize, QVideoSurfaceFormat::Format_ABGR32);
-
- if (m_surface->isActive() && (m_surface->surfaceFormat().pixelFormat() != frame.pixelFormat()
- || m_surface->surfaceFormat().frameSize() != frame.size())) {
- m_surface->stop();
- }
-
- if (!m_surface->isActive()) {
- QVideoSurfaceFormat format(frame.size(), frame.pixelFormat(),
- QVideoFrame::GLTextureHandle);
-
- m_surface->start(format);
- }
+ QVideoFrame frame(buffer, QVideoSurfaceFormat(m_nativeSize, QVideoSurfaceFormat::Format_ABGR32));
- if (m_surface->isActive())
- m_surface->present(frame);
+ m_sink->newVideoFrame(frame);
}
bool QAndroidTextureVideoOutput::renderFrameToFbo()
@@ -348,8 +332,8 @@ bool QAndroidTextureVideoOutput::renderFrameToFbo()
if (!m_nativeSize.isValid() || !m_surfaceTexture)
return false;
- QOpenGLContext *shareContext = !m_glContext && m_surface
- ? qobject_cast<QOpenGLContext*>(m_surface->property("GLContext").value<QObject*>())
+ QOpenGLContext *shareContext = !m_glContext && m_sink
+ ? qobject_cast<QOpenGLContext*>(m_sink->property("GLContext").value<QObject*>())
: nullptr;
// Make sure we have an OpenGL context to make current.
@@ -360,15 +344,12 @@ bool QAndroidTextureVideoOutput::renderFrameToFbo()
// Needs geometry to be a valid surface, but size is not important.
m_offscreenSurface->setGeometry(0, 0, 1, 1);
m_offscreenSurface->create();
- m_offscreenSurface->moveToThread(m_surface->thread());
+ m_offscreenSurface->moveToThread(m_sink->thread());
// Create OpenGL context and set share context from surface.
m_glContext = new QOpenGLContext();
m_glContext->setFormat(m_offscreenSurface->requestedFormat());
- auto surface = qobject_cast<QAbstractVideoSurface *>(m_surface->property("videoSurface").value<QObject *>());
- if (!surface)
- surface = m_surface;
if (shareContext)
m_glContext->setShareContext(shareContext);
diff --git a/src/multimedia/platform/android/common/qandroidvideooutput_p.h b/src/multimedia/platform/android/common/qandroidvideooutput_p.h
index dbc53ca44..b912b9150 100644
--- a/src/multimedia/platform/android/common/qandroidvideooutput_p.h
+++ b/src/multimedia/platform/android/common/qandroidvideooutput_p.h
@@ -61,9 +61,9 @@ class AndroidSurfaceTexture;
class AndroidSurfaceHolder;
class QOpenGLFramebufferObject;
class QOpenGLShaderProgram;
-class QAbstractVideoSurface;
class QWindow;
class QOpenGLContext;
+class QVideoSink;
class QAndroidVideoOutput : public QObject
{
@@ -110,8 +110,8 @@ public:
explicit QAndroidTextureVideoOutput(QObject *parent = 0);
~QAndroidTextureVideoOutput() override;
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
+ QVideoSink *surface() const;
+ void setSurface(QVideoSink *surface);
AndroidSurfaceTexture *surfaceTexture() override;
@@ -133,7 +133,7 @@ private:
QMutex m_mutex;
void clearSurfaceTexture();
- QAbstractVideoSurface *m_surface;
+ QVideoSink *m_sink;
QSize m_nativeSize;
AndroidSurfaceTexture *m_surfaceTexture;
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp b/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
index fb1539b5a..3abb2ce74 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcamerasession.cpp
@@ -48,7 +48,7 @@
#include "qandroidcameraexposurecontrol_p.h"
#include "qandroidcamerafocuscontrol_p.h"
#include "qandroidcameraimageprocessingcontrol_p.h"
-#include <qabstractvideosurface.h>
+#include <qvideosink.h>
#include <QtConcurrent/qtconcurrentrun.h>
#include <qfile.h>
#include <qguiapplication.h>
@@ -361,21 +361,6 @@ QList<AndroidCamera::FpsRange> QAndroidCameraSession::getSupportedPreviewFpsRang
return m_camera ? m_camera->getSupportedPreviewFpsRange() : QList<AndroidCamera::FpsRange>();
}
-struct NullSurface : QAbstractVideoSurface
-{
- NullSurface(QObject *parent = nullptr) : QAbstractVideoSurface(parent) { }
- QList<QVideoSurfaceFormat::PixelFormat> supportedPixelFormats(
- QVideoFrame::HandleType type = QVideoFrame::NoHandle) const override
- {
- QList<QVideoSurfaceFormat::PixelFormat> result;
- if (type == QVideoFrame::NoHandle)
- result << QVideoSurfaceFormat::Format_NV21;
-
- return result;
- }
-
- bool present(const QVideoFrame &) override { return false; }
-};
bool QAndroidCameraSession::startPreview()
{
@@ -385,22 +370,16 @@ bool QAndroidCameraSession::startPreview()
if (m_previewStarted)
return true;
- if (m_videoOutput) {
- if (!m_videoOutput->isReady())
- return true; // delay starting until the video output is ready
+ Q_ASSERT(m_videoOutput);
- Q_ASSERT(m_videoOutput->surfaceTexture() || m_videoOutput->surfaceHolder());
+ if (!m_videoOutput->isReady())
+ return true; // delay starting until the video output is ready
- if ((m_videoOutput->surfaceTexture() && !m_camera->setPreviewTexture(m_videoOutput->surfaceTexture()))
- || (m_videoOutput->surfaceHolder() && !m_camera->setPreviewDisplay(m_videoOutput->surfaceHolder())))
- return false;
- } else {
- auto control = new QAndroidCameraVideoRendererControl(this, this);
- control->setSurface(new NullSurface(this));
- qWarning() << "Starting camera without viewfinder available";
+ Q_ASSERT(m_videoOutput->surfaceTexture() || m_videoOutput->surfaceHolder());
- return true;
- }
+ if ((m_videoOutput->surfaceTexture() && !m_camera->setPreviewTexture(m_videoOutput->surfaceTexture()))
+ || (m_videoOutput->surfaceHolder() && !m_camera->setPreviewDisplay(m_videoOutput->surfaceHolder())))
+ return false;
m_status = QCamera::StartingStatus;
emit statusChanged(m_status);
@@ -720,7 +699,7 @@ void QAndroidCameraSession::processCapturedImage(int id,
emit imageCaptureError(id, QCameraImageCapture::ResourceError, errorMessage);
}
} else {
- QVideoFrame frame(new QMemoryVideoBuffer(data, -1), resolution, QVideoSurfaceFormat::Format_Jpeg);
+ QVideoFrame frame(new QMemoryVideoBuffer(data, -1), QVideoSurfaceFormat(resolution, QVideoSurfaceFormat::Format_Jpeg));
emit imageAvailable(id, frame);
}
}
@@ -797,7 +776,7 @@ bool QAndroidCameraSession::requestRecordingPermission()
return result;
}
-void QAndroidCameraSession::setVideoSurface(QAbstractVideoSurface *surface)
+void QAndroidCameraSession::setVideoSink(QVideoSink *surface)
{
if (!m_renderer)
m_renderer = new QAndroidCameraVideoRendererControl(this);
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
index a444915ec..ec4f91c63 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcamerasession_p.h
@@ -67,6 +67,7 @@ class QAndroidCameraExposureControl;
class QAndroidCameraFocusControl;
class QAndroidCameraImageProcessingControl;
class QAndroidCameraVideoRendererControl;
+class QVideoSink;
class QAndroidCameraSession : public QObject
{
@@ -116,7 +117,7 @@ public:
QAndroidCameraExposureControl *exposureControl() { return m_cameraExposureControl; }
QAndroidCameraImageProcessingControl *imageProcessingControl() { return m_cameraImageProcessingControl; }
- void setVideoSurface(QAbstractVideoSurface *surface);
+ void setVideoSink(QVideoSink *surface);
Q_SIGNALS:
void statusChanged(QCamera::Status status);
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
index 4e88a1337..4952573ac 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol.cpp
@@ -43,7 +43,7 @@
#include "qandroidvideooutput_p.h"
#include "androidsurfaceview_p.h"
#include "qandroidmultimediautils_p.h"
-#include <qabstractvideosurface.h>
+#include <qvideosink.h>
#include <qvideosurfaceformat.h>
#include <qcoreapplication.h>
#include <qthread.h>
@@ -101,8 +101,6 @@ QAndroidCameraDataVideoOutput::QAndroidCameraDataVideoOutput(QAndroidCameraVideo
connect(m_control->cameraSession(), &QAndroidCameraSession::opened,
this, &QAndroidCameraDataVideoOutput::configureFormat);
- connect(m_control->surface(), &QAbstractVideoSurface::supportedFormatsChanged,
- this, &QAndroidCameraDataVideoOutput::configureFormat);
configureFormat();
}
@@ -134,12 +132,10 @@ void QAndroidCameraDataVideoOutput::configureFormat()
if (!m_control->cameraSession()->camera())
return;
- QList<QVideoSurfaceFormat::PixelFormat> surfaceFormats = m_control->surface()->supportedPixelFormats();
QList<AndroidCamera::ImageFormat> previewFormats = m_control->cameraSession()->camera()->getSupportedPreviewFormats();
- for (int i = 0; i < surfaceFormats.size(); ++i) {
- QVideoSurfaceFormat::PixelFormat pixFormat = surfaceFormats.at(i);
- AndroidCamera::ImageFormat f = qt_androidImageFormatFromPixelFormat(pixFormat);
- if (previewFormats.contains(f)) {
+ for (int i = 0; i < previewFormats.size(); ++i) {
+ QVideoSurfaceFormat::PixelFormat pixFormat = qt_pixelFormatFromAndroidImageFormat(previewFormats.at(i));
+ if (pixFormat != QVideoSurfaceFormat::Format_Invalid) {
m_pixelFormat = pixFormat;
break;
}
@@ -166,9 +162,6 @@ void QAndroidCameraDataVideoOutput::stop()
m_mutex.lock();
m_lastFrame = QVideoFrame();
m_mutex.unlock();
-
- if (m_control->surface() && m_control->surface()->isActive())
- m_control->surface()->stop();
}
void QAndroidCameraDataVideoOutput::onFrameAvailable(const QVideoFrame &frame)
@@ -201,24 +194,16 @@ void QAndroidCameraDataVideoOutput::presentFrame()
if (m_control->surface() && m_lastFrame.isValid() && m_lastFrame.pixelFormat() == m_pixelFormat) {
- if (m_control->surface()->isActive() && (m_control->surface()->surfaceFormat().pixelFormat() != m_lastFrame.pixelFormat()
- || m_control->surface()->surfaceFormat().frameSize() != m_lastFrame.size())) {
- m_control->surface()->stop();
- }
+ QVideoSurfaceFormat format(m_lastFrame.surfaceFormat());
+ // Front camera frames are automatically mirrored when using SurfaceTexture or SurfaceView,
+ // but the buffers we get from the data callback are not. Tell the QAbstractVideoSurface
+ // that it needs to mirror the frames.
+ if (m_control->cameraSession()->camera()->getFacing() == AndroidCamera::CameraFacingFront)
+ format.setMirrored(true);
- if (!m_control->surface()->isActive()) {
- QVideoSurfaceFormat format(m_lastFrame.size(), m_lastFrame.pixelFormat(), m_lastFrame.handleType());
- // Front camera frames are automatically mirrored when using SurfaceTexture or SurfaceView,
- // but the buffers we get from the data callback are not. Tell the QAbstractVideoSurface
- // that it needs to mirror the frames.
- if (m_control->cameraSession()->camera()->getFacing() == AndroidCamera::CameraFacingFront)
- format.setMirrored(true);
-
- m_control->surface()->start(format);
- }
+ // #### set mirrored on frame
- if (m_control->surface()->isActive())
- m_control->surface()->present(m_lastFrame);
+ m_control->surface()->newVideoFrame(m_lastFrame);
}
m_lastFrame = QVideoFrame();
@@ -239,12 +224,12 @@ QAndroidCameraVideoRendererControl::~QAndroidCameraVideoRendererControl()
m_cameraSession->setVideoOutput(0);
}
-QAbstractVideoSurface *QAndroidCameraVideoRendererControl::surface() const
+QVideoSink *QAndroidCameraVideoRendererControl::surface() const
{
return m_surface;
}
-void QAndroidCameraVideoRendererControl::setSurface(QAbstractVideoSurface *surface)
+void QAndroidCameraVideoRendererControl::setSurface(QVideoSink *surface)
{
if (m_surface == surface)
return;
@@ -255,7 +240,7 @@ void QAndroidCameraVideoRendererControl::setSurface(QAbstractVideoSurface *surfa
QAndroidVideoOutput *newOutput = 0;
if (m_surface) {
- if (!m_surface->supportedPixelFormats(QVideoFrame::GLTextureHandle).isEmpty()) {
+ if (m_surface->graphicsType() == QVideoSink::OpenGL) {
if (!m_textureOutput) {
m_dataOutput = 0;
newOutput = m_textureOutput = new QAndroidTextureVideoOutput(this);
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol_p.h b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol_p.h
index 57fbabaad..00888a3a5 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcameravideorenderercontrol_p.h
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
class QAndroidCameraSession;
class QAndroidTextureVideoOutput;
class QAndroidCameraDataVideoOutput;
-class QAbstractVideoSurface;
+class QVideoSink;
class QAndroidCameraVideoRendererControl : public QObject
{
@@ -67,14 +67,14 @@ public:
QAndroidCameraVideoRendererControl(QAndroidCameraSession *session, QObject *parent = 0);
~QAndroidCameraVideoRendererControl() override;
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
+ QVideoSink *surface() const;
+ void setSurface(QVideoSink *surface);
QAndroidCameraSession *cameraSession() const { return m_cameraSession; }
private:
QAndroidCameraSession *m_cameraSession;
- QAbstractVideoSurface *m_surface;
+ QVideoSink *m_surface;
QAndroidTextureVideoOutput *m_textureOutput;
QAndroidCameraDataVideoOutput *m_dataOutput;
};
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp
index ff3e23701..ec4813459 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp
+++ b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice.cpp
@@ -140,9 +140,9 @@ bool QAndroidCaptureService::setAudioInput(const QAudioDeviceInfo &info)
return true;
}
-void QAndroidCaptureService::setVideoPreview(QAbstractVideoSurface *surface)
+void QAndroidCaptureService::setVideoPreview(QVideoSink *sink)
{
- m_cameraSession->setVideoSurface(surface);
+ m_cameraSession->setVideoSink(sink);
}
QT_END_NAMESPACE
diff --git a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h
index a6e7edc44..dbe3b07ee 100644
--- a/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h
+++ b/src/multimedia/platform/android/mediacapture/qandroidcaptureservice_p.h
@@ -86,7 +86,7 @@ public:
QAudioDeviceInfo audioInput() const override;
bool setAudioInput(const QAudioDeviceInfo &id) override;
- void setVideoPreview(QAbstractVideoSurface *surface) override;
+ void setVideoPreview(QVideoSink *sink) override;
bool m_videoEnabled = false;
diff --git a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol.cpp b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol.cpp
index 62f263184..16dafc854 100644
--- a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol.cpp
+++ b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol.cpp
@@ -279,25 +279,25 @@ void QAndroidMediaPlayerControl::setCustomAudioRole(const QString &role)
QStringList QAndroidMediaPlayerControl::supportedCustomAudioRoles() const
{
return QStringList()
- << "CONTENT_TYPE_MOVIE"
- << "CONTENT_TYPE_MUSIC"
- << "CONTENT_TYPE_SONIFICATION"
- << "CONTENT_TYPE_SPEECH"
- << "USAGE_ALARM"
- << "USAGE_ASSISTANCE_ACCESSIBILITY"
- << "USAGE_ASSISTANCE_NAVIGATION_GUIDANCE"
- << "USAGE_ASSISTANCE_SONIFICATION"
- << "USAGE_ASSISTANT"
- << "USAGE_GAME"
- << "USAGE_MEDIA"
- << "USAGE_NOTIFICATION"
- << "USAGE_NOTIFICATION_COMMUNICATION_DELAYED"
- << "USAGE_NOTIFICATION_COMMUNICATION_INSTANT"
- << "USAGE_NOTIFICATION_COMMUNICATION_REQUEST"
- << "USAGE_NOTIFICATION_EVENT"
- << "USAGE_NOTIFICATION_RINGTONE"
- << "USAGE_VOICE_COMMUNICATION"
- << "USAGE_VOICE_COMMUNICATION_SIGNALLING";
+ << QLatin1String("CONTENT_TYPE_MOVIE")
+ << QLatin1String("CONTENT_TYPE_MUSIC")
+ << QLatin1String("CONTENT_TYPE_SONIFICATION")
+ << QLatin1String("CONTENT_TYPE_SPEECH")
+ << QLatin1String("USAGE_ALARM")
+ << QLatin1String("USAGE_ASSISTANCE_ACCESSIBILITY")
+ << QLatin1String("USAGE_ASSISTANCE_NAVIGATION_GUIDANCE")
+ << QLatin1String("USAGE_ASSISTANCE_SONIFICATION")
+ << QLatin1String("USAGE_ASSISTANT")
+ << QLatin1String("USAGE_GAME")
+ << QLatin1String("USAGE_MEDIA")
+ << QLatin1String("USAGE_NOTIFICATION")
+ << QLatin1String("USAGE_NOTIFICATION_COMMUNICATION_DELAYED")
+ << QLatin1String("USAGE_NOTIFICATION_COMMUNICATION_INSTANT")
+ << QLatin1String("USAGE_NOTIFICATION_COMMUNICATION_REQUEST")
+ << QLatin1String("USAGE_NOTIFICATION_EVENT")
+ << QLatin1String("USAGE_NOTIFICATION_RINGTONE")
+ << QLatin1String("USAGE_VOICE_COMMUNICATION")
+ << QLatin1String("USAGE_VOICE_COMMUNICATION_SIGNALLING");
}
QMediaMetaData QAndroidMediaPlayerControl::metaData() const
@@ -457,11 +457,11 @@ void QAndroidMediaPlayerControl::setVideoOutput(QAndroidVideoOutput *videoOutput
connect(videoOutput, SIGNAL(readyChanged(bool)), this, SLOT(onVideoOutputReady(bool)));
}
-void QAndroidMediaPlayerControl::setVideoSurface(QAbstractVideoSurface *surface)
+void QAndroidMediaPlayerControl::setVideoSink(QVideoSink *sink)
{
if (!mVideoRendererControl)
mVideoRendererControl = new QAndroidMediaPlayerVideoRendererControl(this);
- mVideoRendererControl->setSurface(surface);
+ mVideoRendererControl->setSurface(sink);
}
void QAndroidMediaPlayerControl::play()
diff --git a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol_p.h b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol_p.h
index 76155540c..12298d4d5 100644
--- a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol_p.h
+++ b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayercontrol_p.h
@@ -94,7 +94,7 @@ public:
QMediaMetaData metaData() const override;
void setVideoOutput(QAndroidVideoOutput *videoOutput);
- void setVideoSurface(QAbstractVideoSurface *surface) override;
+ void setVideoSink(QVideoSink *surface) override;
void setPosition(qint64 position) override;
void play() override;
diff --git a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol.cpp b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol.cpp
index cd7a5dcbe..1699e9495 100644
--- a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol.cpp
+++ b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol.cpp
@@ -59,12 +59,12 @@ QAndroidMediaPlayerVideoRendererControl::~QAndroidMediaPlayerVideoRendererContro
m_mediaPlayerControl->setVideoOutput(0);
}
-QAbstractVideoSurface *QAndroidMediaPlayerVideoRendererControl::surface() const
+QVideoSink *QAndroidMediaPlayerVideoRendererControl::surface() const
{
return m_surface;
}
-void QAndroidMediaPlayerVideoRendererControl::setSurface(QAbstractVideoSurface *surface)
+void QAndroidMediaPlayerVideoRendererControl::setSurface(QVideoSink *surface)
{
if (m_surface == surface)
return;
diff --git a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol_p.h b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol_p.h
index 338ac8eb5..5f47ffee9 100644
--- a/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol_p.h
+++ b/src/multimedia/platform/android/mediaplayer/qandroidmediaplayervideorenderercontrol_p.h
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
class QAndroidMediaPlayerControl;
class QAndroidTextureVideoOutput;
-class QAbstractVideoSurface;
+class QVideoSink;
class QAndroidMediaPlayerVideoRendererControl : public QObject
{
@@ -66,12 +66,12 @@ public:
QAndroidMediaPlayerVideoRendererControl(QAndroidMediaPlayerControl *mediaPlayer, QObject *parent = 0);
~QAndroidMediaPlayerVideoRendererControl() override;
- QAbstractVideoSurface *surface() const;
- void setSurface(QAbstractVideoSurface *surface);
+ QVideoSink *surface() const;
+ void setSurface(QVideoSink *surface);
private:
QAndroidMediaPlayerControl *m_mediaPlayerControl;
- QAbstractVideoSurface *m_surface;
+ QVideoSink *m_surface;
QAndroidTextureVideoOutput *m_textureOutput;
};
diff --git a/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp b/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
index 2ea555c2c..952f1e4e9 100644
--- a/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
+++ b/src/multimedia/platform/android/wrappers/jni/androidcamera.cpp
@@ -149,8 +149,8 @@ static void notifyNewPreviewFrame(JNIEnv *env, jobject, int id, jbyteArray data,
env->GetByteArrayRegion(data, 0, arrayLength, (jbyte*)bytes.data());
QVideoFrame frame(new QMemoryVideoBuffer(bytes, bpl),
- QSize(width, height),
- qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format)));
+ QVideoSurfaceFormat(QSize(width, height),
+ qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format))));
Q_EMIT (*it)->newPreviewFrame(frame);
}
@@ -1642,8 +1642,8 @@ void AndroidCameraPrivate::fetchLastPreviewFrame()
const int bpl = m_cameraListener.callMethod<jint>("previewBytesPerLine");
QVideoFrame frame(new QMemoryVideoBuffer(bytes, bpl),
- QSize(width, height),
- qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format)));
+ QVideoSurfaceFormat(QSize(width, height),
+ qt_pixelFormatFromAndroidImageFormat(AndroidCamera::ImageFormat(format))));
emit lastPreviewFrameFetched(frame);
}