Commit Graph

2028 Commits

Author SHA1 Message Date
Yoann Lopes
94c846fb48 CoreAudio: fix QAudioOutput state after resume().
In push mode, the state must be IdleState after resume(), and only
change to ActiveState once it receives some data.

Task-number: QTBUG-50390
Change-Id: I4a38aa84a55e90d7a2db3e1d504674b2a688bbde
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
2016-01-19 15:30:40 +00:00
Yoann Lopes
f97c4aaa86 WindowsAudio: fix QAudioOutput state after resume().
In push mode, the state must be IdleState after resume(), and only
change to ActiveState once it receives some data.

Task-number: QTBUG-50390
Change-Id: I0e12f4eaff350b9423e44779f229e0e1061cf576
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
2016-01-19 15:30:36 +00:00
Yoann Lopes
b4d03dc82f GStreamer: fix GstAppSrc usage.
Allow our GstAppSrc wrapper to be reconfigured with a new GstAppSrc
object. This is necessary because that object changes every time
playback is restarted, even for the same source. The consequence of
not allowing the reconfigure was that playback for a given qrc media
would only work the first time; any subsequent calls to play() would
not work since our wrapper wouldn't know about the new GstAppSrc object
and therefore wouldn't be able to produce any data.

Also improved management of the wrapper lifecycle.

Task-number: QTBUG-49531
Change-Id: I905afb6848cc7e9a563b4edc2c5875cdd7e53d21
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-19 12:26:45 +00:00
Liang Qi
02b8c7527a Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I01940fe4f3d059fbb425492a1748e2b5d9b6804b
2016-01-19 09:50:11 +01:00
Maurice Kalinowski
c9a841a376 winrt: Fix playback of files
The backend uses triple buffering in the background to prefetch some
buffers. However, at some point it tries to invoke SetCurrentPosition
beyond the end of the file. MSDN states that for IMFByteStream one
should return E_INVALIDARG, but that has negative sideeffects.

What happens is that immediately MF_MEDIA_ENGINE_ERR_DECODE is sent
causing the playback to stop, even if there are still valid buffers in
the queue. The example in the bug reports causes up to 5 seconds of
playback to be lost. This can also be reproduced with larger files.

To circumvent this, return S_FALSE instead to still notify that seeking
in the buffer did not work.

Task-number: QTBUG-49236
Change-Id: Id4b093bf9480f5d02c7f9191fa4424f51c60e078
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-18 15:39:43 +00:00
Pasi Petäjäjärvi
8d84a30e4d Be more permissive in QSoundEffect integration test.
Change-Id: I9f92fda79bb359f8fa53aa11b9b6889cd35fcb6e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-18 13:47:04 +00:00
Yoann Lopes
406f76b903 Windows: fix build with -opengl desktop.
Task-number: QTBUG-50510
Change-Id: Ide1b58061d0fcdd5caf8597af8cfaec2483d712b
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
2016-01-18 13:32:39 +00:00
Maurice Kalinowski
752c1f0077 winrt: Fix crash in debug mode
In debug mode we try to set the D3D11_CREATE_DEVICE_DEBUG flag to gather
additional information for debugging purposes. However, some devices do
not provide those and the D3D11CreateDevice call fails.

Instead, try to create a hardware non-debug device first before going
into the last software-mode fallback.

Task-number: QTBUG-49488
Change-Id: I2d91b5f54f7fd818103bd106314b8503e5759159
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-18 12:44:23 +00:00
Yoann Lopes
f69a051675 Fix tst_QVideoWidget.
Make sure the tested QVideoWidget has a valid size.
Since 7b63c45d in qtbase, native widgets are required to have a valid
size to be shown. This test relies on qWaitForWindowExposed() to work
correctly, which means the widget must be shown and thus must have
a valid size.

Change-Id: I13bc1536d788d9ba56b4dcbf0c60851b5634be9e
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-01-18 12:43:19 +00:00
Pasi Petäjäjärvi
8d88f172b6 Fix setting state to not playing when audio error occurred
Even if QAudioOutput has finished playing audio state don't
change to stopped because QSoundEffect checks only
QAudio::IdleState as when to stop itself.

Change-Id: Iea3a4926c87ea5a7b440e62d832bbc13bcdd3b6d
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-14 10:33:54 +00:00
Pasi Petäjäjärvi
dd0fa191ff Fix clearing signals already send after first part of audio data
Previous place for clearing received signal could errounsely
clear already sent signal which causes next signalState
comparison to fail on some platform.

Change-Id: Iaffdbbcab1ec9afa0be6f1f7b7aee62b981ee319
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-13 16:05:10 +00:00
Maurice Kalinowski
924dc7f48c winrt: add capabilities to launch app out of the box
Change-Id: I1cb8a589ee61f1dbc53bfd70eb25e7d2000af13e
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-01-13 15:26:39 +00:00
Pasi Petäjäjärvi
481dd30e2f Remove testing category to empty string
Not all backends have empty default category

Change-Id: I55025bf213063c5fd64dd5be4031aabf3a148a7b
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-13 14:16:56 +00:00
Pasi Petäjäjärvi
ba847185e2 Remove checking exact remaining loop amount right after calling play()
Depending on platform it is unknown how many times it has already been
actually playing the audio.

Change-Id: I27b65cee8de5f9f75ceda277ee22d86f7897ce7b
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-13 12:49:29 +00:00
Yoann Lopes
c7397523e7 Windows: Improve EVR presenter.
Removed hard dependency to Angle; it's now required only when rendering
to a texture. If Angle is not used, the buffers are now mappable to
system memory.

This enables HW-accelerated video decoding in QML for non-ANGLE
builds. Note that the frame data have to do a round-trip through system
memory, which is not ideal but still faster than SW decoding.

Task-number: QTBUG-45593
Change-Id: Icc3503142df4e8dbb53b4e11f409b161fd2f9bde
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-12 15:51:32 +00:00
Yoann Lopes
36549dbe14 DirectShow: use the EVR in the renderer control.
As for the window control, the existing code from the WMF plugin has
been refactored out and is now shared for both plugins.
This enables HW-accelerated video decoding in QML, QGraphicsVideoItem
and custom QAbstractVideoSurfaces (Angle is required).

Task-number: QTBUG-45593
Change-Id: I1d4dbf5695cdd4dbee93f9f4a957fa4d813aa85d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-12 15:51:24 +00:00
Christian Strømme
963a534e33 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ia563cf734178b821c2aadda8b79b1f09b17de7cd
2016-01-12 15:15:37 +01:00
Sergio Martins
0521766417 Fix usage of QMutexLocker, destroy it only at end of scope
Change-Id: I8b47d49f7a83a71a1b90ab57ee7bc3791ef59667
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-12 13:44:45 +00:00
Topi Reinio
9a2fcd06a8 Doc: Generate separate listing of Widgets classes in the QHP
Use the new QHP selection format to separately list the members of
Qt Multimedia and Qt Multimedia Widgets modules in the table of
contents.

Change-Id: I50be80a820111834207967eada0865d212be98a8
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2016-01-12 11:17:56 +00:00
Christian Strømme
c953ef3910 Android: Don't call restartViewfinder() for audio only recordings.
Calling restartViewfinder() would try to access m_cameraSession without
checking if it was valid. This change adds guards around the calls to
restartViewfinder(), and one in the function itself.

Task-number: QTBUG-50282
Change-Id: I1f2b4d2b2342bf2dc2b7f28a7bcd00e08a0edb44
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-11 14:17:22 +00:00
Topi Reinio
c5f5c7a5f2 Doc: Fix documentation warnings
- Fix incorrect paths passed to \example command
   - Fix resulting linking issues
   - Fix examplesinstallpath in .qdocconf
   - Remove unnecessary group definition

Change-Id: I72a437ac6d297f3c63d4f29a0e3110971d1e330f
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2016-01-08 11:47:52 +00:00
Christian Strømme
62268c2d4b Android: Media player improvments.
Add locks around the global media player pool to avoid races. And since
we don't need any of the features a map provides us, there's no reason
to use one. In the most extreme case it's unlikely that there will be
more then a couple media players active at one time, so iterating over
continuously storage containing only pointers should be at least as
fast, if not faster, then a map or a hash (and use less space).

Change-Id: Id8d7810b43a9217da402a4b825d7beec891cdf74
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-08 00:04:19 +00:00
Christian Strømme
3bd9da9aba Android: Improve detection of optimal settings for QAudioOutput.
This change will try to detect the optimal buffer size and sample-rate
on Android (requires API level 17+). If the device supports low-latency
playback, then it's recommended that application developers check the
preferred sample-rate through QAudioDeviceInfo::preferredFormat().
On most devices the preferred sample rate seems to be 48 KHz, so this
is now the default instead of 44.1 KHz.

Note that not all devices supports "proper" low-latency playback, and
there are no APIs to retrieve information about how many devices that
can be active at the same time; The only remotely quantitative value
I've found is "a few"...

Change-Id: I0708738b4a31f6bf9e88e9a816679cb688e023f3
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-08 00:04:12 +00:00
Christian Strømme
ddaacc147e Android: Call release() in AndroidMediaMetadataRetriever's destructor.
This should be the default when the wrapper is destroyed.

Note: It's not possible to re-use the instance after release() is
called.

Change-Id: I761cac05ed2c2cda49573c69c6803b136892c528
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-07 22:34:34 +00:00
Christian Strømme
63c53d21bd Android: Make the meta-data reader async
Reading the meta-data can be slow and cause the UI to become
unresponsive. This is especially noticeable when the media source
is loaded from a remote location, or over a slow network.
To improve this situation the media-reader is moved off the main thread
and we wait until the media is loaded before starting the meta-data
extraction.

Task-number: QTBUG-46491
Change-Id: I0b9cf2ae6b8e08596a2f0b8fa0042d74604c46f9
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-01-07 22:34:19 +00:00
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
Liang Qi
6166f102f5 Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	src/plugins/android/src/wrappers/jni/androidcamera.cpp

Change-Id: Ibb34f710b1dfb9a23b378462f31432581c6c26f4
2016-01-07 11:13:47 +01:00
Yoann Lopes
0a7b553eea Blacklist tst_qmediaplayerbackend::seekInStoppedState() on RHEL.
Change-Id: I150be89f71684890d65fd157a5b1782468636751
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-06 15:21:12 +00:00
Yoann Lopes
e3123185a5 DirectShow: fix metadata signals when changing media.
The metaDataChanged() and metaDataAvailableChanged() signals should
be emitted immediately when changing or clearing the current media.

Change-Id: I3152e2c32420ba6f11cf6780013e02208a9d6599
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-06 15:20:59 +00:00
Yoann Lopes
704ac34cc7 Favor more commonly supported formats in qmediaplayerbackend test.
Prefer mp4 and mp3 over ogv and mkv.

Change-Id: Id24d475207ccf76e113557f9ad14775477f414aa
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-06 15:20:57 +00:00
Yoann Lopes
e8a75e225b Make qmediaplayerbackend::processEOS test less flaky.
Change-Id: Ib961f3d4e238a156dc2e1ade1828ae8f1bf5b755
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-06 15:20:55 +00:00
Yoann Lopes
4fcf153d68 DirectShow: fix media player's positionChanged() signal.
The signal was not emitted at the right time or with incorrect values
under certain circumstances.

Change-Id: Ib8b1d38381d908399752856db7b0a987c4422bb1
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-01-06 15:20:50 +00:00
Kevin Funk
315a946e40 Add virtual dtor to QSGVideoNodeFactoryInterface
Makes it compile for me

Change-Id: Ib79f4c38bb165d3698a94c5d1aafee710423a907
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-12-22 10:22:24 +00:00
Yoann Lopes
2593f00411 Make qmediaplayerbackend::seekPauseSeek test less flaky.
Change-Id: I05e4b9d392359bd84f9e932864a2e14275ef625f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-18 19:08:20 +00:00
Yoann Lopes
82e135167a Change the way a playlist is bound to a media object.
The previous behavior was to simply switch from the internal
control to the service's control, discarding anything that was
added to the playlist before binding.
We now carry over the changes made to the playlist when switching
controls. This means the switch is now transparent to the user.
When the service's control is read-only, we cannot transfer the
items, which means the user must be notified of the items that
might have been "lost" during the switch.

Auto-test modified to reflect this change.

Change-Id: Ibf80b650b06425ddbaeb320b72ac5d3082a25960
Reviewed-by: Jim Hodapp <jim.hodapp@canonical.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-11 14:53:16 +00:00
Tony Sarajärvi
94c33684fe Blacklist qmediaplayerbackend tests in OSX 10.11
These were found to also fail in OSX 10.11

Task-number: QTBUG-46368
Change-Id: Ifac6fd0540ff63f3eb5198b5ac76c65ee893f005
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-11 11:09:06 +00:00
Tony Sarajärvi
e796e3a55f Blacklist qaudiodecoderbackend tests in OSX 10.11
These were found to fail also in OSX 10.11

Task-number: QTBUG-46331
Change-Id: I619816655c614c08183ab700bca8bd7ec5384a91
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-11 11:09:00 +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
Denis Shienkov
dd2b63498a GStreamer: Add color balance and sharpening adjustments using V4L2
GStreamer's backend does not implements this features, therefore now is
used the V4L2 interface for the contrast, saturation, brightness and the
sharpening adjustments. The V4l2 interface works together with the
GStreamer and covers the features which are not supported by the
GStreamer.

Change-Id: I995ed6cb096a29543fb80206384a92c13a1d1af2
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-10 16:07:26 +00:00
Denis Shienkov
fcb511b6d6 DirectShow: Get current image processing parameter from the cache
We can simplify a code, do not need to call pVideoProcAmp->Get()
each time when we want to get current parameter value. It is
better to do this once from updateImageProcessingParametersInfos().
In this case we will return desired parameter from the local cache.

Change-Id: If33c3882230c9ae817071ace5b792dfe31685a7f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-10 13:12:55 +00:00
Denis Shienkov
5becd7c1a9 DirectShow: Add WhiteBalancePreset and ColorTemperature for the camera
Change-Id: I9a646418d6177338735e1eb38967fd092e21e0cf
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-10 13:12:38 +00:00
Denis Shienkov
ab403bc9ae GStreamer: Adjust the camera's manual color temperature through V4L2
GStreamer does not support setup of manual color temperature for the
camera. Now it is implemented through the V4L2 interface, where it is
works together with the GStreamer and covers the GStreamer's holes.

Change-Id: Icaeadeb4e21ec7865bcfa908bead318d4ead8ba5
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-10 11:26:00 +00:00
Venugopal Shivashankar
5916caae7a Doc: Move all doc artifacts under one project
Although the Qt Multimedia module has two submodules, a
single project is sufficient to document these submodules,
avoiding unnecessary maintenance overhead.

Change-Id: I8fab48241b5c9aba35890a8aaa28ce7154f78c45
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2015-12-07 15:44:49 +00:00
Yoann Lopes
2b7c617e09 WMF: correctly handle media with multiple streams.
Only use the default streams and make sure only one stream of each kind
(audio/video) is added to the topology.

Change-Id: Ied37174fa722068b4cd1b5f91b60e0cef5c1d7b3
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-04 11:41:52 +00:00
Yoann Lopes
8ed8f33c18 WMF: correctly handle samples in the video probe transform.
Set the right flags so the renderer doesn't allocate its samples.
We can then just forward the samples we get from the upstream element
and avoid a copy.

Change-Id: Iafc15b81531a7415823d063c47a326ea6239136f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-04 11:41:46 +00:00
Yoann Lopes
a6164acd2f WMF: fix type negotiation in video probe transform.
- report supported types (same as the video sink)
- handle type changes coming from upstream

Change-Id: I922fc4869ecac3999e055c39adf1b847127a0012
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-04 11:41:42 +00:00
Yoann Lopes
43f3d14a99 Android: fix QMediaRecorder crashing the camera server on some devices.
Some devices require MediaRecorder.setPreviewDisplay() to always be
called, even though the Android doc says otherwise.

Task-number: QTBUG-37837
Change-Id: I1e9b56f06e7c41bdf684f93b5ec7635f8ae9f379
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-04 11:41:31 +00:00
Yoann Lopes
8debbfbc9b Android: support non OpenGL video surfaces for the camera.
QCamera can now pass raw frame data to its QAbstractVideoSurface.
The now deprecated Android camera API we're using doesn't allow to
get frame data without also displaying the frames in a SurfaceView
or a SurfaceTexture. To work around that, an invisible dummy
SurfaceView is used.
This allows to retrieve frames in the NV21, YV12, YUY2 or RGB565
formats, depending on the Android version and on the device.

Task-number: QTBUG-35416
Change-Id: I77b4f50505c3b91efb4b2288a57f50398922c0db
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-04 11:41:25 +00:00
Christian Strømme
ece9005efe Android: Camera updates
There's no need for callbacks to block any other threads from reading
from the camera pool, so use a read/write lock instead. There's also no
benefits gained from using a QMap, so use a QHash map instead.

Change-Id: Iaac74c0173d2dddc296f5d2c03116724ffdc588c
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-04 11:41:20 +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