Commit Graph

1698 Commits

Author SHA1 Message Date
Pasi Petäjäjärvi
9f35d7763e Fix playing sound in loop if sample size is small
If sample size is smaller that current periodsize,
then playing sample multiple times in loop will fail.
Reason is data offset of sample is set out of the
bounds actual sample data size.

Change-Id: I81f580cbb8dabf89db0d61528f5f1c9489216e0c
Task-number: QTBUG-49838
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-07 11:54:43 +00:00
Yoann Lopes
604a5753fa AVFoundation: correctly set the activeFormat on the AVCaptureDevice.
According to the AVCaptureDevice documentation, the device must be
locked before starting the capture session to prevent the activeFormat
from being overridden. We now do that, but only if we explicitly set
an activeFormat. Otherwise the device is not locked, which allows
the session to find an appropriate format for the capture device.
The device is also locked when enabling video capture, as doing so
might also reset the activeFormat.

Task-number: QTBUG-49170
Change-Id: I75478fd4bbfec96cd2abd2c3ae2951088b38978e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-12-10 18:07:03 +00:00
Roger Maclean
8b00d8e542 QNX: Handling looping properly
On play, if we're at the end of media, set the position to
the beginning.  The code was previously setting the position
to the last known position, likely just prior to the end
which causes the last few frames of video to be played
endlessly.

Task-number: QTBUG-49668
Change-Id: I9613114294c22152dd66ae7111c38c8cdef5b907
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-03 11:57:51 +00:00
Yoann Lopes
5ed9b6d6d7 AVFoundation: fix setting up the video capture session.
Because of an incorrect 'if' condition, the video capture session was
set up twice when starting the camera.

Change-Id: I4211a8c77ab9b8086628fb0f12fb28842de830cf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-03 09:40:28 +00:00
Yoann Lopes
8dc46cef05 AVFoundation: fix setting the camera viewfinder resolution.
Image capture resolution and viewfinder resolution must be the same,
with the image capture resolution taking precedence over the viewfinder
resolution when both are explicitly set.
The code was getting the active image capture resolution, instead of
the one explicitly requested, to adjust the viewfinder resolution.
That effectively made the viewfinder resolution always ignored since
the active capture resolution always has a default value.

Task-number: QTBUG-49170
Change-Id: I2f3d01366d83a3e28c0a1ea0109663cfdfa75963
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-12-03 09:40:21 +00:00
Yoann Lopes
b7880782b9 Android: check for exceptions in some camera operations.
Not all camera operations are documented to raise exceptions, but they
actually might do so depending on the hardware/drivers.
Check for exceptions in all functions that could porentially fail
and react appropriately.

Task-number: QTBUG-49134
Change-Id: I633ca7f2e3aeb6532e1c445735e62135f52cf25f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-03 09:40:16 +00:00
Raphael Kubo da Costa
3b322323d0 alsa: Relax ALSA version checks for 1.1.x to be detected.
Relax the check for SND_LIB_MINOR and SND_LIB_SUBMINOR so that ALSA
1.1.x is not considered older than 1.0.10. QtMultimedia builds fine with
ALSA 1.1.

Change-Id: If697c34cc7d9bbe2f2a3413d0c25ac4de4e93b34
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-27 22:41:13 +00:00
Yoann Lopes
9b5a67d810 AVFoundation: improve viewfinder settings.
Retrieving the supported viewfinder settings don't actually require
a video surface, we just need a capture device. The supported settings
can now be retrieved without calling QCamera::setSurface().
More generally, all viewfinder settings that don't require a video
surface can now be gotten/set before calling setSurface().

Task-number: QTBUG-49170
Change-Id: I39b14eeb40517a9ba399748b5778be8bbc8cfcda
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-11-20 16:49:01 +00:00
Yoann Lopes
5135ffaf2a Add qt_real_to_fraction() helper function.
Private API meant to be used by plugins whose backends expect frame
rate values represented by a ratio.
The function implementation was moved from the AVFoundation plugin
to the QtMultimedia library.

Change-Id: I555b9d5da5ca3bae88992ed03501869fb731e45f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-19 11:59:25 +00:00
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