Commit Graph

1496 Commits

Author SHA1 Message Date
Yoann Lopes
e48546b44f GStreamer: runtime check for controls that require GstPhotography.
Exposure, Flash, Focus and Locks controls were always initialized,
even when the GstPhotography interface was not available (on desktop
for example), causing some warnings and fooling the user in believing
that these features were available.
These controls are now lazily initialized and only when
GstPhotography is available.

The zoom control is not compile-checked anymore since it doesn't
actually require GstPhotography.

Change-Id: I5e8315d796dd920c9c29ccfa4155707f5f0fd7dc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:20 +00:00
Yoann Lopes
d4f88c3ec9 GStreamer 1.0: fix some problems with QGstVideoRendererSink.
- Correctly free resources on deletion.
- Correctly stop the sink. We were stopping only when null caps
  were passed to set_caps() but that doesn't seem to always happen.
  Implement GstBaseSink.stop() which is always and consistently
  called by GStreamer.
- Remove pre-roll support (as done previously for 0.10, see
  commit 3b20608f).

Change-Id: I4c5808938f244f4f8a35e121a3a4a862588b752d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:15 +00:00
Yoann Lopes
e4bf7d90bf GStreamer: implemented QCameraViewfinderSettingsControl2.
Change-Id: I4436e39c152f6c251792c1504d4a7b57db7b9d9a
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:09 +00:00
Yoann Lopes
82e71d733f GStreamer 1.0: fix frame rate retrieved with QGstUtils::formatFromCaps.
Change-Id: I88e8416e50440bbd14b34a8b2b3b262b5c8401ab
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:05 +00:00
Yoann Lopes
d9354b2299 GStreamer: fix camerabin state and status changes.
Not all status changes where reported and setting the QCamera
to LoadedState was not actually loading anything.

State and status changes have been refactored.
Camera status is now reported directly by the camera session.
Setting the camera state to LoadedState now sets the camerabin to
GST_STATE_READY, that allows to query for camera capabilities without
having to start the camera (and have a valid viewfinder).

Change-Id: I249b1ad32690679ff34a427410bc709ed3ab461c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:14:59 +00:00
Sergio Ahumada
e49d92959c Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I89bfde0a1618ebf3b34948c1c1f74c2cbf5d8abf
2015-02-17 16:12:27 +01:00
Sergio Ahumada
36e90b6928 Fix BSD license headers
Change-Id: I639ed933b789393fa50630af133e51abe3d7fae3
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-17 13:32:36 +00:00
Yoann Lopes
df66e8a4ba Use configured GStreamer version.
The gstreamer version detected or set by the configure script can be
overridden by passing GST_VERSION=<version> to qmake qtmultimedia.pro.

Change-Id: I6f2eac3705d3d6fe0ec8e79042017add6751ee8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-16 16:01:16 +00:00
Antti Kokko
bbfccc7135 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-12 10:27:47 +00:00
Timur Pocheptsov
6ad5ea7fa0 Camera zoom control - version for the AVFoundation plugin
AVFCameraZoomControl for AVFoundation plugin (videoZoomFactor in
AVCaptureDeviceFormat). iOS only.

Change-Id: I585b8df4c2a477971ada7bd81fabbd44f2371d98
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-05 22:23:49 +00:00
Timur Pocheptsov
39f5de4106 AVFCameraExposureControl - exposure control for iOS
Exposure control, version for AVFoundation plugin (this code is using
quite a new API, iOS >=8 only).

Change-Id: I6871a758e8dfb98ab46b66d91a44142163e0bb44
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-05 17:25:10 +00:00
Timur Pocheptsov
60541844c1 AVFCameraFocusControl - focus control for iOS / OS X
Camera focus control for AVFoundation plugin (iOS/OS X).

Change-Id: I0a79e7057ecbb66413debb8eac0f48ff679fc7ba
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-05 17:24:59 +00:00
Yoann Lopes
bc2c42d6c6 Camera: update viewfinder settings on Loaded status.
Change-Id: I9a341c7500b09d39554118689e6e83cd1b798e39
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-02-04 17:09:10 +00:00
James Turner
9444c8ec61 iOS video frame render implementation.
Uses CVTextureCache, iOS only for now, OS-X code could be ported
but will need further work to support TEXTURE_RECTANGLE in the
QVideoNode classes.

When we can’t share a context, falls back to an offscreen window,
FBO rendering and grabbing a QImage.

Change-Id: I23b831fdcc63aeb1b67b7741d8d56779470240d3
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-04 11:28:02 +00:00
Laszlo Agocs
3e94b7ce2d Add video filtering support to VideoOutput
Add the QAbstractVideoFilter base class and integrate it with VideoOutput.

This can be used to perform arbitrary filtering or image processing
on the frames of a video stream of a VideoOutput element right before
the OpenGL texture is provided to the scenegraph by the video node.

This opens up the possibility to integrate computer vision
frameworks or accelerated image processing with Qt Quick applications
that display video streams using Qt Multimedia.

Conceptually it is somewhat similar to QVideoProbe, this
approach however allows modifying the frame, in real time
with tight integration to the scenegraph node, and targets
Qt Quick meaning setting up the filter and processing the results
of the computations happen completely in QML.

[ChangeLog] Added QAbstractVideoFilter that serves as a base class for QML
video filtering elements that integrate compute, vision, and image processing
frameworks with VideoOutput.

Change-Id: Ice1483f8c2daec5a43536978627a7bbb64549480
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-03 14:41:39 +00:00
Yoann Lopes
2f49444638 Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2015-01-23 12:22:50 +01:00
Laszlo Agocs
d07a22c884 Fix initialization order
Avoid the following warning:

In file included from qgstreamerplayersession.cpp:34:0:
qgstreamerplayersession.h: In constructor ‘QGstreamerPlayerSession::QGstreamerPlayerSession(QObject*)’:
qgstreamerplayersession.h:203:10: warning: ‘QGstreamerPlayerSession::m_usingColorspaceElement’ will be initialized after [-Wreorder]
     bool m_usingColorspaceElement;
          ^
qgstreamerplayersession.h:197:17: warning:   ‘GstElement* QGstreamerPlayerSession::m_videoSink’ [-Wreorder]
     GstElement* m_videoSink;
                 ^
qgstreamerplayersession.cpp:107:1: warning:   when initialized here [-Wreorder]
 QGstreamerPlayerSession::QGstreamerPlayerSession(QObject *parent)
 ^

Change-Id: Ic4dfe6ead19db8d581cc7de622f478e63524715b
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-01-19 15:01:51 +01:00
Yoann Lopes
af2d5a181c Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	.qmake.conf
	src/plugins/gstreamer/camerabin/camerabinsession.cpp

Change-Id: I66a6f3efc5391013934b6b321073c31f25e1de26
2015-01-19 14:45:09 +01:00
Oswald Buddenhagen
4ab105b89e Bump version
Change-Id: I29a6579deefb4ca80bb014c43ee34697fa89bd47
2015-01-16 21:06:40 +01:00
James Turner
9a215d954b Rename camera classes to avoid name clash.
Change-Id: I08fe8f7e75bdbf2c4975863642072061741b5bc6
Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-01-15 10:45:11 +01:00
Yoann Lopes
fe21ee675e New camera viewfinder settings API.
There already was a control interface for the viewfinder settings
but no real public C++ API and a partial QML API.

This patch adds a new C++ API and improves the QML API.

Supported viewfinder settings are resolution, minimumFrameRate,
maximumFrameRate and pixelFormat. The camera can be queried for
the supported values for each of these settings.

A new control interface was created to match the new API.

Change-Id: I289fea038fe46277a5516c956a64280da09ed985
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-01-13 13:34:41 +01:00
Laszlo Agocs
c93d83c4b7 Add resolution and fps on mfw_v4lsrc
Add support for changing resolution and frame rate with mfw_v4lsrc.
This is essential for embedded applications that are not happy with
the default VGA@30.

This makes constructs like the following functional on devices like
i.MX6 with MIPI cameras:

Camera { viewfinder { resolution: "320x240"; maximumFrameRate: 15 } }

Change-Id: Ia297afdb5ca51c6e55ad45dce37fdab7da3a5cfb
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-01-12 19:52:13 +01:00
Laszlo Agocs
bf8f6c88c9 Migrate to categorized logging in Quick 2 video output
Enable qt.multimedia.video to get the logs. Also enhance the printing
when creating the video node implementation. It is essential to have
an easy way to figure out what handle and formats the node in use
supports.

Change-Id: Idf3a9f076ba03b5e613c19f2347204c841850b45
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-01-09 16:07:03 +01:00
Laszlo Agocs
03593d86b8 Support byte ordered QImage formats in pixelFormatFromImageFormat
For QVideoFrame purposes they are equivalent.

Change-Id: I776c60aa8ca848e58499bbd0c1fc25c457d46ef6
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-01-09 11:32:33 +01:00
Timur Pocheptsov
c31d8cddd0 AVFImageCaptureControl - invalid connection
AVCaptureConnection from AVCaptureStillImageOutput becomes invalid
as we remove/add AVCaptureDevice.

Change-Id: I698ffcc0b91b76cd5d7c25e4b244eaa0aa459159
Task-number: QTBUG-42035
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-01-08 17:48:12 +01:00
Friedemann Kleint
4459561dd5 Add missing includes for QDataStream/QIODevice.
After qtbase/90e7cc172a7521396bb2d49720ee4ceb9a9390b3,
QStringList no longer includes QDataStream.

Change-Id: Ibe3e1e6542e1b592adaabe3f8ffd3268efaf289b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2015-01-07 23:11:16 +01:00
Laszlo Agocs
a15cf55bc4 Support YUV420P in the i.MX6 video node
Camera input is often in this format. Until now the lack of GL_VIV_I420 (which
was presumably missing in older versions of the extension?) in the format list
resulted in falling back to the built-in i420 node instead of the zero-copy imx6
one. This is now corrected by adding the correct format mapping.

Change-Id: I6e891bb3bb07d64ccd5b2d170b052f677c8bd19c
Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
2015-01-06 11:46:13 +01:00
Frederik Gladhorn
f450c31af6 Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2014-12-29 16:17:38 +01:00
Dmitry Shachnev
b21a66a608 Fix some typos in strings.
s/Endianess/Endianness/
s/changable/changeable/

Change-Id: I91a43ff6e6143f2d3fc0a93aa8bbf34a415eea90
Reviewed-by: Andrew Knight <qt@panimo.net>
2014-12-25 15:10:37 +01:00
Gabriel Hege
68dbc9ba02 Fix: static linking on Linux with both PulseAudio and Alsa plugins
Fixed multiply defined symbols when linking statically with both
PulseAudio and Alsa plugins enabled:
The private classes In/OutputPrivate had identical names and have been
renamed.

Change-Id: I9415beeeed9fb0e14ead3f0ab906f343b3934341
Task-number: QTBUG-43514
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-12-22 15:48:42 +01:00
Jani Heikkinen
61fd649861 remove unnecessary LICENSE.GPLv2
Change-Id: Ic2be97ac71f2dbf48925b2ee7fb4ab291c7573c7
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2014-12-22 10:50:46 +01:00
Frederik Gladhorn
47698fc57f Merge remote-tracking branch 'origin/5.4' into dev
Conflicts:
	.qmake.conf

Change-Id: I31e377cdccf8bf5c1ea8143faf2001ac99608c27
2014-12-17 16:53:41 +01:00
Frederik Gladhorn
a864bfa412 Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: Ice62a75ba6ff094e22e8affbecf26f4d3bf2f282
2014-12-17 12:59:05 +01:00
Oswald Buddenhagen
cb0fb37b10 Bump version
Change-Id: I7e93575a6e3767485e2a5430312e87527b2c9b2d
2014-12-12 13:48:26 +01:00
Andrew Knight
ce7b59c28d winrt: Add missing QAbstractVideoSurface::stop() call.
This was preventing the surface from restarting with a different format.

Change-Id: I1f86ddb1b16618f167183c7e2fcb32658df578f3
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2014-12-11 16:49:07 +01:00
Andrew Knight
1027215920 winrt: Fix encoding properties
These should match the capture mode. Additionally, there was a semantic
error preventing the encoding properties from being properly selected.
This fixes a bug in which the viewfinder was receiving frames too large
for display as an OpenGL texture.

Task-number: QTBUG-41065
Change-Id: Ia82c8f44bba1692a219edc5f9d78fc76c3d8a4ba
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2014-12-11 16:48:54 +01:00
Andrew Knight
791febc1d3 winrt: Fix camera auto rotation
There is no Windows Runtime API to find the camera sensor rotation, so
assume that phones always have a camera mounting of 270 degrees. Tablet
and webcams remain mounted at the default (0 degrees). As the frame is not
flipped automatically by the system, the scan line direction is set to
BottomToTop for front-facing cameras to achieve compatibility with
other platforms.

Task-number: QTBUG-41066
Change-Id: Icf17ecd4aca9fa9d5b24d94e5b21b63ee6f21f28
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-12-11 16:48:38 +01:00
Laszlo Agocs
2b181d5469 Make it compile with no-opengl
Change-Id: I71358bb1268e5b28b66b1817a3ec0cd98459cfd2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-12-11 16:22:34 +01:00
Andrew Knight
085362ab0f Remove private API use from video orientation handler
The QPA header isn't needed anymore, as nativeOrientation was added as
a QScreen property in 5.2.

Change-Id: I7cd00feae769175fd0c4be65b503e74ee910814a
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-12-11 16:13:47 +01:00
Yoann Lopes
f420ac286a GStreamer: better camera device name logic.
Use the device ID for QCameraInfo::description() when the driver
doesn't provide any display name.

Change-Id: Iff1f17187ecb52262412f85db04d7108fae71717
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2014-12-09 12:04:10 +01:00
Thiago Macieira
aa38d3dfb1 Disable warning about QObject::event being hidden
Found by Clang 3.6:
qdeclarativemediametadata_p.h:292:14: warning: 'QDeclarativeMediaMetaData::event' hides overloaded virtual function [-Woverloaded-virtual]
qobject.h:116:18: note: hidden overloaded virtual function 'QObject::event' declared here: different number of parameters (1 vs 0)

Change-Id: I4324c984649738c9625cc3eb9dddea6e2abf46a9
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-12-03 22:29:20 +01:00
Yoann Lopes
8b1ee17240 Added 5.4.0 change file.
Change-Id: I623b42d5f4f565ee7cf2d064e52609a99636bd6a
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
2014-12-03 20:27:39 +01:00
Yoann Lopes
9496d5fba5 OpenSL ES: volume support for QAudioInput.
The OpenSL volume interface is not available for audio inputs on
Android so we apply the volume ourselves on the PCM data.

Task-number: QTBUG-42159
Change-Id: If43d8aa576bc70a925681f0db1ca8b40e71f7b29
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2014-12-03 16:45:55 +01:00
Yoann Lopes
3443517265 Fix VideoOutput autoOrientation when switching cameras.
The VideoOutput's camera info was not updated when switching cameras.

Change-Id: I23537ce98b08009898eaa26ef14d5b9a746ab5f7
Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com>
2014-12-03 14:27:35 +01:00
Andrew den Exter
4bdf1561f4 Add additional exposure modes to QCameraExposure.
[ChangeLog][GStreamer][Android] Camera exposure mode extended to support
Action, Landscape, NightPortrait, Theatre, Sunset, SteadyPhoto,
Fireworks, Party, Candlelight, and Barcode modes.

Change-Id: I13d4bb042d27c0bd2ffcd369882b56bbabc84335
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-11-28 16:41:30 +01:00
Andrew den Exter
25ad679c25 Add a color filter property to QCameraImageProcessing.
[ChangeLog] New color filter property for QCameraImageProcessing.

Change-Id: I999e349e3e4f284b533fa62ba50903fbd21cb400
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-11-28 06:08:11 +01:00
Andrew den Exter
be7fef656a Add support for face detection focus point mode to camerabin backend.
[ChangeLog][GStreamer] Implemented the face detection focus point mode
in the gstreamer camerabin backend.

Change-Id: Ia582d2fb5e74d5b438aa0038224c5e20e597d53e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-11-28 06:07:59 +01:00
Andrew den Exter
9932feec63 Implement exposure and whitebalance lock for gstreamer camera.
Change-Id: I58277d69c18ad2e31cad719a2dd6361c0c2d7e98
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-11-28 06:07:44 +01:00
Andrew den Exter
dc2fec1bd8 Allow supported camera locks to change after initialization.
A camera backend may not be able to report which locks it supports
until after it is loaded, so query support on demand instead of caching
the value available at construction time.

Change-Id: I56fb1adee980ebc2fa893da3c983a6dce26329c0
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2014-11-28 04:19:35 +01:00
Yoann Lopes
108dda7a90 GStreamer: port to 1.0.
0.10 is still used by default.
To enable GStreamer 1.0, pass GST_VERSION=1.0 to qmake
for qtmultimedia.pro.

Contributions from:
Andrew den Exter <andrew.den.exter@qinetic.com.au>
Ilya Smelykh <ilya@videoexpertsgroup.com>
Jim Hodapp <jim.hodapp@canonical.com>
Sergio Schvezov <sergio.schvezov@canonical.com>

Change-Id: I72a46d1170a8794a149bdb5e20767afcc5b7587c
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2014-11-27 23:30:05 +01:00