Commit Graph

1689 Commits

Author SHA1 Message Date
Yoann Lopes
7c4574a698 Support compiling with GStreamer < 0.10.32 in the camerabin plugin.
The documented minimum GStreamer version for Qt Multimedia is 0.10.24,
however, the camerabin plugin actually required 0.10.32 to compile
successfully. The reason is mainly due to the GstEncodingProfiles
API, which is used to implement the audio and video encoding settings
controls. There's no hard requirement for that API anymore and the
aforementioned controls simply don't do anything when the GStreamer
version used to compile is older than 0.10.32.
A few other GStreamer calls had to be ifdef'd or replaced in order
to compile with 0.10.24.
Note that this patch only makes sure it compiles with older versions,
running the camerabin plugin with GStreamer < 0.10.32 is currently
untested and it might not work as expected.

Task-number: QTBUG-48914
Change-Id: I4ce8e932f24a33e919e29326729e12bbae561faf
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-19 11:59:20 +00:00
Morten Minde Neergaard
4a2c597a06 Don't initialize volume on pulse audio input by default.
Task-number: QTBUG-49461
Change-Id: I32b707e19091ab8344175b2dc0cdd1747f1186b3
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-11-19 11:56:04 +00:00
Yoann Lopes
c106041bd6 GStreamer camerabin: always provide the zoom control.
It doesn't actually require GstPhotography to be available at compile
time.

Change-Id: I738e71e4a108a40e79440096be6607afff0134fa
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-28 14:59:05 +00:00
Yoann Lopes
3d3d2a4967 GStreamer: fix compilation with version < 0.10.31.
Qt 5.4 and earlier required GStreamer 0.10.24 as minimum version.
Qt 5.5 added code that requires 0.10.31, this code is now ifdef'd
and we now support again 0.10.24.

Task-number: QTBUG-48353
Change-Id: Ie708a33c0515874b003ce26a3400475075d316ca
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 08:32:36 +00:00
Yoann Lopes
0cf41ef53f Fix signal/slot declaration in QVideoOutputOrientationHandler.
Change-Id: I03cdd677feaf06ac2d61682cab46232f983e6494
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-16 12:45:41 +00:00
Yoann Lopes
d1bf781c66 AVFoundation: fix camera frames texture format.
Change-Id: I87ca4abf80a5be9983aefc791b8a0ef0cd4ac33d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-16 12:45:32 +00:00
Liang Qi
5232c993a1 Merge remote-tracking branch 'origin/5.5.1' into 5.5
Change-Id: I9c55b5a63321475a468fb3a1b6ab775a9fe12689
2015-10-13 10:09:34 +02:00
Yoann Lopes
46a83d5b86 AVFoundation: render camera frames using OpenGL textures on iOS.
OpenGL textures can easily be created from a CVImageBuffer using
Apple APIs. It avoids having to map the buffer to main memory and
therefore greatly improves rendering performances.

We could do the same on OSX, but there, the textures are always of
the GL_TEXTURE_RECTANGLE target type and changes need to be
done to the QVideoFrame API and to the video node implementations
to support that.

Change-Id: I6dde7e8d7a27460e41523cd474c3c741affc1480
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-17 13:10:28 +00:00
Marco Benelli
99f6cf5f28 Fixed revisions of camera-related meta objects.
Change-Id: I91fe90122d53ce12322cecac8282ef9622869b71
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-09-15 13:02:34 +00:00
Yoann Lopes
c595fc74ab Add 5.5.1 change file.
Change-Id: Icb8094e4d6ae94be43b726a25881350a6f266ef4
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 11:33:17 +00:00
Yoann Lopes
9c5292927e AVFoundation: implemented QMediaPlayer::seekable.
Change-Id: Iaca8daa2460062954497b3e510dd1828953c80fd
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:10:25 +00:00
Yoann Lopes
e9cf6670fe AVFoundation: fix rendering when player reached EndOfMedia.
Once the media player reached the end of the media, it shouldn't be
rendering frames anymore. This could happen when seeking after reaching
the end.
The output layer is now cleared on EndOfMedia to make sure that doesn't
happen.

Change-Id: I18a21eaff6c63a2bd54d4c2953f89eb1722f66d5
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:10:21 +00:00
Yoann Lopes
fdac8d9c74 AVFoundation: correctly unload current media.
When loading a new media, we should unload the previous media.
This makes sure all properties set right after loading a new media
(e.g. position, volume) are correctly set on the new AVPlayer and
not on the old one.

Change-Id: I4cd71b785ccdb4cd0772cedffc3c25665f402776
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:10:16 +00:00
Yoann Lopes
bede0a838d AVFoundation: store seek requests before media is loaded.
And actually seek once the media is loaded.

Task-number: QTBUG-48057
Change-Id: I9446a1e66a48f9a94c039be9af81689ed04bc56c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:10:12 +00:00
Yoann Lopes
6a6a69b7d8 AVFoundation: fix initial volume.
The volume level set before loading a media was never actually set on
AVPlayer.
Regression introduced by 4e07ff99 on OSX.

Task-number: QTBUG-48154
Change-Id: I599e3d55b35d7196aebc4753a367a29049f99d33
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:09:42 +00:00
Yoann Lopes
95fa47f747 AVFoundation: fix playback rate.
Calling play on the AVPlayer internally resets the playback rate, which
means any playback rate set before calling play was ignored.
We now always call setRate to start playback to avoid resetting the
rate with play.
Aslo fixed the playbackRateChanged() signal that was never emitted.

Task-number: QTBUG-45570
Change-Id: I3a77e1db31c57f1e3491287bdf977731b9d73509
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:09:11 +00:00
Yoann Lopes
29ce8886b3 Android: allow to map video buffers.
Since we internally use a fbo, use QOpenGLFramebufferObject::toImage()
to grab the pixel data and enable the use of map() on frames retrieved
using QAbstractVideoFilter.

Change-Id: If96e992e12e26091524913bb24926fa21d9d58cc
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-09-08 10:18:01 +00:00
Yoann Lopes
edc415be47 Fix crash in QSoundEffect when using it from a non-GUI thread.
The internal QIODevice used as data source was not set as child of the
parent QSoundEffectPrivate. If moveToThread() was called on the
QSoundEffect, the QIODevice would still receive events on the main
thread, leading to race conditions.

Task-number: QTBUG-46359
Change-Id: I180da2fb498108b316fd9b5b5cc84376b360fa3f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-25 14:12:04 +00:00
Yoann Lopes
4eb4a3ada3 Fix QML Camera::supportedViewfinderFrameRateRanges().
Pass the resolution argument as a QJSValue instead of a QSize.
This allows to be more flexible and doesn't require the QML argument
to be an actual QML 'size' value. It can be any object with the
'width' and 'height' properties.

Added missing auto-tests for supportedViewfinderResolutions()
and supportedViewfinderFrameRateRanges().

Change-Id: I6c8ae72e6dab8c9d12bbada5b8e7f45e96e9289d
Task-number: QTBUG-47630
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-08-25 11:18:51 +00:00
Yoann Lopes
ded4d7b006 Fix possible crashes in QDeclarativeRadioData.
It would crash when accessing any of its properties when there is no
radio backend available.

Task-number: QTBUG-47859
Change-Id: Ic7c0a70ca3e9a4768359b3429ea812caece09fce
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-25 08:56:17 +00:00
Yoann Lopes
008d20e0ec Android: minor refactor of the camera frame callback.
Change-Id: I6b281c9b2d02cf223e66e04e31fdd0268aa277fc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-20 07:03:54 +00:00
Yoann Lopes
2e54790a59 Android: fix video probes when recording the camera.
The preview frame callback is cleared by the Android Camera whenever a
MediaRecorder is set up. We need to reset the callback after starting
the media recorder.

Change-Id: I604320b11eb3a7f6f8d7d3167d5aae371999be14
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-20 07:01:10 +00:00
Yoann Lopes
28a20861fd QMediaPlayer: clear current playlist on deletion.
Makes sure the current playlist is unbound when QMediaPlayer is
destroyed.

Change-Id: If25efa67bf79af0326f6125d9615165a2c7dd6bb
Reviewed-by: Jim Hodapp <jim.hodapp@canonical.com>
Reviewed-by: Loïc Molinari <loic.molinari@canonical.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-19 11:32:35 +00:00
Yoann Lopes
cd3d540522 GStreamer: refactored widget and window control.
Instead of always using xvimagesink as GStreamer backend for the
widget and window control (works only with X11), we now try to
pick a video sink that fits the current configuration.
It first tries a set of known video sinks that can work with
the Qt platform plugin in use. If none is available, it
dynamically picks a video sink available on the system that can be
used with our backend.

Even if the video sink is now picked in a smarter way, xcb is still
the only supported platform plugin. The reason is that it's the
only Unix plugin which can provide a valid native window handle.
Additional work is needed to support other plugins like wayland
or directfb.

Change-Id: I3843dea363d6a0b85a6cc1f2952783b743e48ac6
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-18 13:16:50 +00:00
Yoann Lopes
13e40d522f Fix QCamera viewfinder capabilities functions..
- Filtering the results for a specific pixel aspect ratio would return
  wrong values.
- Correctly sort the frame rate ranges returned by
  supportedViewfinderFrameRateRanges().

Added missing auto-tests for all viewfinder capabilities functions.

Change-Id: Idfb40d4139cc48a5996ce2ddd98131a2f5be76bb
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-18 12:58:00 +00:00
Ricardo Salveti de Araujo
e0b9217d27 Avoid races when sending EOS
In order to avoid races when sending EOS, we need to make sure that the
pipeline is in playing state first.

Task-number: QTBUG-45707
Change-Id: I518e89badf38bea8ab8e2cead9a1ca09659af8b2
Reviewed-by: Timo Jyrinki <timo.jyrinki@canonical.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-18 09:49:09 +00:00
Yoann Lopes
c9533b5aaf GStreamer: added convenience function in QGstUtils.
-> qt_gst_element_get_factory_name(GstElement *elem)

Change-Id: Icf806488b49fbcdecdd605b6316bd1ef8796a883
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-13 13:26:26 +00:00
Thiago Macieira
8b85c5a28e Add the GPLv3 license text
LGPLv3 refers to it but does not include it in its body.

Change-Id: Ib056b47dde3341ef9a52ffff13eed18cf3504738
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-08-13 15:07:55 +02:00
Yoann Lopes
8ba1e65291 Fix camera plugin selection.
When requesting a camera plugin for a given device id, it should fall
back to any available plugin if that device id is not found.

Change-Id: I685294c7fdcaa72bce70178b0aae2ec92e79e107
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-12 14:07:21 +00:00
Christian Strømme
dc1712d4b2 Remove obsolete check in QMediaService
The macro QT_NO_MEMBER_TEMPLATES was removed eons ago.

Change-Id: Ifc4f3ac8bcf1e9b42fad5dcfb101e3446a254abc
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-12 11:34:44 +00:00
Loïc Molinari
b05e9d99c2 Bind the playlist connected to a player.
Change-Id: I3c2e00773c88f671bdffcfe8c8175330ca405d4a
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-12 09:43:53 +00:00
Venugopal Shivashankar
ae9095d5bc Doc: Corrected a typo.
Change-Id: I53ab7ddf0a8c0416dce19bf2b642e7e294f3c868
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-11 13:53:38 +00:00
Yoann Lopes
68a09d3093 Fix documentation for QML metaData property.
For Audio, Video, MediaPlayer and Camera types.
Group the sub properties as a \qmlproperty group, which makes
the doc much clearer.

Change-Id: Id990d7b14a4c3f86768c6b3b4990845f84839944
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-08-11 13:36:41 +00:00
Yoann Lopes
6df6cacbb0 Fix qdoc warnings.
Change-Id: Ie351f33f88270186b7df0f9cd671fa4e31624231
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-08-11 13:14:28 +00:00
Yoann Lopes
b8553dae1d Doc: update qml module version to 5.5.
And remove import statements from snippets.

Change-Id: I109beabd445186f96f0750b6f23fb623c125181e
Task-number: QTBUG-47620
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-08-11 13:07:34 +00:00
Yoann Lopes
a00c588c70 Improve documentation for mediaObject property.
In Camera and MediaPlayer types.

Change-Id: Iaf17dc7e5f7075ce7eeefcf7992b970d1ea99e83
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-08-11 09:44:08 +00:00
Loïc Molinari
6684b4b23b Emit mediaAboutToBeRemoved() before mediaRemoved() in QMediaPlaylist.
When a new playlist's mediaObject is set, the content is cleared and the
mediaRemoved() signal is emitted without a former
mediaAboutToBeRemoved(). This is an issue for QAbstractItemModel
implementations, like the coming QDeclarativePlaylist, which call
beginInsertRow() and endInsertRows() in the respective signal handlers.

Change-Id: I7ec512ff2736e92858df94d9479741e05162e1f0
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-10 12:13:21 +00:00
Loïc Molinari
475a14ccc3 Check and fix up bounds in QMediaPlaylist methods.
Change-Id: I665d665139dbe9663b20ecb08fa3dab9cbe3f899
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-10 11:37:44 +00:00
Loïc Molinari
414b748b23 Clean up QMediaPlayer documentation.
Change-Id: I2d744542270f283ccd8ba0160aeda7faa56b2b86
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-10 11:19:58 +00:00
Yoann Lopes
3c54acb6f7 Add new property to QVideoSurfaceFormat.
The 'mirrored' property indicates the QVideoFrames need to be mirrored
along their vertical axis. This is typically needed for video frames
coming from a front camera on a mobile device.

This is implemented as a string-based property. In Qt 5.6, this should
be replaced by a new public function.

Change-Id: Ideb7de81e83f66826f4efb5f2951c4beec13546b
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-07 17:35:12 +00:00
Thiago Macieira
bc9cfcd08a Fix warnings about unused private fields
avfaudioinputselectorcontrol.h:68:23: warning: private field 'm_service' is not used [-Wunused-private-field]

Change-Id: I5722a2d1bf592862af3a4d36554419a653662892
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-06 16:00:03 +00:00
Thiago Macieira
b048f26281 Don't list avfcamerainfocontrol header and sources twice
This produces Makefile warnings
Makefile.Debug:351: warning: overriding commands for target `.obj/debug/avfcamerainfocontrol.o'
Makefile.Debug:337: warning: ignoring old commands for target `.obj/debug/avfcamerainfocontrol.o'
Makefile.Debug:514: warning: overriding commands for target `.moc/debug/moc_avfcamerainfocontrol.cpp'
Makefile.Debug:506: warning: ignoring old commands for target `.moc/debug/moc_avfcamerainfocontrol.cpp'
Makefile.Debug:351: warning: overriding commands for target `.obj/debug/avfcamerainfocontrol.o'
Makefile.Debug:337: warning: ignoring old commands for target `.obj/debug/avfcamerainfocontrol.o'
Makefile.Debug:514: warning: overriding commands for target `.moc/debug/moc_avfcamerainfocontrol.cpp'
Makefile.Debug:506: warning: ignoring old commands for target `.moc/debug/moc_avfcamerainfocontrol.cpp'

Change-Id: I2ec77cb92b4d218e5b07d895fdb96497061b527b
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-08-06 15:58:52 +00:00
Yoann Lopes
6b19a24b58 GStreamer: use QMediaStorageLocation to generate capture file names.
Change-Id: I2111eb8e28f60ca6305a48a8ee9299bc14ab0df9
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-04 12:56:54 +00:00
Yoann Lopes
b6dd9558a7 GStreamer: fix possible integer overflow in comparison.
Change-Id: I6cf4349f89320f72cce4d04cdf909476e583d11f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-08-04 12:56:35 +00:00
Peng Wu
94eb599b69 winrt: Fix crash during certain video operations
The abstract video buffer pointer was being reused and (improperly)
deleted when its reference count went to zero. As QVideoFrame utilizes
an explicitly shared pointer which also tracks the video buffer, simply
reuse the QVideoFrame instance instead.

Task-number: QTBUG-47373
Change-Id: Idadae205cb520a0a1d752aa20256c0567b3be699
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-07-28 13:12:30 +00:00
Yoann Lopes
f25034afaf Fix video nodes material comparison.
Don't consider a material equal to another when their texture IDs
are not available yet.

Change-Id: Id4127d71abb2db33950a206dc722b24ab626e960
Task-number: QTBUG-47205
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-07-20 10:25:52 +00:00
Nico Vertriest
9ae70447d5 Doc: replace Mac OS X with OS X
Task-number: QTBUG-40759
Change-Id: I11b3aa74d35064371cbbbeba660114e086b16aea
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-07-15 13:57:03 +00:00
Yoann Lopes
bcdac5539d GStreamer: fix supported values returned by CameraBinImageProcessing.
Change-Id: I5a4db9c055495714943421742dd237b6abf7daee
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-07-14 12:30:23 +00:00
Friedemann Kleint
5f11c33fd5 WindowsAudio: Fix compiler warnings by g++/MinGW.
Replace NULL by 0 for parameters of type DWORD_PTR.

qwindowsaudiodeviceinfo.cpp: In member function 'bool QWindowsAudioDeviceInfo::testSettings(const QAudioFormat&) const':
qwindowsaudiodeviceinfo.cpp:220:50: warning: passing NULL to non-pointer argument 4 of 'MMRESULT waveOutOpen(LPHWAVEOUT, UINT, LPCWAVEFORMATEX, DWORD_PTR, DWORD_PTR, DWORD)' [-Wconversion-null]
                                 WAVE_FORMAT_QUERY) == MMSYSERR_NOERROR);                                                  ^
qwindowsaudiodeviceinfo.cpp:220:50: warning: passing NULL to non-pointer argument 5 of 'MMRESULT waveOutOpen(LPHWAVEOUT, UINT, LPCWAVEFORMATEX, DWORD_PTR, DWORD_PTR, DWORD)' [-Wconversion-null]
qwindowsaudiodeviceinfo.cpp:223:50: warning: passing NULL to non-pointer argument 4 of 'MMRESULT waveInOpen(LPHWAVEIN, UINT, LPCWAVEFORMATEX, DWORD_PTR, DWORD_PTR, DWORD)' [-Wconversion-null]
                                 WAVE_FORMAT_QUERY) == MMSYSERR_NOERROR);                                                  ^
qwindowsaudiodeviceinfo.cpp:223:50: warning: passing NULL to non-pointer argument 5 of 'MMRESULT waveInOpen(LPHWAVEIN, UINT, LPCWAVEFORMATEX, DWORD_PTR, DWORD_PTR, DWORD)' [-Wconversion-null]# ==[ Please wrap at 72 characters ]===================================|

Change-Id: Ie8f65e0e1f4f1274a1b634f3701ae0103e716d97
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-07-13 13:42:41 +00:00
Oswald Buddenhagen
9fdc4a3a63 Bump version
Change-Id: I0dbadc590809bed7a24a8721a3b4a42a207bcc7b
2015-06-29 10:47:53 +02:00